From ee3a549a02b06a1ff86ee01fd7ea8b0c23ee1a84 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 1 Jun 2016 13:59:31 -0400 Subject: [PATCH] Added GtkSeparator --- .../GtkMenuItem.cs | 4 ++-- .../GtkSeparator.cs | 22 +++++++++++++++++++ .../Internal/GTK/Methods.cs | 5 +++++ .../UniversalEditor.Engines.GTK.csproj | 1 + 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkSeparator.cs diff --git a/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkMenuItem.cs b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkMenuItem.cs index 776ae8b2..36650a4c 100644 --- a/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkMenuItem.cs +++ b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkMenuItem.cs @@ -5,7 +5,7 @@ namespace UniversalEditor.Engines.GTK public class GtkMenuItem : GtkWidget { public class GtkMenuItemCollection - : System.Collections.ObjectModel.Collection + : System.Collections.ObjectModel.Collection { private GtkMenuShell _parent = null; internal GtkMenuItemCollection(GtkMenuShell parent) @@ -13,7 +13,7 @@ namespace UniversalEditor.Engines.GTK _parent = parent; } - protected override void InsertItem (int index, GtkMenuItem item) + protected override void InsertItem (int index, GtkWidget item) { base.InsertItem (index, item); Internal.GTK.Methods.gtk_menu_shell_insert (_parent.Handle, item.Handle, index); diff --git a/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkSeparator.cs b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkSeparator.cs new file mode 100644 index 00000000..0a7daf1d --- /dev/null +++ b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/GtkSeparator.cs @@ -0,0 +1,22 @@ +using System; + +namespace UniversalEditor.Engines.GTK +{ + public class GtkSeparator : GtkWidget + { + private GtkBoxOrientation mvarOrientation = GtkBoxOrientation.Horizontal; + public GtkBoxOrientation Orientation { get { return mvarOrientation; } } + + public GtkSeparator (GtkBoxOrientation orientation) + { + mvarOrientation = orientation; + } + + protected override IntPtr CreateInternal () + { + IntPtr handle = Internal.GTK.Methods.gtk_separator_new (mvarOrientation); + return handle; + } + } +} + diff --git a/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/Internal/GTK/Methods.cs b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/Internal/GTK/Methods.cs index 6e8c3fac..97ecabc7 100644 --- a/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/Internal/GTK/Methods.cs +++ b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/Internal/GTK/Methods.cs @@ -135,6 +135,11 @@ namespace UniversalEditor.Engines.GTK.Internal.GTK [DllImport(LIBRARY_FILENAME)] public static extern void gtk_menu_item_set_submenu(IntPtr handle, IntPtr submenu); #endregion + + #region Separator + [DllImport(LIBRARY_FILENAME)] + public static extern IntPtr gtk_separator_new(GtkBoxOrientation orientation); + #endregion } } diff --git a/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/UniversalEditor.Engines.GTK.csproj b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/UniversalEditor.Engines.GTK.csproj index c1bc13c7..93e00c18 100644 --- a/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/UniversalEditor.Engines.GTK.csproj +++ b/CSharp/Engines/GTK/UniversalEditor.Engines.GTK/UniversalEditor.Engines.GTK.csproj @@ -51,6 +51,7 @@ +