aboutsummaryrefslogtreecommitdiffstats
path: root/reference/csharp/ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'reference/csharp/ui/src')
-rw-r--r--reference/csharp/ui/src/focus_main.cs34
-rw-r--r--reference/csharp/ui/src/ui_container.cs52
-rw-r--r--reference/csharp/ui/src/ui_sizing.cs24
3 files changed, 55 insertions, 55 deletions
diff --git a/reference/csharp/ui/src/focus_main.cs b/reference/csharp/ui/src/focus_main.cs
index f5a87a50..5cf64638 100644
--- a/reference/csharp/ui/src/focus_main.cs
+++ b/reference/csharp/ui/src/focus_main.cs
@@ -4,7 +4,7 @@ public class Example
{
public static void FocusChangedCb(object sender, EventArgs e)
{
- Console.WriteLine($"Focus for object {((efl.IText)sender).GetText()} changed to {((efl.ui.IWidget)sender).GetFocus()}");
+ Console.WriteLine($"Focus for object {((Efl.Text)sender).GetText()} changed to {((Efl.Ui.Widget)sender).GetFocus()}");
}
#if WIN32
@@ -13,29 +13,29 @@ public class Example
public static void Main()
{
// Initialize EFL and all UI components
- efl.All.Init(efl.Components.Ui);
+ Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
- var win = new efl.ui.Win(null, (efl.ui.IWin ewin) => {
- ewin.SetWinType(efl.ui.Win_Type.Basic);
+ var win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => {
+ ewin.SetWinType(Efl.Ui.WinType.Basic);
ewin.SetText("Focus example");
ewin.SetAutohide(true);
ewin.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
- efl.ui.Config.Exit();
+ Efl.Ui.Config.Exit();
};
});
// Create the main box container
- var vbox = new efl.ui.Box(win, (efl.ui.IBox ebox) => {
- ebox.SetHintMin(new eina.Size2D(360, 240));
+ var vbox = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => {
+ ebox.SetHintMin(new Eina.Size2D(360, 240));
win.SetContent(ebox);
});
// Create some check boxes
- efl.ui.ICheck first_checkbox = null;
+ Efl.Ui.Check first_checkbox = null;
for (int i = 0; i< 5; i++) {
- var checkbox = new efl.ui.Check(vbox, (efl.ui.ICheck echeck) => {
+ var checkbox = new Efl.Ui.Check(vbox, (Efl.Ui.Check echeck) => {
echeck.SetText("Check " + i);
echeck.SetHintAlign(0.5, 0.5);
echeck.FocusChangedEvt += FocusChangedCb;
@@ -45,30 +45,30 @@ public class Example
};
// Create an horizontal box to contain the two buttons
- var hbox = new efl.ui.Box(vbox, (efl.ui.IBox ebox) => {
- ebox.SetDirection(efl.ui.Dir.Horizontal);
+ var hbox = new Efl.Ui.Box(vbox, (Efl.Ui.Box ebox) => {
+ ebox.SetDirection(Efl.Ui.Dir.Horizontal);
vbox.DoPack(ebox);
});
// Create a "Focus Mover" button
- new efl.ui.Button(hbox, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(hbox, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Focus mover");
ebutton.FocusChangedEvt += FocusChangedCb;
ebutton.ClickedEvt += (object sender, EventArgs e) => {
Console.WriteLine("Clicked Focus Mover");
// Manually transfer focus to the first check box
- efl.ui.focus.Util.Focus(first_checkbox);
+ Efl.Ui.Focus.Util.Focus(first_checkbox);
};
hbox.DoPack(ebutton);
});
// Create a Quit button
- new efl.ui.Button(hbox, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(hbox, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Quit");
ebutton.FocusChangedEvt += FocusChangedCb;
ebutton.ClickedEvt += (object sender, EventArgs e) => {
Console.WriteLine("Clicked Quit");
- efl.ui.Config.Exit();
+ Efl.Ui.Config.Exit();
};
hbox.DoPack(ebutton);
});
@@ -77,10 +77,10 @@ public class Example
win.SetFocusHighlightEnabled(true);
// Start the EFL main loop
- efl.ui.Config.Run();
+ Efl.Ui.Config.Run();
// Shutdown EFL
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}
diff --git a/reference/csharp/ui/src/ui_container.cs b/reference/csharp/ui/src/ui_container.cs
index fe5cc976..81e883b0 100644
--- a/reference/csharp/ui/src/ui_container.cs
+++ b/reference/csharp/ui/src/ui_container.cs
@@ -10,9 +10,9 @@ using System;
public class Example
{
// Create a box container full of buttons
- static efl.ui.IBox CreateBox(efl.ui.IWin win)
+ static Efl.Ui.Box CreateBox(Efl.Ui.Win win)
{
- efl.ui.IBox box = new efl.ui.Box(win, (efl.ui.IBox ebox) => {
+ Efl.Ui.Box box = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => {
// Set distance between contained elements
ebox.SetPackPadding(5, 0, true);
});
@@ -20,12 +20,12 @@ public class Example
for (int i = 1; i <= 4; ++i)
{
// Add 4 buttons, one below the other
- new efl.ui.Button(win, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText($"Boxed {i}");
if (i == 2)
{
// Button 2 has its maximum size limited, so it will be smaller
- ebutton.SetHintMax(new eina.Size2D(100,50));
+ ebutton.SetHintMax(new Eina.Size2D(100,50));
}
box.DoPack(ebutton);
});
@@ -35,25 +35,25 @@ public class Example
}
// Create a simple table layout
- static efl.ui.ITable CreateTable(efl.ui.IWin win)
+ static Efl.Ui.Table CreateTable(Efl.Ui.Win win)
{
- efl.ui.ITable table = new efl.ui.Table(win, (efl.ui.ITable etable) => {
+ Efl.Ui.Table table = new Efl.Ui.Table(win, (Efl.Ui.Table etable) => {
// Table with two columns, that get filled left to right, and then top to bottom
etable.SetTableColumns(2);
- etable.SetTableDirection(efl.ui.Dir.Right, efl.ui.Dir.Down);
+ etable.SetTableDirection(Efl.Ui.Dir.Right, Efl.Ui.Dir.Down);
});
for (int i = 1; i <= 4; ++i)
{
// Add 4 buttons, following the defined table flow
- new efl.ui.Button(win, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText($"Table {i}");
table.DoPack(ebutton);
});
}
// Last button spans two table cells
- new efl.ui.Button(win, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Long Button");
table.PackTable(ebutton, 0, 2, 2, 1);
});
@@ -67,62 +67,62 @@ public class Example
public static void Main()
{
// Initialize EFL and all UI components
- efl.All.Init(efl.Components.Ui);
+ Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
- efl.ui.IWin win = new efl.ui.Win(null, (efl.ui.IWin ewin) => {
- ewin.SetWinType(efl.ui.Win_Type.Basic);
+ Efl.Ui.Win win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => {
+ ewin.SetWinType(Efl.Ui.WinType.Basic);
ewin.SetText("Container demo");
ewin.SetAutohide(true);
ewin.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
- efl.ui.Config.Exit();
+ Efl.Ui.Config.Exit();
};
});
// Give the window an initial size so there is room to resize the panes.
// Otherwise, all widgets are tightly packed
- win.SetSize(new eina.Size2D(350,250));
+ win.SetSize(new Eina.Size2D(350,250));
// Create a vertically-split panes container
- efl.ui.IPanes vsplit = new efl.ui.Panes(win, (efl.ui.IPanes epanes) => {
+ Efl.Ui.Panes vsplit = new Efl.Ui.Panes(win, (Efl.Ui.Panes epanes) => {
epanes.SetSplitRatio(0.75);
win.SetContent(epanes);
});
// Create some boxes and set them as the content of the first pane of the container
var box = CreateBox(win);
- efl.Content.static_cast(vsplit.GetPart("first")).SetContent(box);
+ Efl.ContentConcrete.static_cast(vsplit.GetPart("first")).SetContent(box);
// Create a second, horizontally-split panes container and set it as the content of
// the second pane of the first container
- efl.ui.IPanes hsplit = new efl.ui.Panes(win, (efl.ui.IPanes epanes) => {
- epanes.SetDirection(efl.ui.Dir.Horizontal);
+ Efl.Ui.Panes hsplit = new Efl.Ui.Panes(win, (Efl.Ui.Panes epanes) => {
+ epanes.SetDirection(Efl.Ui.Dir.Horizontal);
epanes.SetSplitRatio(0.85);
});
- efl.Content.static_cast(vsplit.GetPart("second")).SetContent(hsplit);
+ Efl.ContentConcrete.static_cast(vsplit.GetPart("second")).SetContent(hsplit);
// Create a table and set it as the content of the first pane of the horizontal
// container
var table = CreateTable(win);
- efl.Content.static_cast(hsplit.GetPart("first")).SetContent(table);
+ Efl.ContentConcrete.static_cast(hsplit.GetPart("first")).SetContent(table);
// Create a button and set it as the content of the second pane of the horizontal
// container
- efl.ui.IButton quit_btn = new efl.ui.Button(win, (efl.ui.IButton ebutton) => {
+ Efl.Ui.Button quit_btn = new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Quit");
- ebutton.SetHintMax(new eina.Size2D(150, 30));
+ ebutton.SetHintMax(new Eina.Size2D(150, 30));
ebutton.ClickedEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
- efl.ui.Config.Exit();
+ Efl.Ui.Config.Exit();
};
});
- efl.Content.static_cast(hsplit.GetPart("second")).SetContent(quit_btn);
+ Efl.ContentConcrete.static_cast(hsplit.GetPart("second")).SetContent(quit_btn);
// Start the EFL main loop
- efl.ui.Config.Run();
+ Efl.Ui.Config.Run();
// Shutdown EFL
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}
diff --git a/reference/csharp/ui/src/ui_sizing.cs b/reference/csharp/ui/src/ui_sizing.cs
index b56cf482..dd6e5ffb 100644
--- a/reference/csharp/ui/src/ui_sizing.cs
+++ b/reference/csharp/ui/src/ui_sizing.cs
@@ -16,49 +16,49 @@ public class Example
public static void Main()
{
// Initialize EFL and all UI components
- efl.All.Init(efl.Components.Ui);
+ Efl.All.Init(Efl.Components.Ui);
// Create a window and initialize it
- efl.ui.IWin win = new efl.ui.Win(null, (efl.ui.IWin ewin) => {
- ewin.SetWinType(efl.ui.Win_Type.Basic);
+ Efl.Ui.Win win = new Efl.Ui.Win(null, (Efl.Ui.Win ewin) => {
+ ewin.SetWinType(Efl.Ui.WinType.Basic);
ewin.SetText("Size Control");
ewin.SetAutohide(true);
ewin.HideEvt += (object sender, EventArgs e) => {
// Exit the EFL main loop
- efl.ui.Config.Exit();
+ Efl.Ui.Config.Exit();
};
});
// Create a box container
- efl.ui.IBox box = new efl.ui.Box(win, (efl.ui.IBox ebox) => {
+ Efl.Ui.Box box = new Efl.Ui.Box(win, (Efl.Ui.Box ebox) => {
win.SetContent(ebox);
});
// Create a regular button (without size hints)
- new efl.ui.Button(win, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Button");
box.DoPack(ebutton);
});
// Create a small button (max size is limited)
- new efl.ui.Button(win, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Small");
- ebutton.SetHintMax(new eina.Size2D(50,50));
+ ebutton.SetHintMax(new Eina.Size2D(50,50));
box.DoPack(ebutton);
});
// Create a big button (min size is limited)
- new efl.ui.Button(win, (efl.ui.IButton ebutton) => {
+ new Efl.Ui.Button(win, (Efl.Ui.Button ebutton) => {
ebutton.SetText("Big button");
- ebutton.SetHintMin(new eina.Size2D(100,100));
+ ebutton.SetHintMin(new Eina.Size2D(100,100));
box.DoPack(ebutton);
});
// Start the EFL main loop
- efl.ui.Config.Run();
+ Efl.Ui.Config.Run();
// Shutdown EFL
- efl.All.Shutdown();
+ Efl.All.Shutdown();
}
}