]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/button.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/button.h
3 // Purpose: wxButton class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "button.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class WXDLLEXPORT wxButton
: public wxButtonBase
27 wxButton(wxWindow
*parent
,
29 const wxString
& label
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
33 const wxValidator
& validator
= wxDefaultValidator
,
34 const wxString
& name
= wxButtonNameStr
)
36 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
39 bool Create(wxWindow
*parent
,
41 const wxString
& label
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
45 const wxValidator
& validator
= wxDefaultValidator
,
46 const wxString
& name
= wxButtonNameStr
);
50 virtual void SetDefault();
52 // implementation from now on
53 virtual void Command(wxCommandEvent
& event
);
54 virtual long MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
55 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
58 // coloured buttons support
59 virtual bool SetBackgroundColour(const wxColour
&colour
);
60 virtual bool SetForegroundColour(const wxColour
&colour
);
62 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT
*item
);
65 void MakeOwnerDrawn();
69 // send a notification event, return TRUE if processed
70 bool SendClickEvent();
72 // default button handling
74 void UnsetTmpDefault();
76 // set or unset BS_DEFPUSHBUTTON style
77 static void SetDefaultStyle(wxButton
*btn
, bool on
);
79 // usually overridden base class virtuals
80 virtual wxSize
DoGetBestSize() const;
81 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
84 DECLARE_DYNAMIC_CLASS(wxButton
)