- /*
- * Public interface
- */
- wxToolBarMSW(void);
-
- inline wxToolBarMSW(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER|wxTB_HORIZONTAL, const wxString& name = wxButtonBarNameStr)
- {
- Create(parent, id, pos, size, style, name);
- }
- bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxNO_BORDER|wxTB_HORIZONTAL, const wxString& name = wxButtonBarNameStr);
-
- ~wxToolBarMSW(void);
-
- // Handle wxWindows events
- void OnPaint(wxPaintEvent& event);
- void OnSize(wxSizeEvent& event);
- void OnMouseEvent(wxMouseEvent& event);
-
- // If pushedBitmap is NULL, a reversed version of bitmap is
- // created and used as the pushed/toggled image.
- // If toggle is TRUE, the button toggles between the two states.
- wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
- bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
- const wxString& helpString1 = wxEmptyString, const wxString& helpString2 = wxEmptyString);
-
- void DrawTool(wxDC& dc, wxMemoryDC& memDc, wxToolBarTool *tool);
-
- // Set default bitmap size
- virtual void SetToolBitmapSize(const wxSize& size);
- void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
-
- // The button size is bigger than the bitmap size
- wxSize GetToolSize(void) const;
-
- void LayoutTools();
-
- // The post-tool-addition call
- bool Realize() { Layout(); return TRUE; };
-
- protected:
- void DrawTool(wxDC& dc, wxToolBarTool *tool, int state);
-
- void GetSysColors(void);
- bool InitGlobalObjects(void);
- void FreeGlobalObjects(void);
- void PatB(WXHDC hdc,int x,int y,int dx,int dy, long rgb);
- void CreateMask(WXHDC hDC, int xoffset, int yoffset, int dx, int dy);
- void DrawBlankButton(WXHDC hdc, int x, int y, int dx, int dy, int state);
- void DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBarTool *tool, int state);
- WXHBITMAP CreateDitherBitmap();
- bool CreateDitherBrush(void);
- bool FreeDitherBrush(void);
- WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, void *lpBitmapInfo);
- WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap);
+ // construction
+ wxToolBar() { Init(); }
+
+ wxToolBar(wxWindow *parent,
+ wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxNO_BORDER|wxTB_HORIZONTAL,
+ const wxString& name = wxButtonBarNameStr)
+ {
+ Init();
+
+ Create(parent, id, pos, size, style, name);
+ }
+
+ bool Create(wxWindow *parent,
+ wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxNO_BORDER|wxTB_HORIZONTAL,
+ const wxString& name = wxButtonBarNameStr);
+
+ ~wxToolBar();
+
+ // implement/override base class (pure) virtuals
+ virtual wxToolBarToolBase *AddTool(int id,
+ const wxBitmap& bitmap,
+ const wxBitmap& pushedBitmap,
+ bool toggle,
+ wxCoord xPos,
+ wxCoord yPos = wxDefaultCoord,
+ wxObject *clientData = NULL,
+ const wxString& helpString1 = wxEmptyString,
+ const wxString& helpString2 = wxEmptyString);
+
+ virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
+
+ virtual void SetToolBitmapSize(const wxSize& size);
+ virtual wxSize GetToolSize() const;
+
+ virtual bool Realize();
+
+ // implementation only from now on
+ // -------------------------------
+
+ // Handle wxWidgets events
+ void OnPaint(wxPaintEvent& event);
+ void OnMouseEvent(wxMouseEvent& event);