mono examples: Update to latest Efl.Ui.Clickable syntax

devs/lauromoura/cv
Xavi Artigas 3 years ago
parent 05d9b74e19
commit 836a9edf73
  1. 10
      apps/csharp/texteditor/src/texteditor_main.cs
  2. 4
      reference/csharp/ui/src/focus_main.cs
  3. 2
      reference/csharp/ui/src/ui_container.cs
  4. 2
      tutorial/csharp/hello-gui/src/gui_main.cs

@ -72,7 +72,7 @@ public class TextEditor : Efl.Csharp.Application
// Adds a button to the toolbar, with the given text, icon and click event handler
private Efl.Ui.Button GUIToolbarButtonAdd(Efl.Ui.Box toolbar, string name,
string iconName, EventHandler func)
string iconName, EventHandler<Efl.Ui.IClickableClickedEvt_Args> func)
{
var button = new Efl.Ui.Button(toolbar);
button.SetText(name);
@ -102,7 +102,7 @@ public class TextEditor : Efl.Csharp.Application
// "New" button
toolbarButtonNew = GUIToolbarButtonAdd(bar, "New", "document-new",
(object sender, EventArgs ea) => {
(object sender, Efl.Ui.IClickableClickedEvt_Args ea) => {
// When this button is clicked, remove content and refresh toolbar
editorTextBox.SetText("");
GUIToolbarRefresh();
@ -110,7 +110,7 @@ public class TextEditor : Efl.Csharp.Application
// "Save" button
toolbarButtonSave = GUIToolbarButtonAdd(bar, "Save", "document-save",
(object sender, EventArgs ea) => {
(object sender, Efl.Ui.IClickableClickedEvt_Args ea) => {
// When this button is clicked, try to save content and refresh toolbar
try {
System.IO.File.WriteAllText(filename, editorTextBox.GetText());
@ -125,7 +125,7 @@ public class TextEditor : Efl.Csharp.Application
// "Load" button
toolbarButtonLoad = GUIToolbarButtonAdd(bar, "Load", "document-open",
(object sender, EventArgs ea) => {
(object sender, Efl.Ui.IClickableClickedEvt_Args ea) => {
// When this button is clicked, try to load content and refresh toolbar
try {
editorTextBox.SetText(System.IO.File.ReadAllText(filename));
@ -147,7 +147,7 @@ public class TextEditor : Efl.Csharp.Application
bar.Pack(box);
// "Quit" button
GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, EventArgs e) => { Efl.Ui.Config.Exit(); } );
GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Ui.IClickableClickedEvt_Args e) => { Efl.Ui.Config.Exit(); } );
}
// Builds the user interface for the text editor

@ -46,7 +46,7 @@ public class Example : Efl.Csharp.Application
var button = new Efl.Ui.Button(hbox);
button.SetText("Focus mover");
button.FocusChangedEvt += FocusChangedCb;
button.ClickedEvt += (object sender, EventArgs e) => {
button.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args e) => {
Console.WriteLine("Clicked Focus Mover");
// Manually transfer focus to the first check box
Efl.Ui.Focus.Util.Focus(first_checkbox);
@ -57,7 +57,7 @@ public class Example : Efl.Csharp.Application
button = new Efl.Ui.Button(hbox);
button.SetText("Quit");
button.FocusChangedEvt += FocusChangedCb;
button.ClickedEvt += (object sender, EventArgs e) => {
button.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args e) => {
Console.WriteLine("Clicked Quit");
Efl.Ui.Config.Exit();
};

@ -98,7 +98,7 @@ public class Example : Efl.Csharp.Application
Efl.Ui.Button quit_btn = new Efl.Ui.Button(win);
quit_btn.SetText("Quit");
quit_btn.SetHintSizeMax(new Eina.Size2D(150, 30));
quit_btn.ClickedEvt += (object sender, EventArgs e) => {
quit_btn.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args e) => {
// Exit the EFL main loop
Efl.Ui.Config.Exit();
};

@ -47,7 +47,7 @@ public class Example : Efl.Csharp.Application
button.SetText("Quit");
button.SetHintWeight(1.0, 0.1);
// Set the method to be called when the button is pressed
button.ClickedEvt += (object sender, EventArgs e) => { Efl.App.AppMain.Quit(0); };
button.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args e) => { Efl.App.AppMain.Quit(0); };
// Add the button to the box container
box.Pack(button);
}

Loading…
Cancel
Save