Permalink
Browse files

Simplify menu/tool hierarchy even more by eliminating ToolBarItem and…

… ActionMenuItem and making the naming more consistent

Added OnLoad/OnUnload to menu/toolbar when set onto a window (+1 squashed commit)
Squashed commits:
[373c5d9] Refactor menu/toolbar to eliminate BaseAction (CommandBase) from the hierarchy so things like MenuText/ToolBarText don’t muddy the api.
BaseAction now becomes Command, which can be used to create a menu or tool item but is a separate, plain class.
  • Loading branch information...
1 parent b5f2ba2 commit 175159d1b9dc543716c6d7b700a7cc90745417e5 @cwensley cwensley committed Dec 15, 2013
Showing with 1,470 additions and 1,499 deletions.
  1. +6 −6 Source/Eto.Platform.Gtk/Eto.Platform.Gtk.csproj
  2. +7 −15 Source/Eto.Platform.Gtk/Eto.Platform.Gtk3.csproj
  3. +7 −2 Source/Eto.Platform.Gtk/Forms/ApplicationHandler.cs
  4. +1 −1 Source/Eto.Platform.Gtk/Forms/Controls/GtkControl.cs
  5. +5 −5 Source/Eto.Platform.Gtk/Forms/GtkWindow.cs
  6. +5 −5 Source/Eto.Platform.Gtk/Forms/Menu/{ImageMenuItemHandler.cs → ButtonMenuItemHandler.cs}
  7. +0 −11 Source/Eto.Platform.Gtk/Forms/Menu/CheckMenuItemHandler.cs
  8. +3 −3 Source/Eto.Platform.Gtk/Forms/Menu/ContextMenuHandler.cs
  9. +3 −3 Source/Eto.Platform.Gtk/Forms/Menu/MenuBarHandler.cs
  10. +2 −13 Source/Eto.Platform.Gtk/Forms/Menu/MenuHandler.cs
  11. +3 −3 Source/Eto.Platform.Gtk/Forms/Menu/RadioMenuItemHandler.cs
  12. +19 −7 Source/Eto.Platform.Gtk/Forms/Menu/SeparatorMenuItemHandler.cs
  13. +1 −1 Source/Eto.Platform.Gtk/Forms/ToolBar/{ToolBarButtonHandler.cs → ButtonToolItemHandler.cs}
  14. +1 −1 Source/Eto.Platform.Gtk/Forms/ToolBar/{CheckToolBarButtonHandler.cs → CheckToolItemHandler.cs}
  15. +4 −4 Source/Eto.Platform.Gtk/Forms/ToolBar/{SeparatorToolBarItemHandler.cs → SeparatorToolItemHandler.cs}
  16. +2 −7 Source/Eto.Platform.Gtk/Forms/ToolBar/ToolBarHandler.cs
  17. +6 −2 Source/Eto.Platform.Gtk/Forms/ToolBar/{ToolBarItemHandler.cs → ToolItemHandler.cs}
  18. +4 −4 Source/Eto.Platform.Gtk/Generator.cs
  19. +6 −2 Source/Eto.Platform.Gtk/MenuActionItemHandler.cs
  20. +1 −1 Source/Eto.Platform.Mac/Eto.Platform.Mac.csproj
  21. +2 −2 Source/Eto.Platform.Mac/Eto.Platform.XamMac.csproj
  22. +0 −39 Source/Eto.Platform.Mac/Forms/Actions/MacButtonAction.cs
  23. +19 −0 Source/Eto.Platform.Mac/Forms/Actions/MacCommand.cs
  24. +93 −81 Source/Eto.Platform.Mac/Forms/ApplicationHandler.cs
  25. +15 −15 Source/Eto.Platform.Mac/Forms/MacView.cs
  26. +1 −1 Source/Eto.Platform.Mac/Forms/Menu/CheckMenuItemHandler.cs
  27. +48 −52 Source/Eto.Platform.Mac/Forms/Menu/ImageMenuItemHandler.cs
  28. +1 −1 Source/Eto.Platform.Mac/Forms/Menu/MenuActionHandler.cs
  29. +11 −0 Source/Eto.Platform.Mac/Forms/Menu/MenuHandler.cs
  30. +1 −1 Source/Eto.Platform.Mac/Forms/Menu/RadioMenuItemHandler.cs
  31. +6 −0 Source/Eto.Platform.Mac/Forms/Menu/SeparatorMenuItem.cs
  32. +1 −1 Source/Eto.Platform.Mac/Forms/ToolBar/CheckToolBarButtonHandler.cs
  33. +34 −5 Source/Eto.Platform.Mac/Forms/ToolBar/SeparatorToolBarItemHandler.cs
  34. +1 −1 Source/Eto.Platform.Mac/Forms/ToolBar/ToolBarButtonHandler.cs
  35. +2 −2 Source/Eto.Platform.Mac/Forms/ToolBar/ToolBarHandler.cs
  36. +4 −4 Source/Eto.Platform.Mac/Forms/ToolBar/ToolBarItemHandler.cs
  37. +4 −4 Source/Eto.Platform.Mac/Generator.cs
  38. +4 −4 Source/Eto.Platform.Windows/Eto.Platform.Windows.csproj
  39. +9 −4 Source/Eto.Platform.Windows/Forms/ApplicationHandler.cs
  40. +1 −1 Source/Eto.Platform.Windows/Forms/Controls/WindowsControl.cs
  41. +3 −3 Source/Eto.Platform.Windows/Forms/Menu/{ImageMenuItemHandler.cs → ButtonMenuItemHandler.cs}
  42. +11 −32 Source/Eto.Platform.Windows/Forms/Menu/CheckMenuItemHandler.cs
  43. +1 −1 Source/Eto.Platform.Windows/Forms/Menu/ContextMenuHandler.cs
  44. +4 −1 Source/Eto.Platform.Windows/Forms/Menu/MenuHandler.cs
  45. +0 −19 Source/Eto.Platform.Windows/Forms/Menu/RadioMenuItemHandler.cs
  46. +25 −0 Source/Eto.Platform.Windows/Forms/Menu/SeparatorMenuItem.cs
  47. +2 −12 Source/Eto.Platform.Windows/Forms/ToolBar/{ToolBarButtonHandler.cs → ButtonToolItemHandler.cs}
  48. +3 −12 Source/Eto.Platform.Windows/Forms/ToolBar/{CheckToolBarButtonHandler.cs → CheckToolItemHandler.cs}
  49. +41 −11 Source/Eto.Platform.Windows/Forms/ToolBar/SeparatorToolBarItemHandler.cs
  50. +3 −7 Source/Eto.Platform.Windows/Forms/ToolBar/ToolBarHandler.cs
  51. +14 −11 Source/Eto.Platform.Windows/Forms/ToolBar/{ToolBarItemHandler.cs → ToolItemHandler.cs}
  52. +4 −4 Source/Eto.Platform.Windows/Generator.cs
  53. +6 −6 Source/Eto.Platform.Wpf/Eto.Platform.Wpf.csproj
  54. +6 −1 Source/Eto.Platform.Wpf/Forms/ApplicationHandler.cs
  55. +2 −2 Source/Eto.Platform.Wpf/Forms/Menu/{ImageMenuItemHandler.cs → ButtonMenuItemHandler.cs}
  56. +1 −1 Source/Eto.Platform.Wpf/Forms/Menu/CheckMenuItemHandler.cs
  57. +9 −5 Source/Eto.Platform.Wpf/Forms/Menu/{WpfMenuItem.cs → MenuItemHandler.cs}
  58. +1 −1 Source/Eto.Platform.Wpf/Forms/Menu/RadioMenuItemHandler.cs
  59. +29 −0 Source/Eto.Platform.Wpf/Forms/Menu/SeparatorMenuItemHandler.cs
  60. +6 −6 Source/Eto.Platform.Wpf/Forms/ToolBar/{ToolBarButtonHandler.cs → ButtonToolItemHandler.cs}
  61. +6 −6 Source/Eto.Platform.Wpf/Forms/ToolBar/{CheckToolBarButtonHandler.cs → CheckToolItemHandler.cs}
  62. +0 −52 Source/Eto.Platform.Wpf/Forms/ToolBar/SeparatorToolBarItemHandler.cs
  63. +79 −0 Source/Eto.Platform.Wpf/Forms/ToolBar/SeparatorToolItemHandler.cs
  64. +2 −2 Source/Eto.Platform.Wpf/Forms/ToolBar/ToolBarHandler.cs
  65. +0 −10 Source/Eto.Platform.Wpf/Forms/ToolBar/ToolBarItemHandler.cs
  66. +23 −0 Source/Eto.Platform.Wpf/Forms/ToolBar/ToolItemHandler.cs
  67. +1 −1 Source/Eto.Platform.Wpf/Forms/WpfFrameworkElement.cs
  68. +4 −4 Source/Eto.Platform.Wpf/Generator.cs
  69. +9 −29 Source/Eto.Test/Eto.Test/Actions/About.cs
  70. +0 −42 Source/Eto.Test/Eto.Test/Actions/Close.cs
  71. +10 −30 Source/Eto.Test/Eto.Test/Actions/Quit.cs
  72. +0 −1 Source/Eto.Test/Eto.Test/Eto.Test.csproj
  73. +26 −71 Source/Eto.Test/Eto.Test/MainForm.cs
  74. +7 −7 Source/Eto.Test/Eto.Test/Sections/Behaviors/ContextMenuSection.cs
  75. +9 −9 Source/Eto.Test/Eto.Test/Sections/Controls/GridViewSection.cs
  76. +3 −3 Source/Eto.Test/Eto.Test/Sections/Controls/ListBoxSection.cs
  77. +3 −3 Source/Eto.Test/Eto.Test/Sections/Controls/TreeGridViewSection.cs
  78. +3 −3 Source/Eto.Test/Eto.Test/Sections/Controls/TreeViewSection.cs
  79. +11 −11 Source/Eto/Eto.csproj
  80. +7 −7 Source/Eto/Forms/Actions/ActionItem.cs
  81. +2 −2 Source/Eto/Forms/Actions/ActionItem.desktop.cs
  82. +2 −2 Source/Eto/Forms/Actions/ActionItemCollection.cs
  83. +8 −3 Source/Eto/Forms/Actions/ActionItemCollection.desktop.cs
  84. +1 −1 Source/Eto/Forms/Actions/BaseAction.cs
  85. +5 −5 Source/Eto/Forms/Actions/ButtonAction.cs
  86. +4 −4 Source/Eto/Forms/Actions/ButtonAction.desktop.cs
  87. +5 −5 Source/Eto/Forms/Actions/CheckAction.cs
  88. +1 −1 Source/Eto/Forms/Actions/CheckAction.desktop.cs
  89. +1 −1 Source/Eto/Forms/Actions/RadioAction.cs
  90. +1 −1 Source/Eto/Forms/Actions/RadioAction.desktop.cs
  91. +3 −3 Source/Eto/Forms/Application.cs
  92. +16 −7 Source/Eto/Forms/Application.desktop.cs
  93. +135 −0 Source/Eto/Forms/Command.cs
  94. +0 −222 Source/Eto/Forms/CommandBase.cs
  95. +2 −2 Source/Eto/Forms/Controls/Control.cs
  96. +1 −1 Source/Eto/Forms/Controls/EnumComboBox.cs
  97. +1 −1 Source/Eto/Forms/Controls/EnumRadioButtonList.cs
  98. +1 −1 Source/Eto/Forms/Controls/ThemedControlHandler.cs
  99. +64 −0 Source/Eto/Forms/Menu/ButtonMenuItem.cs
  100. +2 −2 Source/Eto/Forms/Menu/CheckMenuItem.cs
  101. +22 −37 Source/Eto/Forms/Menu/ContextMenu.cs
  102. +0 −121 Source/Eto/Forms/Menu/ImageMenuItem.cs
  103. +9 −1 Source/Eto/Forms/Menu/Menu.cs
  104. +0 −79 Source/Eto/Forms/Menu/MenuActionItem.cs
  105. +18 −35 Source/Eto/Forms/Menu/MenuBar.cs
  106. +67 −26 Source/Eto/Forms/Menu/MenuItem.cs
  107. +136 −0 Source/Eto/Forms/Menu/MenuItemCollection.cs
  108. +2 −2 Source/Eto/Forms/Menu/RadioMenuItem.cs
  109. +0 −2 Source/Eto/Forms/Menu/SeparatorMenuItem.cs
  110. +3 −30 Source/Eto/Forms/Menu/SubMenu.cs
  111. +28 −0 Source/Eto/Forms/ToolBar/ButtonToolItem.cs
  112. +4 −4 Source/Eto/Forms/ToolBar/{CheckToolBarButton.cs → CheckToolItem.cs}
  113. +9 −11 Source/Eto/Forms/ToolBar/{SeparatorToolBarItem.cs → SeparatorToolItem.cs}
  114. +29 −43 Source/Eto/Forms/ToolBar/ToolBar.cs
  115. +0 −67 Source/Eto/Forms/ToolBar/ToolBarActionItem.cs
  116. +0 −20 Source/Eto/Forms/ToolBar/ToolBarButton.cs
  117. +0 −15 Source/Eto/Forms/ToolBar/ToolBarItem.cs
  118. +78 −0 Source/Eto/Forms/ToolBar/ToolItem.cs
  119. +75 −0 Source/Eto/Forms/ToolBar/ToolItemCollection.cs
  120. +9 −1 Source/Eto/Forms/Window.cs
  121. +9 −1 Source/Eto/Forms/Window.desktop.cs
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -165,7 +165,7 @@
<Compile Include="Forms\Menu\CheckMenuItemHandler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Forms\Menu\ImageMenuItemHandler.cs">
+ <Compile Include="Forms\Menu\ButtonMenuItemHandler.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Forms\Menu\SeparatorMenuItemHandler.cs">
@@ -180,17 +180,17 @@
<Compile Include="Forms\Menu\MenuBarHandler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Forms\ToolBar\CheckToolBarButtonHandler.cs">
+ <Compile Include="Forms\ToolBar\CheckToolItemHandler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Forms\ToolBar\SeparatorToolBarItemHandler.cs" />
- <Compile Include="Forms\ToolBar\ToolBarButtonHandler.cs">
+ <Compile Include="Forms\ToolBar\SeparatorToolItemHandler.cs" />
+ <Compile Include="Forms\ToolBar\ButtonToolItemHandler.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Forms\ToolBar\ToolBarHandler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Forms\ToolBar\ToolBarItemHandler.cs">
+ <Compile Include="Forms\ToolBar\ToolItemHandler.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Forms\SelectFolderDialogHandler.cs" />
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
@@ -107,6 +107,11 @@
<Compile Include="Forms\Controls\ProgressBarHandler.cs" />
<Compile Include="Forms\Controls\TreeViewHandler.cs" />
<Compile Include="Forms\FontDialogHandler.cs" />
+ <Compile Include="Forms\Menu\ButtonMenuItemHandler.cs" />
+ <Compile Include="Forms\ToolBar\ButtonToolItemHandler.cs" />
+ <Compile Include="Forms\ToolBar\CheckToolItemHandler.cs" />
+ <Compile Include="Forms\ToolBar\SeparatorToolItemHandler.cs" />
+ <Compile Include="Forms\ToolBar\ToolItemHandler.cs" />
<Compile Include="Generator.cs">
<SubType>Code</SubType>
</Compile>
@@ -188,9 +193,6 @@
<Compile Include="Forms\Menu\CheckMenuItemHandler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Forms\Menu\ImageMenuItemHandler.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Forms\Menu\SeparatorMenuItemHandler.cs">
<SubType>Code</SubType>
</Compile>
@@ -203,19 +205,9 @@
<Compile Include="Forms\Menu\MenuBarHandler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Forms\ToolBar\CheckToolBarButtonHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Forms\ToolBar\SeparatorToolBarItemHandler.cs" />
- <Compile Include="Forms\ToolBar\ToolBarButtonHandler.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Forms\ToolBar\ToolBarHandler.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Forms\ToolBar\ToolBarItemHandler.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Forms\SelectFolderDialogHandler.cs" />
<Compile Include="Forms\Controls\ComboBoxHandler.cs" />
<Compile Include="Forms\UITimerHandler.cs" />
@@ -293,4 +285,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
-</Project>
+</Project>
@@ -158,10 +158,15 @@ public void Open (string url)
Process.Start (info);
}
- public void GetSystemActions(List<CommandBase> actions, ISubMenuWidget menu, ToolBar toolBar, bool addStandardItems)
+ public IEnumerable<Command> GetSystemCommands()
{
+ yield break;
}
-
+
+ public void CreateStandardMenu(MenuItemCollection menu, IEnumerable<Command> commands)
+ {
+ }
+
public Keys CommonModifier {
get {
return Keys.Control;
@@ -538,7 +538,7 @@ public string ToolTip
set { Control.TooltipText = value; }
}
- public virtual void MapPlatformAction(string systemAction, CommandBase action)
+ public virtual void MapPlatformAction(string systemAction, Command action)
{
}
@@ -304,19 +304,19 @@ public MenuBar Menu
}
}
- void SetAccelerators(ISubMenuWidget item)
+ void SetAccelerators(IMenuItemsSource item)
{
- if (item != null && item.MenuItems != null)
- foreach (var child in item.MenuItems)
+ if (item != null && item.Items != null)
+ foreach (var child in item.Items)
{
- var actionItem = child as MenuActionItem;
+ var actionItem = child;
if (actionItem != null && actionItem.Shortcut != Key.None)
{
var widget = (Gtk.Widget)actionItem.ControlObject;
var key = new Gtk.AccelKey(actionItem.Shortcut.ToGdkKey(), actionItem.Shortcut.ToGdkModifier(), Gtk.AccelFlags.Visible | Gtk.AccelFlags.Locked);
widget.AddAccelerator("activate", accelGroup, key);
}
- SetAccelerators(child as ISubMenuWidget);
+ SetAccelerators(child as IMenuItemsSource);
}
}
@@ -4,15 +4,15 @@
namespace Eto.Platform.GtkSharp
{
- public class ImageMenuItemHandler : MenuActionItemHandler<Gtk.ImageMenuItem, ImageMenuItem>, IImageMenuItem
+ public class ButtonMenuItemHandler : MenuActionItemHandler<Gtk.ImageMenuItem, ButtonMenuItem>, IButtonMenuItem
{
string tooltip;
string text;
Keys shortcut;
Image image;
readonly Gtk.AccelLabel label;
- public ImageMenuItemHandler()
+ public ButtonMenuItemHandler()
{
Control = new Gtk.ImageMenuItem();
Control.Activated += control_Activated;
@@ -72,13 +72,13 @@ public Image Image
}
}
- public override void AddMenu(int index, MenuItem item)
+ public void AddMenu(int index, MenuItem item)
{
if (Control.Submenu == null) Control.Submenu = new Gtk.Menu();
((Gtk.Menu)Control.Submenu).Insert((Gtk.Widget)item.ControlObject, index);
}
- public override void RemoveMenu(MenuItem item)
+ public void RemoveMenu(MenuItem item)
{
if (Control.Submenu == null) return;
var menu = (Gtk.Menu)Control.Submenu;
@@ -89,7 +89,7 @@ public override void RemoveMenu(MenuItem item)
}
}
- public override void Clear()
+ public void Clear()
{
foreach (Gtk.Widget w in Control.Children)
{
@@ -68,17 +68,6 @@ public bool Enabled
set { Control.Sensitive = value; }
}
- public override void AddMenu(int index, MenuItem item)
- {
- }
-
- public override void RemoveMenu(MenuItem item)
- {
- }
-
- public override void Clear()
- {
- }
void control_Activated(object sender, EventArgs e)
{
if (!isBeingChecked)
@@ -10,18 +10,18 @@ public ContextMenuHandler()
Control = new Gtk.Menu();
}
- public override void AddMenu(int index, MenuItem item)
+ public void AddMenu(int index, MenuItem item)
{
Control.Insert((Gtk.Widget)item.ControlObject, index);
}
- public override void RemoveMenu(MenuItem item)
+ public void RemoveMenu(MenuItem item)
{
Control.Remove((Gtk.Widget)item.ControlObject);
}
- public override void Clear()
+ public void Clear()
{
foreach (Gtk.Widget w in Control.Children)
{
@@ -13,18 +13,18 @@ public MenuBarHandler()
Control = new Gtk.MenuBar();
}
- public override void AddMenu(int index, MenuItem item)
+ public void AddMenu(int index, MenuItem item)
{
Control.Insert((Gtk.Widget)item.ControlObject, index);
}
- public override void RemoveMenu(MenuItem item)
+ public void RemoveMenu(MenuItem item)
{
Control.Remove((Gtk.Widget)item.ControlObject);
}
- public override void Clear()
+ public void Clear()
{
foreach (Gtk.Widget w in Control.Children)
{
@@ -9,23 +9,12 @@ public abstract class MenuHandler<TControl, TWidget> : WidgetHandler<TControl, T
{
protected void ValidateItems()
{
- var subMenu = Widget as ISubMenuWidget;
+ var subMenu = Widget as IMenuItemsSource;
if (subMenu != null) {
- foreach (var item in subMenu.MenuItems.OfType<MenuActionItem>()) {
+ foreach (var item in subMenu.Items) {
item.OnValidate(EventArgs.Empty);
}
}
}
-
-
- #region IMenu Members
-
- public abstract void AddMenu(int index, MenuItem item);
-
- public abstract void RemoveMenu(MenuItem item);
-
- public abstract void Clear();
-
- #endregion
}
}
@@ -83,14 +83,14 @@ public void Create (RadioMenuItem controller)
set { Control.Sensitive = value; }
}
- public override void AddMenu (int index, MenuItem item)
+ public void AddMenu (int index, MenuItem item)
{
if (Control.Submenu == null)
Control.Submenu = new Gtk.Menu ();
((Gtk.Menu)Control.Submenu).Insert ((Gtk.Widget)item.ControlObject, index);
}
- public override void RemoveMenu (MenuItem item)
+ public void RemoveMenu (MenuItem item)
{
if (Control.Submenu == null)
return;
@@ -101,7 +101,7 @@ public override void RemoveMenu (MenuItem item)
}
}
- public override void Clear ()
+ public void Clear ()
{
foreach (Gtk.Widget w in Control.Children) {
Control.Remove (w);
@@ -5,25 +5,37 @@ namespace Eto.Platform.GtkSharp
{
public class SeparatorMenuItemHandler : MenuHandler<Gtk.SeparatorMenuItem, SeparatorMenuItem>, ISeparatorMenuItem
{
-
public SeparatorMenuItemHandler()
{
Control = new Gtk.SeparatorMenuItem();
}
- public override void AddMenu(int index, MenuItem item)
+ public void CreateFromCommand(Command command)
+ {
+ }
+
+ public string Text
+ {
+ get { return null; }
+ set { throw new NotSupportedException(); }
+ }
+
+ public string ToolTip
{
- throw new NotSupportedException("Cannot add items to a separator");
+ get { return null; }
+ set { throw new NotSupportedException(); }
}
- public override void RemoveMenu(MenuItem item)
+ public Keys Shortcut
{
- throw new NotSupportedException("Separators do not contain any items to remove");
+ get { return Keys.None; }
+ set { throw new NotSupportedException(); }
}
- public override void Clear()
+ public bool Enabled
{
- throw new NotSupportedException("Separators do not contain any items to remove");
+ get { return false; }
+ set { }
}
}
}
@@ -4,7 +4,7 @@
namespace Eto.Platform.GtkSharp
{
- public class ToolBarButtonHandler : ToolBarItemHandler<Gtk.ToolButton, ToolBarButton>, IToolBarButton
+ public class ButtonToolItemHandler : ToolItemHandler<Gtk.ToolButton, ButtonToolItem>, IButtonToolItem
{
#region IToolBarButton Members
@@ -4,7 +4,7 @@
namespace Eto.Platform.GtkSharp
{
- public class CheckToolBarButtonHandler : ToolBarItemHandler<Gtk.ToggleToolButton, CheckToolBarButton>, ICheckToolBarButton
+ public class CheckToolItemHandler : ToolItemHandler<Gtk.ToggleToolButton, CheckToolItem>, ICheckToolItem
{
bool ischecked;
bool isBeingChecked;
@@ -2,9 +2,9 @@
namespace Eto.Platform.GtkSharp
{
- public class SeparatorToolBarItemHandler : ToolBarItemHandler<Gtk.SeparatorToolItem, SeparatorToolBarItem>, ISeparatorToolBarItem
+ public class SeparatorToolItemHandler : ToolItemHandler<Gtk.SeparatorToolItem, SeparatorToolItem>, ISeparatorToolItem
{
- SeparatorToolBarItemType type;
+ SeparatorToolItemType type;
bool expand;
public override void CreateControl (ToolBarHandler handler)
@@ -17,13 +17,13 @@ public override void CreateControl (ToolBarHandler handler)
}
- public SeparatorToolBarItemType Type {
+ public SeparatorToolItemType Type {
get {
return type;
}
set {
type = value;
- expand = type == SeparatorToolBarItemType.FlexibleSpace;
+ expand = type == SeparatorToolItemType.FlexibleSpace;
if (Control != null) Control.Expand = expand;
}
}
Oops, something went wrong.

0 comments on commit 175159d

Please sign in to comment.