gtk_toolbar_set_orientation(m_toolbar, orient);
gtk_toolbar_set_style(m_toolbar, style);
- gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), !(style & wxTB_NO_TOOLTIPS) );
+ gtk_toolbar_set_tooltips(m_toolbar, !(style & wxTB_NO_TOOLTIPS));
}
void wxToolBar::SetWindowStyleFlag( long style )
bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
{
- wxToolBarTool *tool = (wxToolBarTool *)toolBase;
-
- size_t posGtk = pos;
+ wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
if ( tool->IsButton() )
{
wxCHECK_MSG( bitmap.Ok(), false,
wxT("invalid bitmap for wxToolBar icon") );
- wxCHECK_MSG( bitmap.GetDepth() != 1, false,
- wxT("wxToolBar doesn't support GdkBitmap") );
-
- wxCHECK_MSG( bitmap.GetPixmap() != NULL, false,
- wxT("wxToolBar::Add needs a wxBitmap") );
-
tool->m_image = gtk_image_new();
tool->SetImage(bitmap);
}
}
+ const int posGtk = int(pos);
+
switch ( tool->GetStyle() )
{
case wxTOOL_STYLE_BUTTON:
bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *toolBase)
{
- wxToolBarTool *tool = (wxToolBarTool *)toolBase;
+ wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
switch ( tool->GetStyle() )
{
void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable)
{
- wxToolBarTool *tool = (wxToolBarTool *)toolBase;
+ wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
if (tool->m_item)
{
void wxToolBar::DoToggleTool( wxToolBarToolBase *toolBase, bool toggle )
{
- wxToolBarTool *tool = (wxToolBarTool *)toolBase;
+ wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
GtkWidget *item = tool->m_item;
if ( item && GTK_IS_TOGGLE_BUTTON(item) )
void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
{
- wxToolBarTool *tool = (wxToolBarTool *)FindById(id);
+ wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
if ( tool )
{