mono-examples: Adapt to latest syntax (EventArgs.arg -> Arg)
Also workaround some temporary inability to set struct members.
This commit is contained in:
parent
dfa678e9dc
commit
6a470840d9
|
@ -14,7 +14,7 @@ public class Calculator : Efl.Csharp.Application
|
|||
// Quits the application
|
||||
private void GUIQuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ea)
|
||||
{
|
||||
if (ea.arg == false)
|
||||
if (ea.Arg == false)
|
||||
Efl.App.AppMain.Quit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,14 +14,14 @@ public class LifeWindow : Efl.Csharp.Application
|
|||
void QuitEvent(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ev)
|
||||
{
|
||||
// quit the mainloop
|
||||
if (ev.arg == false)
|
||||
if (ev.Arg == false)
|
||||
Efl.App.AppMain.Quit(0);
|
||||
}
|
||||
|
||||
void TouchEvent(object sender, Efl.Input.InterfacePointerDownEventArgs ev)
|
||||
{
|
||||
int cellx, celly;
|
||||
var position = ev.arg.GetPosition();
|
||||
var position = ev.Arg.GetPosition();
|
||||
lifeRender.CellForCoords(win, position, out cellx, out celly);
|
||||
|
||||
int i = LifeBoard.IndexForPosition(cellx, celly);
|
||||
|
@ -31,7 +31,7 @@ public class LifeWindow : Efl.Csharp.Application
|
|||
|
||||
void KeyDownEvent(object sender, Efl.Input.InterfaceKeyDownEventArgs ev)
|
||||
{
|
||||
if (ev.arg.GetKeySym() == "space")
|
||||
if (ev.Arg.GetKeySym() == "space")
|
||||
lifeBoard.TogglePause(win);
|
||||
}
|
||||
|
||||
|
@ -44,10 +44,6 @@ public class LifeWindow : Efl.Csharp.Application
|
|||
// when the user clicks "close" on a window there is a request to hide
|
||||
((Efl.Gfx.IEntity)win).VisibilityChangedEvent += QuitEvent;
|
||||
|
||||
Eina.Size2D sz;
|
||||
sz.W = (int)(10 * LifeBoard.Width * win.GetScale());
|
||||
sz.H = (int)(10 * LifeBoard.Height * win.GetScale());
|
||||
|
||||
lifeBoard = new LifeBoard();
|
||||
lifeRender = new LifeRender(win, lifeBoard);
|
||||
lifeRender.Refresh(win);
|
||||
|
@ -56,7 +52,8 @@ public class LifeWindow : Efl.Csharp.Application
|
|||
((Efl.Input.IInterface)win).PointerDownEvent += TouchEvent;
|
||||
((Efl.Input.IInterface)win).KeyDownEvent += KeyDownEvent;
|
||||
|
||||
win.SetSize(sz);
|
||||
win.SetSize(new Eina.Size2D((int)(10 * LifeBoard.Width * win.GetScale()),
|
||||
(int)(10 * LifeBoard.Height * win.GetScale())));
|
||||
|
||||
lifeBoard.Run(win);
|
||||
}
|
||||
|
|
|
@ -39,15 +39,9 @@ public class LifeRender
|
|||
var rect = lifeCells[LifeBoard.IndexForPosition(x, y)];
|
||||
|
||||
// the little +1 here will avoid tearing as we layout non-multiple sizes
|
||||
Eina.Size2D sz;
|
||||
sz.W = (int)(cw + 1);
|
||||
sz.H = (int)(ch + 1);
|
||||
rect.SetSize(sz);
|
||||
rect.SetSize(new Eina.Size2D((int)(cw + 1), (int)(ch + 1)));
|
||||
|
||||
Eina.Position2D pos;
|
||||
pos.X = (int)(x * cw);
|
||||
pos.Y = (int)(y * ch);
|
||||
rect.SetPosition(pos);
|
||||
rect.SetPosition(new Eina.Position2D((int)(x * cw), (int)(y * ch)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class Application : Efl.Csharp.Application
|
|||
|
||||
void QuitEvt(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ev)
|
||||
{
|
||||
if (ev.arg == false)
|
||||
if (ev.Arg == false)
|
||||
{
|
||||
Efl.App.AppMain.Quit(0);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class TextEditor : Efl.Csharp.Application
|
|||
// Quits the application
|
||||
private void GUIQuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs ea)
|
||||
{
|
||||
if (ea.arg == false)
|
||||
if (ea.Arg == false)
|
||||
Efl.App.AppMain.Quit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public class Example : Efl.Csharp.Application
|
|||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
if (e.Arg == false)
|
||||
Efl.Ui.Config.Exit();
|
||||
};
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public class Example : Efl.Csharp.Application
|
|||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
if (e.Arg == false)
|
||||
Efl.Ui.Config.Exit();
|
||||
};
|
||||
// Give the window an initial size so there is room to resize the panes.
|
||||
|
|
|
@ -38,7 +38,7 @@ public class Example : Efl.Csharp.Application
|
|||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop when the window is closed
|
||||
if (e.arg == false)
|
||||
if (e.Arg == false)
|
||||
Efl.Ui.Config.Exit();
|
||||
};
|
||||
// Give the window an initial size
|
||||
|
|
|
@ -18,7 +18,7 @@ public class Example : Efl.Csharp.Application
|
|||
win.SetAutohide(true);
|
||||
win.VisibilityChangedEvent += (object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e) => {
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
if (e.Arg == false)
|
||||
Efl.Ui.Config.Exit();
|
||||
};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ public class Example : Efl.Csharp.Application
|
|||
public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e)
|
||||
{
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
if (e.Arg == false)
|
||||
Efl.App.AppMain.Quit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ public class Example : Efl.Csharp.Application
|
|||
public static void QuitCb(object sender, Efl.Gfx.EntityVisibilityChangedEventArgs e)
|
||||
{
|
||||
// Exit the EFL main loop
|
||||
if (e.arg == false)
|
||||
if (e.Arg == false)
|
||||
Efl.App.AppMain.Quit(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue