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:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user