]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/button.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / msw / button.h
CommitLineData
2bda0e17 1/////////////////////////////////////////////////////////////////////////////
1e6feb95 2// Name: wx/msw/button.h
2bda0e17
KB
3// Purpose: wxButton class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
bbcdf8bc 7// Copyright: (c) Julian Smart
65571936 8// Licence: wxWindows licence
2bda0e17
KB
9/////////////////////////////////////////////////////////////////////////////
10
b4354db1
VZ
11#ifndef _WX_MSW_BUTTON_H_
12#define _WX_MSW_BUTTON_H_
2bda0e17 13
edccf428 14// ----------------------------------------------------------------------------
2bda0e17 15// Pushbutton
edccf428
VZ
16// ----------------------------------------------------------------------------
17
53a2db12 18class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
2bda0e17 19{
bfc6fde4 20public:
6af59fe7 21 wxButton() { Init(); }
1e6feb95
VZ
22 wxButton(wxWindow *parent,
23 wxWindowID id,
5f7bcb48 24 const wxString& label = wxEmptyString,
1e6feb95
VZ
25 const wxPoint& pos = wxDefaultPosition,
26 const wxSize& size = wxDefaultSize,
27 long style = 0,
28 const wxValidator& validator = wxDefaultValidator,
29 const wxString& name = wxButtonNameStr)
bfc6fde4 30 {
6af59fe7 31 Init();
233f10bf 32
bfc6fde4
VZ
33 Create(parent, id, label, pos, size, style, validator, name);
34 }
fcf90ee1 35
1e6feb95
VZ
36 bool Create(wxWindow *parent,
37 wxWindowID id,
5f7bcb48 38 const wxString& label = wxEmptyString,
1e6feb95
VZ
39 const wxPoint& pos = wxDefaultPosition,
40 const wxSize& size = wxDefaultSize,
41 long style = 0,
42 const wxValidator& validator = wxDefaultValidator,
43 const wxString& name = wxButtonNameStr);
bfc6fde4 44
edccf428
VZ
45 virtual ~wxButton();
46
94aff5ff 47 virtual wxWindow *SetDefault();
edccf428
VZ
48
49 // implementation from now on
bfc6fde4 50 virtual void Command(wxCommandEvent& event);
c140b7e7 51 virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
bfc6fde4 52 virtual bool MSWCommand(WXUINT param, WXWORD id);
bfc6fde4 53
6f02a879 54 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
cd0b1709 55
bfc6fde4 56protected:
fcf90ee1 57 // send a notification event, return true if processed
edccf428
VZ
58 bool SendClickEvent();
59
036da5e3
VZ
60 // default button handling
61 void SetTmpDefault();
62 void UnsetTmpDefault();
63
7fb1b2b4
VZ
64 // set or unset BS_DEFPUSHBUTTON style
65 static void SetDefaultStyle(wxButton *btn, bool on);
036da5e3 66
f2d7fdf7
VZ
67 virtual bool DoGetAuthNeeded() const;
68 virtual void DoSetAuthNeeded(bool show);
95912bdd 69
f2d7fdf7
VZ
70 // true if the UAC symbol is shown
71 bool m_authNeeded;
72
1e6feb95 73private:
6af59fe7
VZ
74 void Init()
75 {
98977bf4 76 m_authNeeded = false;
6af59fe7
VZ
77 }
78
4cf1a9bf
VZ
79 void OnCharHook(wxKeyEvent& event);
80
81 wxDECLARE_EVENT_TABLE();
3571e1ad 82 wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxButton);
2bda0e17
KB
83};
84
b4354db1 85#endif // _WX_MSW_BUTTON_H_