]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tbarmsw.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBarMSW class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "tbarmsw.h"
19 #if USE_BUTTONBAR && USE_TOOLBAR
20 #include "wx/tbarbase.h"
22 WXDLLEXPORT_DATA(extern const char*) wxButtonBarNameStr
;
24 // Non-Win95 (WIN32, WIN16, UNIX) version
26 class WXDLLEXPORT wxToolBarMSW
: public wxToolBarBase
28 DECLARE_DYNAMIC_CLASS(wxToolBarMSW
)
35 #if WXWIN_COMPATIBILITY > 0
36 inline wxToolBarMSW(wxWindow
*parent
, int x
, int y
, int w
, int h
,
37 long style
= wxNO_BORDER
, int orientation
= wxVERTICAL
, int RowsOrColumns
= 2,
38 const char *name
= wxButtonBarNameStr
)
40 Create(parent
, -1, wxPoint(x
, y
), wxSize(w
, h
), style
, orientation
, RowsOrColumns
, name
);
43 inline wxToolBarMSW(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
44 long style
= wxNO_BORDER
, int orientation
= wxVERTICAL
,
45 int RowsOrColumns
= 2, const wxString
& name
= wxButtonBarNameStr
)
47 Create(parent
, id
, pos
, size
, style
, orientation
, RowsOrColumns
, name
);
49 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
50 long style
= wxNO_BORDER
, int orientation
= wxVERTICAL
,
51 int RowsOrColumns
= 2, const wxString
& name
= wxButtonBarNameStr
);
55 // Handle wxWindows events
56 void OnPaint(wxPaintEvent
& event
);
57 void OnSize(wxSizeEvent
& event
);
58 void OnMouseEvent(wxMouseEvent
& event
);
60 // If pushedBitmap is NULL, a reversed version of bitmap is
61 // created and used as the pushed/toggled image.
62 // If toggle is TRUE, the button toggles between the two states.
63 wxToolBarTool
*AddTool(int toolIndex
, const wxBitmap
& bitmap
, const wxBitmap
& pushedBitmap
= wxNullBitmap
,
64 bool toggle
= FALSE
, long xPos
= -1, long yPos
= -1, wxObject
*clientData
= NULL
,
65 const wxString
& helpString1
= "", const wxString
& helpString2
= "");
67 void DrawTool(wxDC
& dc
, wxMemoryDC
& memDc
, wxToolBarTool
*tool
);
70 // Set default bitmap size
71 virtual void SetDefaultSize(const wxSize
& size
);
72 void EnableTool(int toolIndex
, bool enable
); // additional drawing on enabling
74 // The button size is bigger than the bitmap size
75 wxSize
GetDefaultButtonSize(void) const;
77 void DrawTool(wxDC
& dc
, wxToolBarTool
*tool
, int state
);
79 void GetSysColors(void);
80 bool InitGlobalObjects(void);
81 void FreeGlobalObjects(void);
82 void PatB(WXHDC hdc
,int x
,int y
,int dx
,int dy
, long rgb
);
83 void CreateMask(WXHDC hDC
, int xoffset
, int yoffset
, int dx
, int dy
);
84 void DrawBlankButton(WXHDC hdc
, int x
, int y
, int dx
, int dy
, int state
);
85 void DrawButton(WXHDC hdc
, int x
, int y
, int dx
, int dy
, wxToolBarTool
*tool
, int state
);
86 WXHBITMAP
CreateDitherBitmap();
87 bool CreateDitherBrush(void);
88 bool FreeDitherBrush(void);
89 WXHBITMAP
CreateMappedBitmap(WXHINSTANCE hInstance
, void *lpBitmapInfo
);
90 WXHBITMAP
CreateMappedBitmap(WXHINSTANCE hInstance
, WXHBITMAP hBitmap
);
101 // m_hdcMono is the DC that holds a mono bitmap, m_hbmMono
102 // that is used to create highlights
104 // m_hbmDefault hold the default bitmap if there is one.
108 WXHBITMAP m_hbmDefault
;
110 DECLARE_EVENT_TABLE()
113 #define DEFAULTBITMAPX 16
114 #define DEFAULTBITMAPY 15
115 #define DEFAULTBUTTONX 24
116 #define DEFAULTBUTTONY 22
117 #define DEFAULTBARHEIGHT 27
120 // States (not all of them currently used)
122 #define wxTBSTATE_CHECKED 0x01 // radio button is checked
123 #define wxTBSTATE_PRESSED 0x02 // button is being depressed (any style)
124 #define wxTBSTATE_ENABLED 0x04 // button is enabled
125 #define wxTBSTATE_HIDDEN 0x08 // button is hidden
126 #define wxTBSTATE_INDETERMINATE 0x10 // button is indeterminate
128 #endif // USE_TOOL/BUTTONBAR