X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..1edddaf24ce2881e9f44c5d3a24c35a5fdda7c0d:/include/wx/msw/tbarmsw.h diff --git a/include/wx/msw/tbarmsw.h b/include/wx/msw/tbarmsw.h index 320a46a785..5ce62ea20d 100644 --- a/include/wx/msw/tbarmsw.h +++ b/include/wx/msw/tbarmsw.h @@ -5,22 +5,24 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __TBARMSWH__ -#define __TBARMSWH__ +#ifndef _WX_TBARMSW_H_ +#define _WX_TBARMSW_H_ #ifdef __GNUG__ #pragma interface "tbarmsw.h" #endif -#if USE_BUTTONBAR && USE_TOOLBAR +#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR #include "wx/tbarbase.h" WXDLLEXPORT_DATA(extern const char*) wxButtonBarNameStr; +class WXDLLEXPORT wxMemoryDC; + // Non-Win95 (WIN32, WIN16, UNIX) version class WXDLLEXPORT wxToolBarMSW: public wxToolBarBase @@ -32,23 +34,13 @@ public: */ wxToolBarMSW(void); -#if WXWIN_COMPATIBILITY > 0 - inline wxToolBarMSW(wxWindow *parent, int x, int y, int w, int h, - long style = wxNO_BORDER, int orientation = wxVERTICAL, int RowsOrColumns = 2, - const char *name = wxButtonBarNameStr) + 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, -1, wxPoint(x, y), wxSize(w, h), style, orientation, RowsOrColumns, name); + Create(parent, id, pos, size, style, name); } -#endif - inline wxToolBarMSW(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - const long style = wxNO_BORDER, const int orientation = wxVERTICAL, - const int RowsOrColumns = 2, const wxString& name = wxButtonBarNameStr) - { - Create(parent, id, pos, size, style, orientation, RowsOrColumns, name); - } - bool Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - const long style = wxNO_BORDER, const int orientation = wxVERTICAL, - const int RowsOrColumns = 2, const wxString& name = wxButtonBarNameStr); + 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); @@ -60,19 +52,24 @@ public: // 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(const int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap, - const bool toggle = FALSE, const long xPos = -1, const long yPos = -1, wxObject *clientData = NULL, - const wxString& helpString1 = "", const wxString& helpString2 = ""); + 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); - // New members // Set default bitmap size - virtual void SetDefaultSize(const wxSize& size); - void EnableTool(const int toolIndex, const bool enable); // additional drawing on enabling + 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 GetDefaultButtonSize(void) const; + wxSize GetToolSize(void) const; + + void Layout(void); + + // The post-tool-addition call + bool Realize() { Layout(); return TRUE; }; + protected: void DrawTool(wxDC& dc, wxToolBarTool *tool, int state); @@ -89,7 +86,9 @@ public: WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, void *lpBitmapInfo); WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap); - protected: +protected: + int m_currentRowsOrColumns; + long m_lastX, m_lastY; WXHBRUSH m_hbrDither; WXDWORD m_rgbFace; @@ -110,12 +109,6 @@ public: DECLARE_EVENT_TABLE() }; -#define DEFAULTBITMAPX 16 -#define DEFAULTBITMAPY 15 -#define DEFAULTBUTTONX 24 -#define DEFAULTBUTTONY 22 -#define DEFAULTBARHEIGHT 27 - // // States (not all of them currently used) // @@ -125,6 +118,6 @@ DECLARE_EVENT_TABLE() #define wxTBSTATE_HIDDEN 0x08 // button is hidden #define wxTBSTATE_INDETERMINATE 0x10 // button is indeterminate -#endif // USE_TOOL/BUTTONBAR +#endif // wxUSE_TOOL/BUTTONBAR #endif - // __TBARMSWH__ + // _WX_TBARMSW_H_