]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1c383dba | 2 | // Name: wx/msw/tbar95.h |
2bda0e17 KB |
3 | // Purpose: wxToolBar95 (Windows 95 toolbar) class |
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__ | |
16 | #pragma interface "tbar95.h" | |
17 | #endif | |
18 | ||
d427503c | 19 | #if wxUSE_TOOLBAR |
2bda0e17 | 20 | |
bdc72a22 VZ |
21 | #include "wx/dynarray.h" |
22 | ||
1c383dba | 23 | #include "wx/tbarbase.h" |
2bda0e17 | 24 | |
1c383dba | 25 | class WXDLLEXPORT wxToolBar95 : public wxToolBarBase |
2bda0e17 | 26 | { |
1c383dba VZ |
27 | public: |
28 | wxToolBar95() { Init(); } | |
2bda0e17 | 29 | |
1c383dba VZ |
30 | wxToolBar95(wxWindow *parent, |
31 | wxWindowID id, | |
32 | const wxPoint& pos = wxDefaultPosition, | |
33 | const wxSize& size = wxDefaultSize, | |
34 | long style = wxNO_BORDER | wxTB_HORIZONTAL, | |
35 | const wxString& name = wxToolBarNameStr) | |
36 | { | |
37 | Init(); | |
2bda0e17 | 38 | |
1c383dba VZ |
39 | Create(parent, id, pos, size, style, name); |
40 | } | |
2bda0e17 | 41 | |
1c383dba | 42 | ~wxToolBar95(); |
2bda0e17 | 43 | |
1c383dba VZ |
44 | bool Create(wxWindow *parent, |
45 | wxWindowID id, | |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | long style = wxNO_BORDER | wxTB_HORIZONTAL, | |
49 | const wxString& name = wxToolBarNameStr); | |
2bda0e17 | 50 | |
1c383dba | 51 | // override base class virtuals |
2bda0e17 | 52 | |
1c383dba VZ |
53 | virtual wxToolBarTool *AddTool(int toolIndex, |
54 | const wxBitmap& bitmap, | |
55 | const wxBitmap& pushedBitmap = wxNullBitmap, | |
56 | bool toggle = FALSE, | |
57 | long xPos = -1, long yPos = -1, | |
58 | wxObject *clientData = NULL, | |
59 | const wxString& helpString1 = wxEmptyString, | |
60 | const wxString& helpString2 = wxEmptyString); | |
61 | virtual bool AddControl(wxControl *control); | |
2bda0e17 | 62 | |
bdc72a22 | 63 | virtual bool DeleteTool(int toolIndex); |
1c383dba | 64 | virtual void ClearTools(); |
2bda0e17 | 65 | |
1c383dba | 66 | virtual bool Realize() { return CreateTools(); }; |
2bda0e17 | 67 | |
1c383dba VZ |
68 | virtual void EnableTool(int toolIndex, bool enable); |
69 | virtual void ToggleTool(int toolIndex, bool toggle); | |
4fabb575 | 70 | |
1c383dba VZ |
71 | virtual void SetToolBitmapSize(const wxSize& size); |
72 | virtual wxSize GetToolSize() const; | |
73 | virtual wxSize GetMaxSize() const; | |
14b72bf5 | 74 | |
1c383dba | 75 | virtual bool GetToolState(int toolIndex) const; |
2bda0e17 | 76 | |
1c383dba VZ |
77 | virtual bool CreateTools(); |
78 | virtual void SetRows(int nRows); | |
81d66cf3 | 79 | |
1c383dba VZ |
80 | // IMPLEMENTATION |
81 | virtual bool MSWCommand(WXUINT param, WXWORD id); | |
82 | virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); | |
2bda0e17 | 83 | |
1c383dba VZ |
84 | void OnMouseEvent(wxMouseEvent& event); |
85 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
2bda0e17 KB |
86 | |
87 | protected: | |
1c383dba VZ |
88 | // common part of all ctors |
89 | void Init(); | |
90 | ||
bdc72a22 VZ |
91 | // the array storing the id for each index |
92 | wxArrayInt m_ids; | |
93 | ||
94 | // get index from id (returns wxNOT_FOUND if no such button) | |
95 | int GetIndexFromId(int id) const; | |
96 | ||
97 | // the big bitmap containing all bitmaps of the toolbar buttons | |
1c383dba | 98 | WXHBITMAP m_hBitmap; |
2bda0e17 | 99 | |
1c383dba | 100 | DECLARE_EVENT_TABLE() |
7c0ea335 VZ |
101 | }; |
102 | ||
103 | class WXDLLEXPORT wxToolBar : public wxToolBar95 | |
104 | { | |
105 | public: | |
106 | wxToolBar() { } | |
107 | ||
108 | wxToolBar(wxWindow *parent, | |
109 | wxWindowID id, | |
110 | const wxPoint& pos = wxDefaultPosition, | |
111 | const wxSize& size = wxDefaultSize, | |
112 | long style = wxNO_BORDER | wxTB_HORIZONTAL, | |
113 | const wxString& name = wxToolBarNameStr) | |
114 | : wxToolBar95(parent, id, pos, size, style, name) | |
115 | { | |
116 | } | |
117 | ||
118 | private: | |
119 | DECLARE_DYNAMIC_CLASS(wxToolBar) | |
2bda0e17 KB |
120 | }; |
121 | ||
d427503c VZ |
122 | #endif // wxUSE_TOOLBAR |
123 | ||
2bda0e17 | 124 | #endif |
bbcdf8bc | 125 | // _WX_TBAR95_H_ |