summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-05-15 12:01:16 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-05-15 12:01:16 +0200
commit836a9edf7370e9f8f1b1e11bf11997ae88598307 (patch)
tree11c1c8a60697b7bd698df1a35c3f7dae182c96c6
parent05d9b74e19671b2f8e0290a5b45afa75a2956a8f (diff)
mono examples: Update to latest Efl.Ui.Clickable syntax
-rw-r--r--apps/csharp/texteditor/src/texteditor_main.cs10
-rw-r--r--reference/csharp/ui/src/focus_main.cs4
-rw-r--r--reference/csharp/ui/src/ui_container.cs2
-rw-r--r--tutorial/csharp/hello-gui/src/gui_main.cs2
4 files changed, 9 insertions, 9 deletions
diff --git a/apps/csharp/texteditor/src/texteditor_main.cs b/apps/csharp/texteditor/src/texteditor_main.cs
index c77fa3c..b720307 100644
--- a/apps/csharp/texteditor/src/texteditor_main.cs
+++ b/apps/csharp/texteditor/src/texteditor_main.cs
@@ -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 func) 75 string iconName, EventHandler<Efl.Ui.IClickableClickedEvt_Args> 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, EventArgs ea) => { 105 (object sender, Efl.Ui.IClickableClickedEvt_Args 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, EventArgs ea) => { 113 (object sender, Efl.Ui.IClickableClickedEvt_Args 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, EventArgs ea) => { 128 (object sender, Efl.Ui.IClickableClickedEvt_Args 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, EventArgs e) => { Efl.Ui.Config.Exit(); } ); 150 GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Ui.IClickableClickedEvt_Args 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/ui/src/focus_main.cs b/reference/csharp/ui/src/focus_main.cs
index 43170be..4ca376e 100644
--- a/reference/csharp/ui/src/focus_main.cs
+++ b/reference/csharp/ui/src/focus_main.cs
@@ -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.FocusChangedEvt += FocusChangedCb; 48 button.FocusChangedEvt += FocusChangedCb;
49 button.ClickedEvt += (object sender, EventArgs e) => { 49 button.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args 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.FocusChangedEvt += FocusChangedCb; 59 button.FocusChangedEvt += FocusChangedCb;
60 button.ClickedEvt += (object sender, EventArgs e) => { 60 button.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args 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 f2e27e6..1ee439f 100644
--- a/reference/csharp/ui/src/ui_container.cs
+++ b/reference/csharp/ui/src/ui_container.cs
@@ -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.ClickedEvt += (object sender, EventArgs e) => { 101 quit_btn.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args 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/tutorial/csharp/hello-gui/src/gui_main.cs b/tutorial/csharp/hello-gui/src/gui_main.cs
index 888fbef..e9a581f 100644
--- a/tutorial/csharp/hello-gui/src/gui_main.cs
+++ b/tutorial/csharp/hello-gui/src/gui_main.cs
@@ -47,7 +47,7 @@ public class Example : Efl.Csharp.Application
47 button.SetText("Quit"); 47 button.SetText("Quit");
48 button.SetHintWeight(1.0, 0.1); 48 button.SetHintWeight(1.0, 0.1);
49 // Set the method to be called when the button is pressed 49 // Set the method to be called when the button is pressed
50 button.ClickedEvt += (object sender, EventArgs e) => { Efl.App.AppMain.Quit(0); }; 50 button.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args e) => { Efl.App.AppMain.Quit(0); };
51 // Add the button to the box container 51 // Add the button to the box container
52 box.Pack(button); 52 box.Pack(button);
53 } 53 }