X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0ed460c2e7802793d591c84f3cfdbff159c5549..78e848cac9c973346dcf598f3c1b942b63dd2821:/src/common/tbarsmpl.cpp diff --git a/src/common/tbarsmpl.cpp b/src/common/tbarsmpl.cpp index 0e1a739d29..662c6aa4f8 100644 --- a/src/common/tbarsmpl.cpp +++ b/src/common/tbarsmpl.cpp @@ -21,7 +21,10 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" +#include "wx/settings.h" +#include "wx/window.h" +#include "wx/dcclient.h" +#include "wx/dcmemory.h" #endif #if wxUSE_TOOLBAR @@ -66,6 +69,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; } @@ -74,7 +78,7 @@ wxToolBarSimple::~wxToolBarSimple () { } -void wxToolBarSimple::OnPaint (wxPaintEvent& event) +void wxToolBarSimple::OnPaint (wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); PrepareDC(dc); @@ -102,15 +106,15 @@ 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); } void wxToolBarSimple::OnMouseEvent ( wxMouseEvent & event ) { - long x, y; - event.Position(&x, &y); + wxCoord x, y; + event.GetPosition(&x, &y); wxToolBarTool *tool = FindToolForPosition(x, y); if (event.LeftDown()) @@ -211,8 +215,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, @@ -245,17 +251,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) { @@ -314,7 +322,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(); @@ -339,7 +348,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){ @@ -357,7 +367,7 @@ void wxToolBarSimple::SpringUpButton(int index) } } -void wxToolBarSimple::Layout(void) +void wxToolBarSimple::LayoutTools(void) { m_currentRowsOrColumns = 0; m_lastX = m_xMargin;