summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-09-06 16:10:16 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-09-06 16:10:16 +0200
commit40801d928510c53c2c2e42efe7190b58c97d16de (patch)
tree3d51e015ac119e6db978970da3ed4c2a3d2c3bdc
parent5472a77fb3ace3fa3dba7ae4c4770314412d5e55 (diff)
mono-examples: adapt to latest bindings syntax
-rw-r--r--apps/csharp/life/src/life_main.cs6
-rw-r--r--apps/csharp/texteditor/src/texteditor_main.cs12
-rw-r--r--reference/csharp/snippets/Efl.Ui.Win.cs2
-rw-r--r--reference/csharp/ui/src/focus_main.cs6
-rw-r--r--reference/csharp/ui/src/ui_container.cs4
-rw-r--r--reference/csharp/ui/src/ui_custom_widget.cs4
-rw-r--r--reference/csharp/ui/src/ui_sizing.cs2
-rw-r--r--tutorial/csharp/hello-gui/src/gui_main.cs4
8 files changed, 20 insertions, 20 deletions
diff --git a/apps/csharp/life/src/life_main.cs b/apps/csharp/life/src/life_main.cs
index 1b9e129..ebfc879 100644
--- a/apps/csharp/life/src/life_main.cs
+++ b/apps/csharp/life/src/life_main.cs
@@ -11,14 +11,14 @@ public class LifeWindow : Efl.Csharp.Application
11 lifeRender.RenderLayout((Efl.Ui.Win)sender); 11 lifeRender.RenderLayout((Efl.Ui.Win)sender);
12 } 12 }
13 13
14 void QuitEvent(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs ev) 14 void QuitEvent(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ev)
15 { 15 {
16 // quit the mainloop 16 // quit the mainloop
17 if (ev.arg == false) 17 if (ev.arg == false)
18 Efl.App.AppMain.Quit(0); 18 Efl.App.AppMain.Quit(0);
19 } 19 }
20 20
21 void TouchEvent(object sender, Efl.Input.IInterfacePointerDownEventArgs ev) 21 void TouchEvent(object sender, Efl.Input.InterfacePointerDownEventArgs ev)
22 { 22 {
23 int cellx, celly; 23 int cellx, celly;
24 var position = ev.arg.GetPosition(); 24 var position = ev.arg.GetPosition();
@@ -29,7 +29,7 @@ public class LifeWindow : Efl.Csharp.Application
29 lifeRender.RenderCell(win, cellx, celly); 29 lifeRender.RenderCell(win, cellx, celly);
30 } 30 }
31 31
32 void KeyDownEvent(object sender, Efl.Input.IInterfaceKeyDownEventArgs ev) 32 void KeyDownEvent(object sender, Efl.Input.InterfaceKeyDownEventArgs ev)
33 { 33 {
34 if (ev.arg.GetKeySym() == "space") 34 if (ev.arg.GetKeySym() == "space")
35 lifeBoard.TogglePause(win); 35 lifeBoard.TogglePause(win);
diff --git a/apps/csharp/texteditor/src/texteditor_main.cs b/apps/csharp/texteditor/src/texteditor_main.cs
index 55ef937..bb978c5 100644
--- a/apps/csharp/texteditor/src/texteditor_main.cs
+++ b/apps/csharp/texteditor/src/texteditor_main.cs
@@ -32,7 +32,7 @@ public class TextEditor : Efl.Csharp.Application
32 "texteditor_example.txt"); 32 "texteditor_example.txt");
33 33
34 // Quits the application 34 // Quits the application
35 private void GUIQuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs ea) 35 private void GUIQuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ea)
36 { 36 {
37 if (ea.arg == false) 37 if (ea.arg == false)
38 Efl.App.AppMain.Quit(0); 38 Efl.App.AppMain.Quit(0);
@@ -72,7 +72,7 @@ public class TextEditor : Efl.Csharp.Application
72 72
73 // Adds a button to the toolbar, with the given text, icon and click event handler 73 // Adds a button to the toolbar, with the given text, icon and click event handler
74 private Efl.Ui.Button GUIToolbarButtonAdd(Efl.Ui.Box toolbar, string name, 74 private Efl.Ui.Button GUIToolbarButtonAdd(Efl.Ui.Box toolbar, string name,
75 string iconName, EventHandler<Efl.Input.IClickableClickedEventArgs> func) 75 string iconName, EventHandler<Efl.Input.ClickableClickedEventArgs> func)
76 { 76 {
77 var button = new Efl.Ui.Button(toolbar); 77 var button = new Efl.Ui.Button(toolbar);
78 button.SetText(name); 78 button.SetText(name);
@@ -102,7 +102,7 @@ public class TextEditor : Efl.Csharp.Application
102 102
103 // "New" button 103 // "New" button
104 toolbarButtonNew = GUIToolbarButtonAdd(bar, "New", "document-new", 104 toolbarButtonNew = GUIToolbarButtonAdd(bar, "New", "document-new",
105 (object sender, Efl.Input.IClickableClickedEventArgs ea) => { 105 (object sender, Efl.Input.ClickableClickedEventArgs ea) => {
106 // When this button is clicked, remove content and refresh toolbar 106 // When this button is clicked, remove content and refresh toolbar
107 editorTextBox.SetText(""); 107 editorTextBox.SetText("");
108 GUIToolbarRefresh(); 108 GUIToolbarRefresh();
@@ -110,7 +110,7 @@ public class TextEditor : Efl.Csharp.Application
110 110
111 // "Save" button 111 // "Save" button
112 toolbarButtonSave = GUIToolbarButtonAdd(bar, "Save", "document-save", 112 toolbarButtonSave = GUIToolbarButtonAdd(bar, "Save", "document-save",
113 (object sender, Efl.Input.IClickableClickedEventArgs ea) => { 113 (object sender, Efl.Input.ClickableClickedEventArgs ea) => {
114 // When this button is clicked, try to save content and refresh toolbar 114 // When this button is clicked, try to save content and refresh toolbar
115 try { 115 try {
116 System.IO.File.WriteAllText(filename, editorTextBox.GetText()); 116 System.IO.File.WriteAllText(filename, editorTextBox.GetText());
@@ -125,7 +125,7 @@ public class TextEditor : Efl.Csharp.Application
125 125
126 // "Load" button 126 // "Load" button
127 toolbarButtonLoad = GUIToolbarButtonAdd(bar, "Load", "document-open", 127 toolbarButtonLoad = GUIToolbarButtonAdd(bar, "Load", "document-open",
128 (object sender, Efl.Input.IClickableClickedEventArgs ea) => { 128 (object sender, Efl.Input.ClickableClickedEventArgs ea) => {
129 // When this button is clicked, try to load content and refresh toolbar 129 // When this button is clicked, try to load content and refresh toolbar
130 try { 130 try {
131 editorTextBox.SetText(System.IO.File.ReadAllText(filename)); 131 editorTextBox.SetText(System.IO.File.ReadAllText(filename));
@@ -147,7 +147,7 @@ public class TextEditor : Efl.Csharp.Application
147 bar.Pack(box); 147 bar.Pack(box);
148 148
149 // "Quit" button 149 // "Quit" button
150 GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Input.IClickableClickedEventArgs e) => { Efl.Ui.Config.Exit(); } ); 150 GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Input.ClickableClickedEventArgs e) => { Efl.Ui.Config.Exit(); } );
151 } 151 }
152 152
153 // Builds the user interface for the text editor 153 // Builds the user interface for the text editor
diff --git a/reference/csharp/snippets/Efl.Ui.Win.cs b/reference/csharp/snippets/Efl.Ui.Win.cs
index c4712e7..243008a 100644
--- a/reference/csharp/snippets/Efl.Ui.Win.cs
+++ b/reference/csharp/snippets/Efl.Ui.Win.cs
@@ -2,5 +2,5 @@ var win = new Efl.Ui.Win(Efl.App.AppMain);
2win.SetText("Hello World"); 2win.SetText("Hello World");
3win.SetAutohide(true); 3win.SetAutohide(true);
4win.VisibilityChangedEvent += 4win.VisibilityChangedEvent +=
5 (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {}; 5 (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {};
6 6
diff --git a/reference/csharp/ui/src/focus_main.cs b/reference/csharp/ui/src/focus_main.cs
index ae943ba..20fcf9b 100644
--- a/reference/csharp/ui/src/focus_main.cs
+++ b/reference/csharp/ui/src/focus_main.cs
@@ -13,7 +13,7 @@ public class Example : Efl.Csharp.Application
13 var win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic); 13 var win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
14 win.SetText("Focus example"); 14 win.SetText("Focus example");
15 win.SetAutohide(true); 15 win.SetAutohide(true);
16 win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => { 16 win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
17 // Exit the EFL main loop 17 // Exit the EFL main loop
18 if (e.arg == false) 18 if (e.arg == false)
19 Efl.Ui.Config.Exit(); 19 Efl.Ui.Config.Exit();
@@ -46,7 +46,7 @@ public class Example : Efl.Csharp.Application
46 var button = new Efl.Ui.Button(hbox); 46 var button = new Efl.Ui.Button(hbox);
47 button.SetText("Focus mover"); 47 button.SetText("Focus mover");
48 button.FocusChangedEvent += FocusChangedCb; 48 button.FocusChangedEvent += FocusChangedCb;
49 button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => { 49 button.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => {
50 Console.WriteLine("Clicked Focus Mover"); 50 Console.WriteLine("Clicked Focus Mover");
51 // Manually transfer focus to the first check box 51 // Manually transfer focus to the first check box
52 Efl.Ui.Focus.Util.Focus(first_checkbox); 52 Efl.Ui.Focus.Util.Focus(first_checkbox);
@@ -57,7 +57,7 @@ public class Example : Efl.Csharp.Application
57 button = new Efl.Ui.Button(hbox); 57 button = new Efl.Ui.Button(hbox);
58 button.SetText("Quit"); 58 button.SetText("Quit");
59 button.FocusChangedEvent += FocusChangedCb; 59 button.FocusChangedEvent += FocusChangedCb;
60 button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => { 60 button.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => {
61 Console.WriteLine("Clicked Quit"); 61 Console.WriteLine("Clicked Quit");
62 Efl.Ui.Config.Exit(); 62 Efl.Ui.Config.Exit();
63 }; 63 };
diff --git a/reference/csharp/ui/src/ui_container.cs b/reference/csharp/ui/src/ui_container.cs
index 9d987e1..5379ee6 100644
--- a/reference/csharp/ui/src/ui_container.cs
+++ b/reference/csharp/ui/src/ui_container.cs
@@ -63,7 +63,7 @@ public class Example : Efl.Csharp.Application
63 Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic); 63 Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
64 win.SetText("Container demo"); 64 win.SetText("Container demo");
65 win.SetAutohide(true); 65 win.SetAutohide(true);
66 win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => { 66 win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
67 // Exit the EFL main loop 67 // Exit the EFL main loop
68 if (e.arg == false) 68 if (e.arg == false)
69 Efl.Ui.Config.Exit(); 69 Efl.Ui.Config.Exit();
@@ -98,7 +98,7 @@ public class Example : Efl.Csharp.Application
98 Efl.Ui.Button quit_btn = new Efl.Ui.Button(win); 98 Efl.Ui.Button quit_btn = new Efl.Ui.Button(win);
99 quit_btn.SetText("Quit"); 99 quit_btn.SetText("Quit");
100 quit_btn.SetHintSizeMax(new Eina.Size2D(150, 30)); 100 quit_btn.SetHintSizeMax(new Eina.Size2D(150, 30));
101 quit_btn.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => { 101 quit_btn.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => {
102 // Exit the EFL main loop 102 // Exit the EFL main loop
103 Efl.Ui.Config.Exit(); 103 Efl.Ui.Config.Exit();
104 }; 104 };
diff --git a/reference/csharp/ui/src/ui_custom_widget.cs b/reference/csharp/ui/src/ui_custom_widget.cs
index 6cc14d2..0907c47 100644
--- a/reference/csharp/ui/src/ui_custom_widget.cs
+++ b/reference/csharp/ui/src/ui_custom_widget.cs
@@ -36,7 +36,7 @@ public class Example : Efl.Csharp.Application
36 Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic); 36 Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
37 win.SetText("Custom widget demo"); 37 win.SetText("Custom widget demo");
38 win.SetAutohide(true); 38 win.SetAutohide(true);
39 win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => { 39 win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
40 // Exit the EFL main loop when the window is closed 40 // Exit the EFL main loop when the window is closed
41 if (e.arg == false) 41 if (e.arg == false)
42 Efl.Ui.Config.Exit(); 42 Efl.Ui.Config.Exit();
@@ -46,7 +46,7 @@ public class Example : Efl.Csharp.Application
46 46
47 // Instantiate our custom button widget 47 // Instantiate our custom button widget
48 MyButton btn = new MyButton(win, 99); 48 MyButton btn = new MyButton(win, 99);
49 btn.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => { 49 btn.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => {
50 // When the button is clicked, change its text 50 // When the button is clicked, change its text
51 MyButton b = (MyButton)sender; 51 MyButton b = (MyButton)sender;
52 b.SetText("Hello!"); 52 b.SetText("Hello!");
diff --git a/reference/csharp/ui/src/ui_sizing.cs b/reference/csharp/ui/src/ui_sizing.cs
index 23e0f2d..5749d2b 100644
--- a/reference/csharp/ui/src/ui_sizing.cs
+++ b/reference/csharp/ui/src/ui_sizing.cs
@@ -16,7 +16,7 @@ public class Example : Efl.Csharp.Application
16 Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic); 16 Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
17 win.SetText("Size Control"); 17 win.SetText("Size Control");
18 win.SetAutohide(true); 18 win.SetAutohide(true);
19 win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => { 19 win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
20 // Exit the EFL main loop 20 // Exit the EFL main loop
21 if (e.arg == false) 21 if (e.arg == false)
22 Efl.Ui.Config.Exit(); 22 Efl.Ui.Config.Exit();
diff --git a/tutorial/csharp/hello-gui/src/gui_main.cs b/tutorial/csharp/hello-gui/src/gui_main.cs
index a0a40d6..ec4994d 100644
--- a/tutorial/csharp/hello-gui/src/gui_main.cs
+++ b/tutorial/csharp/hello-gui/src/gui_main.cs
@@ -3,7 +3,7 @@ using System;
3public class Example : Efl.Csharp.Application 3public class Example : Efl.Csharp.Application
4{ 4{
5 // Callback to quit the application 5 // Callback to quit the application
6 public static void QuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) 6 public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e)
7 { 7 {
8 // Exit the EFL main loop 8 // Exit the EFL main loop
9 if (e.arg == false) 9 if (e.arg == false)
@@ -48,7 +48,7 @@ public class Example : Efl.Csharp.Application
48 button.SetText("Quit"); 48 button.SetText("Quit");
49 button.SetHintWeight(1.0, 0.1); 49 button.SetHintWeight(1.0, 0.1);
50 // Set the method to be called when the button is pressed 50 // Set the method to be called when the button is pressed
51 button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => { Efl.App.AppMain.Quit(0); }; 51 button.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => { Efl.App.AppMain.Quit(0); };
52 // Add the button to the box container 52 // Add the button to the box container
53 box.Pack(button); 53 box.Pack(button);
54 } 54 }