]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tbar95.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar95 (Windows 95 toolbar) class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "tbar95.h"
19 #if wxUSE_BUTTONBAR && wxUSE_TOOLBAR
20 #include "wx/tbarbase.h"
22 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
24 class WXDLLEXPORT wxToolBar95
: public wxToolBarBase
26 DECLARE_DYNAMIC_CLASS(wxToolBar95
)
34 inline wxToolBar95(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
35 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
36 const wxString
& name
= wxToolBarNameStr
)
38 Create(parent
, id
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
43 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
44 const wxString
& name
= wxToolBarNameStr
);
46 // Call default behaviour
48 void OnPaint(wxPaintEvent& event) { Default() ; }
49 void OnSize(wxSizeEvent& event) { Default() ; }
50 void OnKillFocus(wxFocusEvent& event) { Default() ; }
52 void OnMouseEvent(wxMouseEvent
& event
);
54 // Handle wxToolBar95 events
56 // If pushedBitmap is NULL, a reversed version of bitmap is
57 // created and used as the pushed/toggled image.
58 // If toggle is TRUE, the button toggles between the two states.
59 wxToolBarTool
*AddTool(int toolIndex
, const wxBitmap
& bitmap
, const wxBitmap
& pushedBitmap
= wxNullBitmap
,
60 bool toggle
= FALSE
, long xPos
= -1, long yPos
= -1, wxObject
*clientData
= NULL
,
61 const wxString
& helpString1
= "", const wxString
& helpString2
= "");
63 // Set default bitmap size
64 void SetToolBitmapSize(const wxSize
& size
);
65 void EnableTool(int toolIndex
, bool enable
); // additional drawing on enabling
66 void ToggleTool(int toolIndex
, bool toggle
); // toggle is TRUE if toggled on
67 void ClearTools(void);
69 // The button size is bigger than the bitmap size
70 wxSize
GetToolSize(void) const;
72 wxSize
GetMaxSize(void) const;
74 void GetSize(int *w
, int *y
) const;
75 wxSize
GetSize() const { return wxWindow::GetSize(); }
77 virtual bool GetToolState(int toolIndex
) const;
79 // Add all the buttons: required for Win95.
80 virtual bool CreateTools(void);
81 virtual void SetRows(int nRows
);
82 virtual void Layout(void) {}
84 // The post-tool-addition call
85 bool Realize() { return CreateTools(); };
88 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
89 virtual bool MSWNotify(WXWPARAM wParam
, WXLPARAM lParam
, WXLPARAM
*result
);
91 // Responds to colour changes
92 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
100 #endif // wxUSE_TOOL/BUTTONBAR