Added GtkSeparator

This commit is contained in:
Michael Becker 2016-06-01 13:59:31 -04:00
parent d9e5e782e6
commit ee3a549a02
4 changed files with 30 additions and 2 deletions

View File

@ -5,7 +5,7 @@ namespace UniversalEditor.Engines.GTK
public class GtkMenuItem : GtkWidget
{
public class GtkMenuItemCollection
: System.Collections.ObjectModel.Collection<GtkMenuItem>
: System.Collections.ObjectModel.Collection<GtkWidget>
{
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);

View File

@ -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;
}
}
}

View File

@ -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
}
}

View File

@ -51,6 +51,7 @@
<Compile Include="GtkContainer.cs" />
<Compile Include="GtkBox.cs" />
<Compile Include="PackDirection.cs" />
<Compile Include="GtkSeparator.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>