1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/button.h
3 // Purpose: wxButton class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSW_BUTTON_H_
12 #define _WX_MSW_BUTTON_H_
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 class WXDLLIMPEXP_CORE wxButton
: public wxButtonBase
21 wxButton() { Init(); }
22 wxButton(wxWindow
*parent
,
24 const wxString
& label
= wxEmptyString
,
25 const wxPoint
& pos
= wxDefaultPosition
,
26 const wxSize
& size
= wxDefaultSize
,
28 const wxValidator
& validator
= wxDefaultValidator
,
29 const wxString
& name
= wxButtonNameStr
)
33 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
36 bool Create(wxWindow
*parent
,
38 const wxString
& label
= wxEmptyString
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
42 const wxValidator
& validator
= wxDefaultValidator
,
43 const wxString
& name
= wxButtonNameStr
);
47 virtual wxWindow
*SetDefault();
49 // implementation from now on
50 virtual void Command(wxCommandEvent
& event
);
51 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
52 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
54 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
57 // send a notification event, return true if processed
58 bool SendClickEvent();
60 // default button handling
62 void UnsetTmpDefault();
64 // set or unset BS_DEFPUSHBUTTON style
65 static void SetDefaultStyle(wxButton
*btn
, bool on
);
67 virtual bool DoGetAuthNeeded() const;
68 virtual void DoSetAuthNeeded(bool show
);
70 // true if the UAC symbol is shown
79 void OnCharHook(wxKeyEvent
& event
);
81 wxDECLARE_EVENT_TABLE();
82 wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton
);
85 #endif // _WX_MSW_BUTTON_H_