// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "toolbar.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// wxWin macros
// ----------------------------------------------------------------------------
-#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
-#endif
// ----------------------------------------------------------------------------
// private functions
{
if( !wxControl::CreateControl( parent, id, pos, size, style,
wxDefaultValidator, name ) )
- return FALSE;
+ return false;
m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
m_mainWidget = (WXWidget) toolbar;
- ChangeFont(FALSE);
+ ChangeFont(false);
wxPoint rPos = pos;
wxSize rSize = size;
ChangeBackgroundColour();
- return TRUE;
+ return true;
}
wxToolBar::~wxToolBar()
if ( m_tools.GetCount() == 0 )
{
// nothing to do
- return TRUE;
+ return true;
}
bool isVertical = GetWindowStyle() & wxTB_VERTICAL;
int buttonHeight = 0, buttonWidth = 0;
- int currentSpacing = 0;
-
Widget button;
Pixmap pixmap, insensPixmap;
wxBitmap bmp, insensBmp;
if( !tool->GetButtonWidget() )
{
wxDoChangeBackgroundColour((WXWidget) button,
- m_backgroundColour, TRUE);
+ m_backgroundColour, true);
tool->SetWidget(button);
}
XtAddEventHandler (button, EnterWindowMask | LeaveWindowMask,
False, wxToolButtonPopupCallback, (XtPointer) this);
- currentSpacing = 0;
break;
}
isVertical ? buttonWidth + 2 * marginX : -1,
isVertical ? -1 : buttonHeight + 2*marginY );
- return TRUE;
+ return true;
}
wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x),
{
tool->Attach(this);
- return TRUE;
+ return true;
}
bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
}
}
- return TRUE;
+ return true;
}
void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable)
{
wxToolBarTool *tool = (wxToolBarTool *)toolBase;
-
- XtSetSensitive(tool->GetButtonWidget(), (Boolean) enable);
+ if (tool->GetButtonWidget()){
+ XtSetSensitive(tool->GetButtonWidget(), (Boolean) enable);
+ } else if (wxTOOL_STYLE_CONTROL == tool->GetStyle()){
+ // Controls (such as wxChoice) do not have button widgets
+ tool->GetControl()->Enable(enable);
+ }
}
void wxToolBar::DoToggleTool(wxToolBarToolBase *toolBase, bool toggle)
wxToolBarTimer::help_popup = (Widget) 0;
// One shot
- wxTheToolBarTimer->Start(delayMilli, TRUE);
+ wxTheToolBarTimer->Start(delayMilli, true);
}
/************************************************************/