]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tbar95.h
wxTreeCtrl has colours and fonts too now
[wxWidgets.git] / include / wx / msw / tbar95.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/tbar95.h
3 // Purpose: wxToolBar95 (Windows 95 toolbar) class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TBAR95_H_
13 #define _WX_TBAR95_H_
14
15 #ifdef __GNUG__
16 #pragma interface "tbar95.h"
17 #endif
18
19 #if wxUSE_TOOLBAR
20
21 #include "wx/dynarray.h"
22
23 #include "wx/tbarbase.h"
24
25 class WXDLLEXPORT wxToolBar95 : public wxToolBarBase
26 {
27 public:
28 wxToolBar95() { Init(); }
29
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();
38
39 Create(parent, id, pos, size, style, name);
40 }
41
42 ~wxToolBar95();
43
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);
50
51 // override base class virtuals
52
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);
62
63 virtual bool DeleteTool(int toolIndex);
64 virtual void ClearTools();
65
66 virtual bool Realize() { return CreateTools(); };
67
68 virtual void EnableTool(int toolIndex, bool enable);
69 virtual void ToggleTool(int toolIndex, bool toggle);
70
71 virtual void SetToolBitmapSize(const wxSize& size);
72 virtual wxSize GetToolSize() const;
73 virtual wxSize GetMaxSize() const;
74
75 virtual bool GetToolState(int toolIndex) const;
76
77 virtual bool CreateTools();
78 virtual void SetRows(int nRows);
79
80 // IMPLEMENTATION
81 virtual bool MSWCommand(WXUINT param, WXWORD id);
82 virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
83
84 void OnMouseEvent(wxMouseEvent& event);
85 void OnSysColourChanged(wxSysColourChangedEvent& event);
86
87 protected:
88 // common part of all ctors
89 void Init();
90
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
98 WXHBITMAP m_hBitmap;
99
100 DECLARE_EVENT_TABLE()
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)
120 };
121
122 #endif // wxUSE_TOOLBAR
123
124 #endif
125 // _WX_TBAR95_H_