Added SetToolNormalBitmap and SetToolDisabledBitmap

(ported from 2.8 branch)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-02-06 21:13:03 +00:00
parent 0daf5e6be2
commit bbd321ffc2
8 changed files with 120 additions and 4 deletions

View File

@@ -597,6 +597,30 @@ void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
}
}
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
{
wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
tool->SetNormalBitmap(bitmap);
tool->SetImage(tool->GetBitmap());
}
}
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
tool->SetDisabledBitmap(bitmap);
tool->SetImage(tool->GetBitmap());
}
}
// ----------------------------------------------------------------------------
// wxToolBar idle handling
// ----------------------------------------------------------------------------