]>
Commit | Line | Data |
---|---|---|
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 | 19 | class WXDLLIMPEXP_CORE wxButton : public wxButtonBase |
2bda0e17 | 20 | { |
bfc6fde4 | 21 | public: |
233f10bf | 22 | wxButton() { m_imageData = NULL; } |
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 | { |
233f10bf VZ |
32 | m_imageData = NULL; |
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 | 49 | |
d94de683 VZ |
50 | // overridden base class methods |
51 | virtual void SetLabel(const wxString& label); | |
52 | virtual bool SetBackgroundColour(const wxColour &colour); | |
53 | virtual bool SetForegroundColour(const wxColour &colour); | |
54 | ||
edccf428 | 55 | // implementation from now on |
bfc6fde4 | 56 | virtual void Command(wxCommandEvent& event); |
c140b7e7 | 57 | virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); |
bfc6fde4 | 58 | virtual bool MSWCommand(WXUINT param, WXWORD id); |
bfc6fde4 | 59 | |
cd0b1709 | 60 | virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); |
6f02a879 | 61 | virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; |
cd0b1709 | 62 | |
a047aff2 JS |
63 | // returns true if the platform should explicitly apply a theme border |
64 | virtual bool CanApplyThemeBorder() const { return false; } | |
65 | ||
cd0b1709 VZ |
66 | private: |
67 | void MakeOwnerDrawn(); | |
cd0b1709 | 68 | |
bfc6fde4 | 69 | protected: |
fcf90ee1 | 70 | // send a notification event, return true if processed |
edccf428 VZ |
71 | bool SendClickEvent(); |
72 | ||
036da5e3 VZ |
73 | // default button handling |
74 | void SetTmpDefault(); | |
75 | void UnsetTmpDefault(); | |
76 | ||
7fb1b2b4 VZ |
77 | // set or unset BS_DEFPUSHBUTTON style |
78 | static void SetDefaultStyle(wxButton *btn, bool on); | |
036da5e3 | 79 | |
5b2f31eb | 80 | // usually overridden base class virtuals |
f68586e5 | 81 | virtual wxSize DoGetBestSize() const; |
1e6feb95 | 82 | |
233f10bf VZ |
83 | virtual wxBitmap DoGetBitmap(State which) const; |
84 | virtual void DoSetBitmap(const wxBitmap& bitmap, State which); | |
a6fd73d3 | 85 | virtual wxSize DoGetBitmapMargins() const; |
233f10bf VZ |
86 | virtual void DoSetBitmapMargins(wxCoord x, wxCoord y); |
87 | virtual void DoSetBitmapPosition(wxDirection dir); | |
88 | ||
89 | class wxButtonImageData *m_imageData; | |
90 | ||
1e6feb95 | 91 | private: |
fc7a2a60 | 92 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton) |
2bda0e17 KB |
93 | }; |
94 | ||
d94de683 | 95 | #endif // _WX_BUTTON_H_ |