X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76b49cf49ba9ee9f3eeec9730cb4bc4569ab17f1..13b4df952c77383f50696e51fcbaa2d8bbd3b3b9:/src/motif/toolbar.cpp?ds=sidebyside diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index dc724b395e..c8ae30e002 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -20,20 +20,15 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifdef __VMS -#define XtDisplay XTDISPLAY -#endif - #include "wx/toolbar.h" #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/frame.h" + #include "wx/timer.h" + #include "wx/settings.h" #endif -#include "wx/settings.h" -#include "wx/timer.h" - #ifdef __VMS__ #pragma message disable nosimpint #endif @@ -98,8 +93,8 @@ public: Init(); } - wxToolBarTool(wxToolBar *tbar, wxControl *control) - : wxToolBarToolBase(tbar, control) + wxToolBarTool(wxToolBar *tbar, wxControl *control, const wxString& label) + : wxToolBarToolBase(tbar, control, label) { Init(); } @@ -132,7 +127,7 @@ protected: // globals // ---------------------------------------------------------------------------- -static wxToolBarTimer* wxTheToolBarTimer = (wxToolBarTimer*) NULL; +static wxToolBarTimer* wxTheToolBarTimer = NULL; Widget wxToolBarTimer::help_popup = (Widget) 0; Widget wxToolBarTimer::buttonWidget = (Widget) 0; @@ -160,9 +155,10 @@ wxToolBarToolBase *wxToolBar::CreateTool(int id, } -wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control) +wxToolBarToolBase * +wxToolBar::CreateTool(wxControl *control, const wxString& label) { - return new wxToolBarTool(this, control); + return new wxToolBarTool(this, control, label); } void wxToolBarTool::Init() @@ -204,8 +200,9 @@ bool wxToolBar::Create(wxWindow *parent, if( !wxControl::CreateControl( parent, id, pos, size, style, wxDefaultValidator, name ) ) return false; + PreCreation(); - m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); + FixupStyle(); Widget parentWidget = (Widget) parent->GetClientWidget(); @@ -230,8 +227,6 @@ bool wxToolBar::Create(wxWindow *parent, m_mainWidget = (WXWidget) toolbar; - ChangeFont(false); - wxPoint rPos = pos; wxSize rSize = size; @@ -240,18 +235,16 @@ bool wxToolBar::Create(wxWindow *parent, if( rSize.x == -1 && GetParent() ) rSize.x = GetParent()->GetSize().x; + PostCreation(); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, rPos.x, rPos.y, rSize.x, rSize.y); - ChangeBackgroundColour(); - return true; } wxToolBar::~wxToolBar() { - delete wxTheToolBarTimer; - wxTheToolBarTimer = NULL; + wxDELETE(wxTheToolBarTimer); } bool wxToolBar::Realize() @@ -380,20 +373,20 @@ bool wxToolBar::Realize() insensBmp = tool->GetDisabledBitmap(); if ( bmp.GetMask() || insensBmp.GetMask() ) { - int backgroundPixel; + WXPixel backgroundPixel; XtVaGetValues(button, XmNbackground, &backgroundPixel, NULL); wxColour col; col.SetPixel(backgroundPixel); - if( bmp.Ok() && bmp.GetMask() ) + if( bmp.IsOk() && bmp.GetMask() ) { bmp = wxCreateMaskedBitmap(bmp, col); tool->SetNormalBitmap(bmp); } - if( insensBmp.Ok() && insensBmp.GetMask() ) + if( insensBmp.IsOk() && insensBmp.GetMask() ) { insensBmp = wxCreateMaskedBitmap(insensBmp, col); tool->SetDisabledBitmap(insensBmp); @@ -403,7 +396,7 @@ bool wxToolBar::Realize() // Create a selected/toggled bitmap. If there isn't a 2nd // bitmap, we need to create it (with a darker, selected // background) - int backgroundPixel; + WXPixel backgroundPixel; if ( tool->CanBeToggled() ) XtVaGetValues(button, XmNselectColor, &backgroundPixel, NULL); @@ -417,7 +410,7 @@ bool wxToolBar::Realize() { wxBitmap tmp = tool->GetDisabledBitmap(); - insensPixmap = tmp.Ok() ? + insensPixmap = tmp.IsOk() ? (Pixmap)tmp.GetDrawable() : tool->GetInsensPixmap(); } @@ -484,9 +477,9 @@ bool wxToolBar::Realize() wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) const { - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( wxT("TODO") ); - return (wxToolBarToolBase *)NULL; + return NULL; } bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool) @@ -658,7 +651,7 @@ wxToolBarToolBase *wxToolBar::FindToolByWidget(WXWidget w) const node = node->GetNext(); } - return (wxToolBarToolBase *)NULL; + return NULL; } static void wxToolButtonCallback(Widget w,