]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tbarmsw.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/tbarmsw.h
3 // Purpose: wxToolBar for older Windowses
4 // Author: Julian Smart
5 // Modified by: 13.12.99 by VZ during toolbar classes reorganization
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TBARMSW_H_
13 #define _WX_TBARMSW_H_
17 #include "wx/tbarbase.h"
19 extern WXDLLEXPORT_DATA(const wxChar
*) wxButtonBarNameStr
;
21 class WXDLLEXPORT wxMemoryDC
;
23 // ----------------------------------------------------------------------------
24 // wxToolBar for older Windowses
25 // ----------------------------------------------------------------------------
27 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
31 wxToolBar() { Init(); }
33 wxToolBar(wxWindow
*parent
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
38 const wxString
& name
= wxButtonBarNameStr
)
42 Create(parent
, id
, pos
, size
, style
, name
);
45 bool Create(wxWindow
*parent
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
50 const wxString
& name
= wxButtonBarNameStr
);
54 // implement/override base class (pure) virtuals
55 virtual wxToolBarToolBase
*AddTool(int id
,
56 const wxBitmap
& bitmap
,
57 const wxBitmap
& pushedBitmap
,
60 wxCoord yPos
= wxDefaultCoord
,
61 wxObject
*clientData
= NULL
,
62 const wxString
& helpString1
= wxEmptyString
,
63 const wxString
& helpString2
= wxEmptyString
);
65 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
67 virtual void SetToolBitmapSize(const wxSize
& size
);
68 virtual wxSize
GetToolSize() const;
70 virtual bool Realize();
72 // implementation only from now on
73 // -------------------------------
75 // Handle wxWidgets events
76 void OnPaint(wxPaintEvent
& event
);
77 void OnMouseEvent(wxMouseEvent
& event
);
82 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
83 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
84 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
85 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
86 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
88 virtual wxToolBarToolBase
*CreateTool(int id
,
89 const wxString
& label
,
90 const wxBitmap
& bmpNormal
,
91 const wxBitmap
& bmpDisabled
,
94 const wxString
& shortHelp
,
95 const wxString
& longHelp
);
96 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
98 void DoRedrawTool(wxToolBarToolBase
*tool
);
100 void DrawTool(wxDC
& dc
, wxToolBarToolBase
*tool
);
101 void DrawTool(wxDC
& dc
, wxToolBarToolBase
*tool
, int state
);
104 bool InitGlobalObjects();
105 void FreeGlobalObjects();
106 void PatB(WXHDC hdc
,int x
,int y
,int dx
,int dy
, long rgb
);
107 void CreateMask(WXHDC hDC
, int xoffset
, int yoffset
, int dx
, int dy
);
108 void DrawBlankButton(WXHDC hdc
, int x
, int y
, int dx
, int dy
, int state
);
109 void DrawButton(WXHDC hdc
, int x
, int y
, int dx
, int dy
,
110 wxToolBarToolBase
*tool
, int state
);
111 WXHBITMAP
CreateDitherBitmap();
112 bool CreateDitherBrush();
113 bool FreeDitherBrush();
114 WXHBITMAP
CreateMappedBitmap(WXHINSTANCE hInstance
, void *lpBitmapInfo
);
115 WXHBITMAP
CreateMappedBitmap(WXHINSTANCE hInstance
, WXHBITMAP hBitmap
);
117 int m_currentRowsOrColumns
;
118 int m_pressedTool
, m_currentTool
;
120 wxCoord m_xPos
, m_yPos
;
121 wxCoord m_lastX
, m_lastY
;
123 WXHBRUSH m_hbrDither
;
126 WXDWORD m_rgbHilight
;
130 // m_hdcMono is the DC that holds a mono bitmap, m_hbmMono
131 // that is used to create highlights
133 // m_hbmDefault hold the default bitmap if there is one.
137 WXHBITMAP m_hbmDefault
;
140 DECLARE_EVENT_TABLE()
141 DECLARE_DYNAMIC_CLASS(wxToolBar
)
144 #endif // wxUSE_TOOLBAR