]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1c383dba | 2 | // Name: wx/msw/tbar95.h |
8a0681f9 | 3 | // Purpose: wxToolBar (Windows 95 toolbar) class |
2bda0e17 KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
d427503c | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_TBAR95_H_ |
13 | #define _WX_TBAR95_H_ | |
2bda0e17 KB |
14 | |
15 | #ifdef __GNUG__ | |
8a0681f9 | 16 | #pragma interface "tbar95.h" |
2bda0e17 KB |
17 | #endif |
18 | ||
d427503c | 19 | #if wxUSE_TOOLBAR |
2bda0e17 | 20 | |
bdc72a22 VZ |
21 | #include "wx/dynarray.h" |
22 | ||
8a0681f9 | 23 | class WXDLLEXPORT wxToolBar : public wxToolBarBase |
2bda0e17 | 24 | { |
1c383dba | 25 | public: |
8a0681f9 VZ |
26 | // ctors and dtor |
27 | wxToolBar() { Init(); } | |
2bda0e17 | 28 | |
8a0681f9 | 29 | wxToolBar(wxWindow *parent, |
1c383dba VZ |
30 | wxWindowID id, |
31 | const wxPoint& pos = wxDefaultPosition, | |
32 | const wxSize& size = wxDefaultSize, | |
33 | long style = wxNO_BORDER | wxTB_HORIZONTAL, | |
34 | const wxString& name = wxToolBarNameStr) | |
35 | { | |
36 | Init(); | |
2bda0e17 | 37 | |
1c383dba VZ |
38 | Create(parent, id, pos, size, style, name); |
39 | } | |
2bda0e17 | 40 | |
1c383dba VZ |
41 | bool Create(wxWindow *parent, |
42 | wxWindowID id, | |
43 | const wxPoint& pos = wxDefaultPosition, | |
44 | const wxSize& size = wxDefaultSize, | |
45 | long style = wxNO_BORDER | wxTB_HORIZONTAL, | |
46 | const wxString& name = wxToolBarNameStr); | |
2bda0e17 | 47 | |
8a0681f9 | 48 | virtual ~wxToolBar(); |
2bda0e17 | 49 | |
8a0681f9 VZ |
50 | // override/implement base class virtuals |
51 | virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; | |
2bda0e17 | 52 | |
8a0681f9 | 53 | virtual bool Realize(); |
4fabb575 | 54 | |
1c383dba VZ |
55 | virtual void SetToolBitmapSize(const wxSize& size); |
56 | virtual wxSize GetToolSize() const; | |
14b72bf5 | 57 | |
1c383dba | 58 | virtual void SetRows(int nRows); |
81d66cf3 | 59 | |
8a0681f9 VZ |
60 | // implementation only from now on |
61 | // ------------------------------- | |
62 | ||
1c383dba VZ |
63 | virtual bool MSWCommand(WXUINT param, WXWORD id); |
64 | virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); | |
2bda0e17 | 65 | |
1c383dba VZ |
66 | void OnMouseEvent(wxMouseEvent& event); |
67 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
2bda0e17 KB |
68 | |
69 | protected: | |
1c383dba VZ |
70 | // common part of all ctors |
71 | void Init(); | |
72 | ||
8a0681f9 VZ |
73 | // implement base class pure virtuals |
74 | virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); | |
75 | virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); | |
bdc72a22 | 76 | |
8a0681f9 VZ |
77 | virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); |
78 | virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); | |
79 | virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); | |
bdc72a22 | 80 | |
8a0681f9 VZ |
81 | virtual wxToolBarToolBase *CreateTool(int id, |
82 | const wxBitmap& bitmap1, | |
83 | const wxBitmap& bitmap2, | |
84 | bool toggle, | |
85 | wxObject *clientData, | |
86 | const wxString& shortHelpString, | |
87 | const wxString& longHelpString); | |
88 | virtual wxToolBarToolBase *CreateTool(wxControl *control); | |
2bda0e17 | 89 | |
8a0681f9 VZ |
90 | // should be called whenever the toolbar size changes |
91 | void UpdateSize(); | |
7c0ea335 | 92 | |
8a0681f9 VZ |
93 | // override WndProc to process WM_SIZE |
94 | virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
7c0ea335 | 95 | |
8a0681f9 VZ |
96 | // the big bitmap containing all bitmaps of the toolbar buttons |
97 | WXHBITMAP m_hBitmap; | |
98 | ||
99 | // the total number of toolbar elements | |
100 | size_t m_nButtons; | |
7c0ea335 VZ |
101 | |
102 | private: | |
8a0681f9 | 103 | DECLARE_EVENT_TABLE() |
7c0ea335 | 104 | DECLARE_DYNAMIC_CLASS(wxToolBar) |
5e68f8f3 JS |
105 | |
106 | static bool sm_coloursInit; // Have we initialized the colour table yet? | |
107 | static long sm_stdColours[6]; // The RGB values of the standard 6 colours | |
108 | ||
109 | public: | |
110 | void MapBitmap(WXHBITMAP bitmap, int width, int height); | |
111 | ||
2bda0e17 KB |
112 | }; |
113 | ||
d427503c VZ |
114 | #endif // wxUSE_TOOLBAR |
115 | ||
2bda0e17 | 116 | #endif |
bbcdf8bc | 117 | // _WX_TBAR95_H_ |