summaryrefslogtreecommitdiff
path: root/reference/csharp/ui
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2018-07-13 10:14:04 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2018-07-13 10:15:26 -0300
commitf1a5d614f8f4a76785773790870553774e8c722d (patch)
tree6a63e7299f6047cbccf937a11c7f36bf690fb28a /reference/csharp/ui
parent62ca3163758f231991dab65b61203cd446015e60 (diff)
tutorials: Fix C# UI reference guides
Summary: These guides needed to be adapted to the new C# API. Test Plan: Didn't build before, and now it can be built and run. It has some runtime errors on exit. Reviewers: felipealmeida, lauromoura, Hermet Reviewed By: Hermet Tags: #examples Differential Revision: https://phab.enlightenment.org/D6575
Diffstat (limited to 'reference/csharp/ui')
-rw-r--r--reference/csharp/ui/src/ui_container.cs40
-rw-r--r--reference/csharp/ui/src/ui_sizing.cs20
2 files changed, 30 insertions, 30 deletions
diff --git a/reference/csharp/ui/src/ui_container.cs b/reference/csharp/ui/src/ui_container.cs
index a36a805..714572d 100644
--- a/reference/csharp/ui/src/ui_container.cs
+++ b/reference/csharp/ui/src/ui_container.cs
@@ -16,23 +16,23 @@ public class Example
16 } 16 }
17 17
18 // Load a simple table layout into the window 18 // Load a simple table layout into the window
19 static efl.ui.Table SetupUiTable(efl.ui.Win win) 19 static efl.ui.ITable SetupUiTable(efl.ui.IWin win)
20 { 20 {
21 efl.ui.Table table = new efl.ui.TableConcrete(win); 21 efl.ui.ITable table = new efl.ui.Table(win);
22 22
23 table.SetTableColumns(2); 23 table.SetTableColumns(2);
24 table.SetTableDirection(efl.ui.Dir.Right, efl.ui.Dir.Down); 24 table.SetTableDirection(efl.ui.Dir.Right, efl.ui.Dir.Down);
25 25
26 efl.ui.Button button = new efl.ui.ButtonConcrete(win); 26 efl.ui.IButton button = new efl.ui.Button(win);
27 button.SetText("Long Button"); 27 button.SetText("Long Button");
28 28
29 table.PackTable(button, 0, 2, 2, 1); 29 table.PackTable(button, 0, 2, 2, 1);
30 30
31 for (int i = 1; i <= 4; ++i) 31 for (int i = 1; i <= 4; ++i)
32 { 32 {
33 efl.ui.Button btn = new efl.ui.ButtonConcrete(win); 33 efl.ui.IButton btn = new efl.ui.Button(win);
34 btn.SetText($"Table {i}"); 34 btn.SetText($"Table {i}");
35 table.Pack(btn); 35 table.DoPack(btn);
36 } 36 }
37 37
38 return table; 38 return table;
@@ -40,14 +40,14 @@ public class Example
40 40
41 // Load some boxes - a horizontal one for the window layout and a vertical 41 // Load some boxes - a horizontal one for the window layout and a vertical
42 // one to contain a flow 42 // one to contain a flow
43 static efl.ui.Box SetupUiBoxes(efl.ui.Win win) 43 static efl.ui.IBox SetupUiBoxes(efl.ui.IWin win)
44 { 44 {
45 efl.ui.Box box = new efl.ui.BoxConcrete(win); 45 efl.ui.IBox box = new efl.ui.Box(win);
46 box.SetPackPadding(5, 0, true); 46 box.SetPackPadding(5, 0, true);
47 47
48 for (int i = 1; i <= 4; ++i) 48 for (int i = 1; i <= 4; ++i)
49 { 49 {
50 efl.ui.Button button = new efl.ui.ButtonConcrete(win); 50 efl.ui.IButton button = new efl.ui.Button(win);
51 button.SetText($"Boxed {i}"); 51 button.SetText($"Boxed {i}");
52 if (i == 2) 52 if (i == 2)
53 { 53 {
@@ -56,7 +56,7 @@ public class Example
56 sz.H = 50; 56 sz.H = 50;
57 button.SetHintMax(sz); 57 button.SetHintMax(sz);
58 } 58 }
59 box.Pack(button); 59 box.DoPack(button);
60 } 60 }
61 61
62 return box; 62 return box;
@@ -66,8 +66,8 @@ public class Example
66 { 66 {
67 efl.All.Init(efl.Components.Ui); 67 efl.All.Init(efl.Components.Ui);
68 68
69 efl.ui.Win win = new efl.ui.WinConcrete(null, (efl.ui.Win ewin) => { 69 efl.ui.IWin win = new efl.ui.Win(null, (efl.ui.IWin ewin) => {
70 ewin.SetWinType(efl.ui.win.Type.Basic); 70 ewin.SetWinType(efl.ui.Win_Type.Basic);
71 ewin.SetText("Hello World"); 71 ewin.SetText("Hello World");
72 ewin.SetAutohide(true); 72 ewin.SetAutohide(true);
73 }); 73 });
@@ -77,32 +77,32 @@ public class Example
77 win.SetSize(sz); 77 win.SetSize(sz);
78 78
79 // when the user clicks "close" on a window there is a request to hide 79 // when the user clicks "close" on a window there is a request to hide
80 win.HIDE += GuiQuitCb; 80 win.HideEvt += GuiQuitCb;
81 81
82 // Load a vertical and horizontal split into the window 82 // Load a vertical and horizontal split into the window
83 83
84 efl.ui.Panes split = new efl.ui.PanesConcrete(win); 84 efl.ui.IPanes split = new efl.ui.Panes(win);
85 split.SetSplitRatio(0.75); 85 split.SetSplitRatio(0.75);
86 win.SetContent(split); 86 win.SetContent(split);
87 87
88 var boxes = SetupUiBoxes(win); 88 var boxes = SetupUiBoxes(win);
89 efl.ContentConcrete.static_cast(split.Part("first")).SetContent(boxes); 89 efl.Content.static_cast(split.GetPart("first")).SetContent(boxes);
90 90
91 efl.ui.Panes horiz_split = new efl.ui.PanesConcrete(win); 91 efl.ui.IPanes horiz_split = new efl.ui.Panes(win);
92 horiz_split.SetDirection(efl.ui.Dir.Horizontal); 92 horiz_split.SetDirection(efl.ui.Dir.Horizontal);
93 horiz_split.SetSplitRatio(0.85); 93 horiz_split.SetSplitRatio(0.85);
94 efl.ContentConcrete.static_cast(split.Part("second")).SetContent(horiz_split); 94 efl.Content.static_cast(split.GetPart("second")).SetContent(horiz_split);
95 95
96 var table = SetupUiTable(win); 96 var table = SetupUiTable(win);
97 efl.ContentConcrete.static_cast(horiz_split.Part("first")).SetContent(table); 97 efl.Content.static_cast(horiz_split.GetPart("first")).SetContent(table);
98 98
99 efl.ui.Button quit_btn = new efl.ui.ButtonConcrete(win); 99 efl.ui.IButton quit_btn = new efl.ui.Button(win);
100 quit_btn.SetText("Quit"); 100 quit_btn.SetText("Quit");
101 sz.W = 150; 101 sz.W = 150;
102 sz.H = 30; 102 sz.H = 30;
103 quit_btn.SetHintMax(sz); 103 quit_btn.SetHintMax(sz);
104 quit_btn.CLICKED += GuiQuitCb; 104 quit_btn.ClickedEvt += GuiQuitCb;
105 efl.ContentConcrete.static_cast(horiz_split.Part("second")).SetContent(quit_btn); 105 efl.Content.static_cast(horiz_split.GetPart("second")).SetContent(quit_btn);
106 106
107 // Start event loop 107 // Start event loop
108 efl.ui.Config.Run(); 108 efl.ui.Config.Run();
diff --git a/reference/csharp/ui/src/ui_sizing.cs b/reference/csharp/ui/src/ui_sizing.cs
index 94a2872..2f74b60 100644
--- a/reference/csharp/ui/src/ui_sizing.cs
+++ b/reference/csharp/ui/src/ui_sizing.cs
@@ -14,8 +14,8 @@ public class Example
14 { 14 {
15 efl.All.Init(efl.Components.Ui); 15 efl.All.Init(efl.Components.Ui);
16 16
17 efl.ui.Win win = new efl.ui.WinConcrete(null, (efl.ui.Win ewin) => { 17 efl.ui.IWin win = new efl.ui.Win(null, (efl.ui.IWin ewin) => {
18 ewin.SetWinType(efl.ui.win.Type.Basic); 18 ewin.SetWinType(efl.ui.Win_Type.Basic);
19 ewin.SetText("Size Control"); 19 ewin.SetText("Size Control");
20 ewin.SetAutohide(true); 20 ewin.SetAutohide(true);
21 }); 21 });
@@ -25,31 +25,31 @@ public class Example
25 win.SetSize(sz); 25 win.SetSize(sz);
26 26
27 // when the user clicks "close" on a window there is a request to hide 27 // when the user clicks "close" on a window there is a request to hide
28 win.HIDE += (object sender, EventArgs e) => { 28 win.HideEvt += (object sender, EventArgs e) => {
29 // quit the app, called if the window is hidden 29 // quit the app, called if the window is hidden
30 efl.ui.Config.Exit(); 30 efl.ui.Config.Exit();
31 }; 31 };
32 32
33 efl.ui.Box box = new efl.ui.BoxConcrete(win); 33 efl.ui.IBox box = new efl.ui.Box(win);
34 win.SetContent(box); 34 win.SetContent(box);
35 35
36 efl.ui.Button button = new efl.ui.ButtonConcrete(win); 36 efl.ui.IButton button = new efl.ui.Button(win);
37 button.SetText("Button"); 37 button.SetText("Button");
38 box.Pack(button); 38 box.DoPack(button);
39 39
40 efl.ui.Button small_btn = new efl.ui.ButtonConcrete(win); 40 efl.ui.IButton small_btn = new efl.ui.Button(win);
41 small_btn.SetText("Small"); 41 small_btn.SetText("Small");
42 sz.W = 50; 42 sz.W = 50;
43 sz.H = 50; 43 sz.H = 50;
44 small_btn.SetHintMax(sz); 44 small_btn.SetHintMax(sz);
45 box.Pack(small_btn); 45 box.DoPack(small_btn);
46 46
47 efl.ui.Button big_btn = new efl.ui.ButtonConcrete(win); 47 efl.ui.IButton big_btn = new efl.ui.Button(win);
48 big_btn.SetText("Big Button"); 48 big_btn.SetText("Big Button");
49 sz.W = 100; 49 sz.W = 100;
50 sz.H = 100; 50 sz.H = 100;
51 big_btn.SetHintMin(sz); 51 big_btn.SetHintMin(sz);
52 box.Pack(big_btn); 52 box.DoPack(big_btn);
53 53
54 efl.ui.Config.Run(); 54 efl.ui.Config.Run();
55 55