supporting disabled tools, fixes #11457

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2010-07-07 08:26:00 +00:00
parent 281448385a
commit 35a11fc70c

View File

@@ -150,7 +150,7 @@ public:
return wxPoint( m_x, m_y ); return wxPoint( m_x, m_y );
} }
bool DoEnable( bool enable ); bool Enable( bool enable );
void UpdateImages(); void UpdateImages();
@@ -265,6 +265,7 @@ private:
- (void)setImplementation: (wxToolBarTool *) theImplementation; - (void)setImplementation: (wxToolBarTool *) theImplementation;
- (wxToolBarTool*) implementation; - (wxToolBarTool*) implementation;
- (void) clickedAction: (id) sender; - (void) clickedAction: (id) sender;
- (BOOL) validateToolbarItem:(NSToolbarItem *)theItem;
@end @end
@@ -332,6 +333,12 @@ private:
return impl; return impl;
} }
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
{
wxUnusedVar(theItem);
return impl->IsEnabled() ? YES:NO;
}
@end @end
@implementation wxNSToolbarDelegate @implementation wxNSToolbarDelegate
@@ -422,8 +429,11 @@ private:
@end @end
bool wxToolBarTool::DoEnable( bool enable ) bool wxToolBarTool::Enable( bool enable )
{ {
if ( wxToolBarToolBase::Enable( enable ) == false )
return false;
if ( IsControl() ) if ( IsControl() )
{ {
GetControl()->Enable( enable ); GetControl()->Enable( enable );
@@ -1177,10 +1187,9 @@ wxString wxToolBar::MacGetToolTipString( wxPoint &pt )
return wxEmptyString; return wxEmptyString;
} }
void wxToolBar::DoEnableTool(wxToolBarToolBase *t, bool enable) void wxToolBar::DoEnableTool(wxToolBarToolBase * WXUNUSED(t), bool WXUNUSED(enable))
{ {
if ( t != NULL ) // everything already done in the tool's Enable implementation
((wxToolBarTool*)t)->DoEnable( enable );
} }
void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle) void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle)