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