aboutsummaryrefslogtreecommitdiffstats
path: root/reference
diff options
context:
space:
mode:
Diffstat (limited to 'reference')
-rw-r--r--reference/csharp/ui/meson.build10
-rw-r--r--reference/csharp/ui/src/meson.build8
-rw-r--r--reference/csharp/ui/src/ui_sizing.cs59
3 files changed, 77 insertions, 0 deletions
diff --git a/reference/csharp/ui/meson.build b/reference/csharp/ui/meson.build
new file mode 100644
index 00000000..0552d449
--- /dev/null
+++ b/reference/csharp/ui/meson.build
@@ -0,0 +1,10 @@
+project(
+ 'efl-reference-ui', 'cs',
+ version : '0.0.1',
+ meson_version : '>= 0.38.0')
+
+efl_mono = dependency('efl-mono', version : '>=1.20.99')
+efl_mono_libs = efl_mono.get_pkgconfig_variable('mono_libs')
+
+subdir('src')
+
diff --git a/reference/csharp/ui/src/meson.build b/reference/csharp/ui/src/meson.build
new file mode 100644
index 00000000..3adaecf1
--- /dev/null
+++ b/reference/csharp/ui/src/meson.build
@@ -0,0 +1,8 @@
+deps = [efl_mono]
+
+executable('efl_reference_ui_sizing',
+ files(['ui_sizing.cs']),
+ dependencies : deps,
+ cs_args : efl_mono_libs,
+ install : true
+)
diff --git a/reference/csharp/ui/src/ui_sizing.cs b/reference/csharp/ui/src/ui_sizing.cs
new file mode 100644
index 00000000..94a28726
--- /dev/null
+++ b/reference/csharp/ui/src/ui_sizing.cs
@@ -0,0 +1,59 @@
+/*
+ * Efl.UI sizing examples.
+ *
+ * Demonstrate how to use the sizing api from Efl.Gfx.
+ * We load a box with 3 buttons, one with default sizing, one that has a max
+ * and the last has a min size. Try resizing the window to see how this changes.
+ */
+
+using System;
+
+public class Example
+{
+ public static void Main()
+ {
+ efl.All.Init(efl.Components.Ui);
+
+ efl.ui.Win win = new efl.ui.WinConcrete(null, (efl.ui.Win ewin) => {
+ ewin.SetWinType(efl.ui.win.Type.Basic);
+ ewin.SetText("Size Control");
+ ewin.SetAutohide(true);
+ });
+ eina.Size2D sz;
+ sz.W = 320;
+ sz.H = 320;
+ win.SetSize(sz);
+
+ // when the user clicks "close" on a window there is a request to hide
+ win.HIDE += (object sender, EventArgs e) => {
+ // quit the app, called if the window is hidden
+ efl.ui.Config.Exit();
+ };
+
+ efl.ui.Box box = new efl.ui.BoxConcrete(win);
+ win.SetContent(box);
+
+ efl.ui.Button button = new efl.ui.ButtonConcrete(win);
+ button.SetText("Button");
+ box.Pack(button);
+
+ efl.ui.Button small_btn = new efl.ui.ButtonConcrete(win);
+ small_btn.SetText("Small");
+ sz.W = 50;
+ sz.H = 50;
+ small_btn.SetHintMax(sz);
+ box.Pack(small_btn);
+
+ efl.ui.Button big_btn = new efl.ui.ButtonConcrete(win);
+ big_btn.SetText("Big Button");
+ sz.W = 100;
+ sz.H = 100;
+ big_btn.SetHintMin(sz);
+ box.Pack(big_btn);
+
+ efl.ui.Config.Run();
+
+ efl.All.Shutdown();
+ }
+}
+