summaryrefslogtreecommitdiff
path: root/apps/csharp/texteditor/src/texteditor_main.cs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/csharp/texteditor/src/texteditor_main.cs')
-rw-r--r--apps/csharp/texteditor/src/texteditor_main.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/csharp/texteditor/src/texteditor_main.cs b/apps/csharp/texteditor/src/texteditor_main.cs
index ead73da..55ef937 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.IEntityVisibilityChangedEvt_Args ea) 35 private void GUIQuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs 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);
@@ -63,8 +63,8 @@ public class TextEditor : Efl.Csharp.Application
63 popup.SetScrollableText(message); 63 popup.SetScrollableText(message);
64 popup.SetHintSizeMax(new Eina.Size2D(200, 200)); 64 popup.SetHintSizeMax(new Eina.Size2D(200, 200));
65 popup.SetButton(Efl.Ui.AlertPopupButton.Positive, "OK", null); 65 popup.SetButton(Efl.Ui.AlertPopupButton.Positive, "OK", null);
66 popup.ButtonClickedEvt += 66 popup.ButtonClickedEvent +=
67 (object sender, Efl.Ui.AlertPopupButtonClickedEvt_Args ea) => { 67 (object sender, Efl.Ui.AlertPopupButtonClickedEventArgs ea) => {
68 // Dismiss popup when the button is clicked 68 // Dismiss popup when the button is clicked
69 ((Efl.Ui.AlertPopup)sender).SetParent(null); 69 ((Efl.Ui.AlertPopup)sender).SetParent(null);
70 }; 70 };
@@ -72,11 +72,11 @@ 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.IClickableClickedEvt_Args> func) 75 string iconName, EventHandler<Efl.Input.IClickableClickedEventArgs> 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);
79 button.ClickedEvt += func; 79 button.ClickedEvent += func;
80 button.SetHintWeight(0, 1); 80 button.SetHintWeight(0, 1);
81 81
82 // Set the content of the button, which is an image 82 // Set the content of the button, which is an image
@@ -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.IClickableClickedEvt_Args ea) => { 105 (object sender, Efl.Input.IClickableClickedEventArgs 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.IClickableClickedEvt_Args ea) => { 113 (object sender, Efl.Input.IClickableClickedEventArgs 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.IClickableClickedEvt_Args ea) => { 128 (object sender, Efl.Input.IClickableClickedEventArgs 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.IClickableClickedEvt_Args e) => { Efl.Ui.Config.Exit(); } ); 150 GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Input.IClickableClickedEventArgs 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
@@ -157,7 +157,7 @@ public class TextEditor : Efl.Csharp.Application
157 win = new Efl.Ui.Win(parent: Efl.App.AppMain); 157 win = new Efl.Ui.Win(parent: Efl.App.AppMain);
158 win.SetText("Text Editor"); 158 win.SetText("Text Editor");
159 win.SetAutohide(true); 159 win.SetAutohide(true);
160 win.VisibilityChangedEvt += GUIQuitCb; 160 win.VisibilityChangedEvent += GUIQuitCb;
161 161
162 // Create a vertical box container 162 // Create a vertical box container
163 Efl.Ui.Box box = new Efl.Ui.Box(win); 163 Efl.Ui.Box box = new Efl.Ui.Box(win);
@@ -173,8 +173,8 @@ public class TextEditor : Efl.Csharp.Application
173 editorTextBox.Editable = true; 173 editorTextBox.Editable = true;
174 editorTextBox.Scrollable = true; 174 editorTextBox.Scrollable = true;
175 editorTextBox.SetHintSizeMin(new Eina.Size2D(360, 240)); 175 editorTextBox.SetHintSizeMin(new Eina.Size2D(360, 240));
176 editorTextBox.ChangedEvt += EditorChangedCb; 176 editorTextBox.ChangedEvent += EditorChangedCb;
177 editorTextBox.ChangedUserEvt += EditorChangedCb; 177 editorTextBox.ChangedUserEvent += EditorChangedCb;
178 box.Pack(editorTextBox); 178 box.Pack(editorTextBox);
179 179
180 // Initial refresh of the toolbar buttons 180 // Initial refresh of the toolbar buttons