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

This commit is contained in:
Xavi Artigas 2019-05-15 12:01:16 +02:00
parent 05d9b74e19
commit 836a9edf73
4 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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();
};

View File

@ -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();
};

View File

@ -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);
}