}
}
-//-----------------------------------------------------------------------------
-// InsertChild callback for wxToolBar
-//-----------------------------------------------------------------------------
-
-static void wxInsertChildInToolBar(wxWindow* parent, wxWindow* child)
+void wxToolBar::AddChildGTK(wxWindowGTK* child)
{
GtkWidget* align = gtk_alignment_new(0.5, 0.5, 0, 0);
gtk_widget_show(align);
gtk_container_add(GTK_CONTAINER(align), child->m_widget);
GtkToolItem* item = gtk_tool_item_new();
gtk_container_add(GTK_CONTAINER(item), align);
- wxToolBar* tbar = static_cast<wxToolBar*>(parent);
// position will be corrected in DoInsertTool if necessary
- gtk_toolbar_insert(GTK_TOOLBAR(GTK_BIN(tbar->m_widget)->child), item, -1);
+ gtk_toolbar_insert(GTK_TOOLBAR(GTK_BIN(m_widget)->child), item, -1);
}
// ----------------------------------------------------------------------------
void wxToolBar::Init()
{
- m_toolbar = (GtkToolbar *)NULL;
+ m_toolbar = NULL;
m_tooltips = NULL;
}
long style,
const wxString& name )
{
- m_insertCallback = wxInsertChildInToolBar;
-
if ( !PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
GSList* radioGroup;
switch ( tool->GetStyle() )
case wxTOOL_STYLE_CONTROL:
wxWindow* control = tool->GetControl();
if (control->m_widget->parent == NULL)
- wxInsertChildInToolBar(this, control);
+ AddChildGTK(control);
tool->m_item = GTK_TOOL_ITEM(control->m_widget->parent->parent);
if (gtk_toolbar_get_item_index(m_toolbar, tool->m_item) != int(pos))
{
bool wxToolBar::DoDeleteTool(size_t /* pos */, wxToolBarToolBase* toolBase)
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
if (tool->GetStyle() == wxTOOL_STYLE_CONTROL)
{
void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable)
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
if (tool->m_item)
gtk_widget_set_sensitive(GTK_WIDGET(tool->m_item), enable);
void wxToolBar::DoToggleTool( wxToolBarToolBase *toolBase, bool toggle )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase);
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
if (tool->m_item)
{
bool WXUNUSED(toggle))
{
// VZ: absolutely no idea about how to do it
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( wxT("not implemented") );
}
// ----------------------------------------------------------------------------
wxCoord WXUNUSED(y)) const
{
// VZ: GTK+ doesn't seem to have such thing
- wxFAIL_MSG( _T("wxToolBar::FindToolForPosition() not implemented") );
+ wxFAIL_MSG( wxT("wxToolBar::FindToolForPosition() not implemented") );
- return (wxToolBarToolBase *)NULL;
+ return NULL;
}
void wxToolBar::SetToolShortHelp( int id, const wxString& helpString )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
{
- wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id));
+ wxToolBarTool* tool = static_cast<wxToolBarTool*>(FindById(id));
if ( tool )
{
wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools."));
void wxToolBar::OnInternalIdle()
{
// Check if we have to show window now
- if (GtkShowFromOnIdle()) return;
+ if (GTKShowFromOnIdle()) return;
wxCursor cursor = m_cursor;
if (g_globalCursor.Ok()) cursor = g_globalCursor;