Making SetFocus (View) private.

This commit is contained in:
BDisp
2020-07-28 18:31:32 +01:00
parent f3d6a1e351
commit fda4e21341
15 changed files with 42 additions and 35 deletions

View File

@@ -253,12 +253,7 @@ static class Demo {
});
ntop.Add (menu);
string fname = null;
foreach (var s in new [] { "/etc/passwd", "c:\\windows\\win.ini" })
if (System.IO.File.Exists (s)) {
fname = s;
break;
}
string fname = GetFileName ();
var win = new Window (fname ?? "Untitled") {
X = 0,
@@ -277,6 +272,18 @@ static class Demo {
Application.Run (ntop);
}
private static string GetFileName ()
{
string fname = null;
foreach (var s in new [] { "/etc/passwd", "c:\\windows\\win.ini" })
if (System.IO.File.Exists (s)) {
fname = s;
break;
}
return fname;
}
static bool Quit ()
{
var n = MessageBox.Query (50, 7, "Quit Demo", "Are you sure you want to quit this demo?", "Yes", "No");
@@ -312,7 +319,8 @@ static class Demo {
});
ntop.Add (menu);
var win = new Window ("/etc/passwd") {
string fname = GetFileName ();
var win = new Window (fname) {
X = 0,
Y = 1,
Width = Dim.Fill (),
@@ -320,7 +328,7 @@ static class Demo {
};
ntop.Add (win);
var source = System.IO.File.OpenRead ("/etc/passwd");
var source = System.IO.File.OpenRead (fname);
var hex = new HexView (source) {
X = 0,
Y = 0,
@@ -647,7 +655,7 @@ static class Demo {
win.Add (test);
win.Add (ml);
var drag = new Label ("Drag: ") { X = 70, Y = 24 };
var drag = new Label ("Drag: ") { X = 70, Y = 22 };
var dragText = new TextField ("") {
X = Pos.Right (drag),
Y = Pos.Top (drag),