summaryrefslogtreecommitdiff
path: root/src/examples/elementary/efl_ui_unit_converter.cs
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-03-08 15:43:50 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-03-08 15:46:45 -0800
commitc83bcb059b07d4919b89a28897940c73f7308c3d (patch)
treeb1f6da28ab292062f71bf890feffd982738a4fc0 /src/examples/elementary/efl_ui_unit_converter.cs
parent067a8baffa692668acc0f19c91e2198195f480e2 (diff)
csharp: update examples
Summary: They were still using the old SetSize(w, h) API instead of receiving eina.Size2D structs. Test Plan: Build examples and run them. Reviewers: felipealmeida, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5830 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/examples/elementary/efl_ui_unit_converter.cs')
-rw-r--r--src/examples/elementary/efl_ui_unit_converter.cs30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/examples/elementary/efl_ui_unit_converter.cs b/src/examples/elementary/efl_ui_unit_converter.cs
index 9e14c4b6c0..91dd318910 100644
--- a/src/examples/elementary/efl_ui_unit_converter.cs
+++ b/src/examples/elementary/efl_ui_unit_converter.cs
@@ -22,7 +22,7 @@ public class Example
22 popup.SetContent(popup_text); 22 popup.SetContent(popup_text);
23 popup.SetVisible(true); 23 popup.SetVisible(true);
24 popup.SetButton(efl.ui.popup_alert.Button.Positive, "Ok"); 24 popup.SetButton(efl.ui.popup_alert.Button.Positive, "Ok");
25 popup.SetSize(150, 30); 25 popup.SetSize(new eina.Size2D(150, 30));
26 popup.BUTTON_CLICKED += (object sender, efl.ui.BUTTON_CLICKED_Args e) => { 26 popup.BUTTON_CLICKED += (object sender, efl.ui.BUTTON_CLICKED_Args e) => {
27 popup.SetParent(null); 27 popup.SetParent(null);
28 popup.Del(); 28 popup.Del();
@@ -35,6 +35,10 @@ public class Example
35 [STAThreadAttribute()] 35 [STAThreadAttribute()]
36#endif 36#endif
37 public static void Main() { 37 public static void Main() {
38 int W = 120;
39 int H = 30;
40 eina.Size2D size = new eina.Size2D(W, H);
41
38 efl.All.Init(efl.Components.Ui); 42 efl.All.Init(efl.Components.Ui);
39 43
40 efl.ui.Win win = new efl.ui.WinConcrete(null); 44 efl.ui.Win win = new efl.ui.WinConcrete(null);
@@ -51,18 +55,18 @@ public class Example
51 55
52 efl.ui.Text miles_label = new efl.ui.TextConcrete(miles_box); 56 efl.ui.Text miles_label = new efl.ui.TextConcrete(miles_box);
53 miles_label.SetText("Miles:"); 57 miles_label.SetText("Miles:");
54 miles_label.SetSize(120, 30); 58 miles_label.SetSize(size);
55 miles_label.SetVisible(true); 59 miles_label.SetVisible(true);
56 60
57 efl.ui.text.Editable miles_input = new efl.ui.text.EditableConcrete(miles_box); 61 efl.ui.text.Editable miles_input = new efl.ui.text.EditableConcrete(miles_box);
58 miles_input.SetText(""); 62 miles_input.SetText("");
59 miles_input.SetScrollable(true); 63 miles_input.SetScrollable(true);
60 miles_input.SetSize(120, 30); 64 miles_input.SetSize(size);
61 miles_input.SetVisible(true); 65 miles_input.SetVisible(true);
62 66
63 efl.ui.Button miles_button = new efl.ui.ButtonConcrete(miles_box); 67 efl.ui.Button miles_button = new efl.ui.ButtonConcrete(miles_box);
64 miles_button.SetText("To Km"); 68 miles_button.SetText("To Km");
65 miles_button.SetSize(120, 30); 69 miles_button.SetSize(size);
66 miles_button.SetVisible(true); 70 miles_button.SetVisible(true);
67 71
68 miles_box.Pack(miles_label); 72 miles_box.Pack(miles_label);
@@ -77,18 +81,18 @@ public class Example
77 81
78 efl.ui.Text kms_label = new efl.ui.TextConcrete(kms_box); 82 efl.ui.Text kms_label = new efl.ui.TextConcrete(kms_box);
79 kms_label.SetText("Kilometers:"); 83 kms_label.SetText("Kilometers:");
80 kms_label.SetSize(120, 30); 84 kms_label.SetSize(size);
81 kms_label.SetVisible(true); 85 kms_label.SetVisible(true);
82 86
83 efl.ui.text.Editable kms_input = new efl.ui.text.EditableConcrete(kms_box); 87 efl.ui.text.Editable kms_input = new efl.ui.text.EditableConcrete(kms_box);
84 kms_input.SetText(""); 88 kms_input.SetText("");
85 kms_input.SetScrollable(true); 89 kms_input.SetScrollable(true);
86 kms_input.SetSize(120, 30); 90 kms_input.SetSize(size);
87 kms_input.SetVisible(true); 91 kms_input.SetVisible(true);
88 92
89 efl.ui.Button kms_button = new efl.ui.ButtonConcrete(kms_box); 93 efl.ui.Button kms_button = new efl.ui.ButtonConcrete(kms_box);
90 kms_button.SetText("To Miles"); 94 kms_button.SetText("To Miles");
91 kms_button.SetSize(120, 30); 95 kms_button.SetSize(size);
92 kms_button.SetVisible(true); 96 kms_button.SetVisible(true);
93 97
94 kms_box.Pack(kms_label); 98 kms_box.Pack(kms_label);
@@ -130,18 +134,12 @@ public class Example
130 kms_box.SetVisible(true); 134 kms_box.SetVisible(true);
131 miles_box.SetVisible(true); 135 miles_box.SetVisible(true);
132 136
133 eina.Position2D pos; 137 box.SetPosition(new eina.Position2D(20, 30));
134
135 pos.X = 20;
136 pos.Y = 30;
137 box.SetPosition(pos);
138 box.SetVisible(true); 138 box.SetVisible(true);
139 139
140 pos.X = 200; 140 win.SetPosition(new eina.Position2D(200, 200));
141 pos.Y = 200;
142 win.SetPosition(pos);
143 141
144 win.SetSize(400,120); 142 win.SetSize(new eina.Size2D(400, 120));
145 win.SetVisible(true); 143 win.SetVisible(true);
146 144
147 efl.ui.Config.Run(); 145 efl.ui.Config.Run();