mono-examples: adapt to latest bindings syntax
This commit is contained in:
parent
5472a77fb3
commit
40801d9285
|
@ -11,14 +11,14 @@ public class LifeWindow : Efl.Csharp.Application
|
|||
lifeRender.RenderLayout((Efl.Ui.Win)sender);
|
||||
}
|
||||
|
||||
void QuitEvent(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs ev)
|
||||
void QuitEvent(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ev)
|
||||
{
|
||||
// quit the mainloop
|
||||
if (ev.arg == false)
|
||||
Efl.App.AppMain.Quit(0);
|
||||
}
|
||||
|
||||
void TouchEvent(object sender, Efl.Input.IInterfacePointerDownEventArgs ev)
|
||||
void TouchEvent(object sender, Efl.Input.InterfacePointerDownEventArgs ev)
|
||||
{
|
||||
int cellx, celly;
|
||||
var position = ev.arg.GetPosition();
|
||||
|
@ -29,7 +29,7 @@ public class LifeWindow : Efl.Csharp.Application
|
|||
lifeRender.RenderCell(win, cellx, celly);
|
||||
}
|
||||
|
||||
void KeyDownEvent(object sender, Efl.Input.IInterfaceKeyDownEventArgs ev)
|
||||
void KeyDownEvent(object sender, Efl.Input.InterfaceKeyDownEventArgs ev)
|
||||
{
|
||||
if (ev.arg.GetKeySym() == "space")
|
||||
lifeBoard.TogglePause(win);
|
||||
|
|
|
@ -32,7 +32,7 @@ public class TextEditor : Efl.Csharp.Application
|
|||
"texteditor_example.txt");
|
||||
|
||||
// Quits the application
|
||||
private void GUIQuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs ea)
|
||||
private void GUIQuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ea)
|
||||
{
|
||||
if (ea.arg == false)
|
||||
Efl.App.AppMain.Quit(0);
|
||||
|
@ -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<Efl.Input.IClickableClickedEventArgs> func)
|
||||
string iconName, EventHandler<Efl.Input.ClickableClickedEventArgs> 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, Efl.Input.IClickableClickedEventArgs ea) => {
|
||||
(object sender, Efl.Input.ClickableClickedEventArgs 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, Efl.Input.IClickableClickedEventArgs ea) => {
|
||||
(object sender, Efl.Input.ClickableClickedEventArgs 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, Efl.Input.IClickableClickedEventArgs ea) => {
|
||||
(object sender, Efl.Input.ClickableClickedEventArgs 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, Efl.Input.IClickableClickedEventArgs e) => { Efl.Ui.Config.Exit(); } );
|
||||
GUIToolbarButtonAdd(bar, "Quit", "application-exit", (object sender, Efl.Input.ClickableClickedEventArgs e) => { Efl.Ui.Config.Exit(); } );
|
||||
}
|
||||
|
||||
// Builds the user interface for the text editor
|
||||
|
|
|
@ -2,5 +2,5 @@ var win = new Efl.Ui.Win(Efl.App.AppMain);
|
|||
win.SetText("Hello World");
|
||||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent +=
|
||||
(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {};
|
||||
(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ public class Example : Efl.Csharp.Application
|
|||
var win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
|
||||
win.SetText("Focus example");
|
||||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
Efl.Ui.Config.Exit();
|
||||
|
@ -46,7 +46,7 @@ public class Example : Efl.Csharp.Application
|
|||
var button = new Efl.Ui.Button(hbox);
|
||||
button.SetText("Focus mover");
|
||||
button.FocusChangedEvent += FocusChangedCb;
|
||||
button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
|
||||
button.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs 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.FocusChangedEvent += FocusChangedCb;
|
||||
button.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
|
||||
button.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => {
|
||||
Console.WriteLine("Clicked Quit");
|
||||
Efl.Ui.Config.Exit();
|
||||
};
|
||||
|
|
|
@ -63,7 +63,7 @@ public class Example : Efl.Csharp.Application
|
|||
Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
|
||||
win.SetText("Container demo");
|
||||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
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.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
|
||||
quit_btn.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => {
|
||||
// Exit the EFL main loop
|
||||
Efl.Ui.Config.Exit();
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@ public class Example : Efl.Csharp.Application
|
|||
Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
|
||||
win.SetText("Custom widget demo");
|
||||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop when the window is closed
|
||||
if (e.arg == false)
|
||||
Efl.Ui.Config.Exit();
|
||||
|
@ -46,7 +46,7 @@ public class Example : Efl.Csharp.Application
|
|||
|
||||
// Instantiate our custom button widget
|
||||
MyButton btn = new MyButton(win, 99);
|
||||
btn.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => {
|
||||
btn.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => {
|
||||
// When the button is clicked, change its text
|
||||
MyButton b = (MyButton)sender;
|
||||
b.SetText("Hello!");
|
||||
|
|
|
@ -16,7 +16,7 @@ public class Example : Efl.Csharp.Application
|
|||
Efl.Ui.Win win = new Efl.Ui.Win(null, winType: Efl.Ui.WinType.Basic);
|
||||
win.SetText("Size Control");
|
||||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e) => {
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
Efl.Ui.Config.Exit();
|
||||
|
|
|
@ -3,7 +3,7 @@ using System;
|
|||
public class Example : Efl.Csharp.Application
|
||||
{
|
||||
// Callback to quit the application
|
||||
public static void QuitCb(object sender, Efl.Gfx.IEntityVisibilityChangedEventArgs e)
|
||||
public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e)
|
||||
{
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
|
@ -48,7 +48,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.ClickedEvent += (object sender, Efl.Input.IClickableClickedEventArgs e) => { Efl.App.AppMain.Quit(0); };
|
||||
button.ClickedEvent += (object sender, Efl.Input.ClickableClickedEventArgs e) => { Efl.App.AppMain.Quit(0); };
|
||||
// Add the button to the box container
|
||||
box.Pack(button);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue