]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/button.h
add an assert indicating that old code overriding OnExecute() must be updated with 2.9
[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
bbcdf8bc
JS
12#ifndef _WX_BUTTON_H_
13#define _WX_BUTTON_H_
2bda0e17 14
edccf428 15// ----------------------------------------------------------------------------
2bda0e17 16// Pushbutton
edccf428
VZ
17// ----------------------------------------------------------------------------
18
53a2db12 19class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
2bda0e17 20{
bfc6fde4
VZ
21public:
22 wxButton() { }
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
VZ
31 {
32 Create(parent, id, label, pos, size, style, validator, name);
33 }
fcf90ee1 34
1e6feb95
VZ
35 bool Create(wxWindow *parent,
36 wxWindowID id,
5f7bcb48 37 const wxString& label = wxEmptyString,
1e6feb95
VZ
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = 0,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxButtonNameStr);
bfc6fde4 43
edccf428
VZ
44 virtual ~wxButton();
45
94aff5ff 46 virtual wxWindow *SetDefault();
edccf428 47
d94de683
VZ
48 // overridden base class methods
49 virtual void SetLabel(const wxString& label);
50 virtual bool SetBackgroundColour(const wxColour &colour);
51 virtual bool SetForegroundColour(const wxColour &colour);
52
edccf428 53 // implementation from now on
bfc6fde4 54 virtual void Command(wxCommandEvent& event);
c140b7e7 55 virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
bfc6fde4 56 virtual bool MSWCommand(WXUINT param, WXWORD id);
bfc6fde4 57
cd0b1709 58 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
6f02a879 59 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
cd0b1709 60
a047aff2
JS
61 // returns true if the platform should explicitly apply a theme border
62 virtual bool CanApplyThemeBorder() const { return false; }
63
cd0b1709
VZ
64private:
65 void MakeOwnerDrawn();
cd0b1709 66
bfc6fde4 67protected:
fcf90ee1 68 // send a notification event, return true if processed
edccf428
VZ
69 bool SendClickEvent();
70
036da5e3
VZ
71 // default button handling
72 void SetTmpDefault();
73 void UnsetTmpDefault();
74
7fb1b2b4
VZ
75 // set or unset BS_DEFPUSHBUTTON style
76 static void SetDefaultStyle(wxButton *btn, bool on);
036da5e3 77
5b2f31eb 78 // usually overridden base class virtuals
f68586e5 79 virtual wxSize DoGetBestSize() const;
1e6feb95
VZ
80
81private:
fc7a2a60 82 DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton)
2bda0e17
KB
83};
84
d94de683 85#endif // _WX_BUTTON_H_