X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/567da5c600dc5bc6f3e5df18129f7125b433d83f..fc9ef629ac8733c4f0b844356782cca80ae09c4b:/src/common/tbarsmpl.cpp?ds=sidebyside diff --git a/src/common/tbarsmpl.cpp b/src/common/tbarsmpl.cpp index c7eceb5eed..e973cfdedb 100644 --- a/src/common/tbarsmpl.cpp +++ b/src/common/tbarsmpl.cpp @@ -24,7 +24,7 @@ #include "wx/wx.h" #endif -#if USE_TOOLBAR +#if wxUSE_TOOLBAR #include "wx/tbarsmpl.h" @@ -55,7 +55,6 @@ bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos // Set it to grey (or other 3D face colour) wxSystemSettings settings; SetBackgroundColour(settings.GetSystemColour(wxSYS_COLOUR_3DFACE)); - SetDefaultBackgroundColour(settings.GetSystemColour(wxSYS_COLOUR_3DFACE)); if ( GetWindowStyleFlag() & wxTB_VERTICAL ) { m_lastX = 7; m_lastY = 3; } @@ -67,6 +66,7 @@ bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos m_yMargin = 0; m_toolPacking = 1; m_toolSeparation = 5; + SetCursor(*wxSTANDARD_CURSOR); return TRUE; } @@ -75,7 +75,7 @@ wxToolBarSimple::~wxToolBarSimple () { } -void wxToolBarSimple::OnPaint (wxPaintEvent& event) +void wxToolBarSimple::OnPaint (wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); PrepareDC(dc); @@ -103,7 +103,7 @@ void wxToolBarSimple::OnSize ( wxSizeEvent& event ) wxToolBarBase::OnSize(event); } -void wxToolBarSimple::OnKillFocus (wxFocusEvent& event) +void wxToolBarSimple::OnKillFocus (wxFocusEvent& WXUNUSED(event)) { OnMouseEnter(m_pressedTool = m_currentTool = -1); } @@ -212,8 +212,10 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool) if (bitmap && bitmap->Ok()) { +#ifndef __WXGTK__ if (bitmap->GetPalette()) memDC.SetPalette(*bitmap->GetPalette()); +#endif int ax = (int)tool->m_x, ay = (int)tool->m_y, @@ -225,7 +227,7 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool) { dc.SetClippingRegion(ax, ay, (bx-ax+1), (by-ay+1)); dc.Blit((ax+1), (ay+1), (bx-ax-2), (by-ay-2), &memDC, 0, 0); - wxPen * old_pen = dc.GetPen(); + wxPen * old_pen = & dc.GetPen(); dc.SetPen( white_pen ); dc.DrawLine(ax,(by-1),ax,ay); dc.DrawLine(ax,ay,(bx-1),ay); @@ -246,17 +248,19 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool) &memDC, 0, 0); } memDC.SelectObject(wxNullBitmap); +#ifndef __WXGTK__ memDC.SetPalette(wxNullPalette); +#endif } // No second bitmap, so draw a thick line around bitmap, or invert if mono else if (tool->m_toggleState) { bool drawBorder = FALSE; - #ifdef __X__ // X doesn't invert properly on colour +#ifdef __X__ // X doesn't invert properly on colour drawBorder = wxColourDisplay(); - #else // Inversion works fine under Windows +#else // Inversion works fine under Windows drawBorder = FALSE; - #endif +#endif if (!drawBorder) { @@ -277,7 +281,7 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool) memDC.SelectObject(tool->m_bitmap1); dc.SetClippingRegion(ax, ay, (bx-ax+1), (by-ay+1)); dc.Blit((ax+2), (ay+2), (bx-ax-2), (by-ay-2), &memDC, 0, 0); - wxPen * old_pen = dc.GetPen(); + wxPen * old_pen = & dc.GetPen(); dc.SetPen( black_pen ); dc.DrawLine(ax,(by-1),ax,ay); dc.DrawLine(ax,ay,(bx-1),ay); @@ -315,7 +319,8 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool) void wxToolBarSimple::ToggleTool(int index, bool toggle) { - wxNode *node = m_tools.Find((long)index); + wxNode *node = (wxNode*) NULL; + node = m_tools.Find((long)index); if (node) { wxToolBarTool *tool = (wxToolBarTool *)node->Data(); @@ -340,7 +345,8 @@ void wxToolBarSimple::ToggleTool(int index, bool toggle) // void wxToolBarSimple::SpringUpButton(int index) { - wxNode *node=m_tools.Find((long)index); + wxNode *node = (wxNode*) NULL; + node=m_tools.Find((long)index); if (node) { wxToolBarTool *tool = (wxToolBarTool *)node->Data(); if (tool && !tool->m_isToggle && tool->m_toggleState){