]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/button.h
added Get/SetItemToolTip() (and implemented them for MSW) to allow setting tooltips...
[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
1e6feb95 19class WXDLLEXPORT 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
bfc6fde4 46 virtual void SetDefault();
edccf428
VZ
47
48 // implementation from now on
bfc6fde4 49 virtual void Command(wxCommandEvent& event);
c140b7e7 50 virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
bfc6fde4 51 virtual bool MSWCommand(WXUINT param, WXWORD id);
bfc6fde4 52
cd0b1709
VZ
53 // coloured buttons support
54 virtual bool SetBackgroundColour(const wxColour &colour);
55 virtual bool SetForegroundColour(const wxColour &colour);
56
57 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
6f02a879 58 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
cd0b1709
VZ
59
60private:
61 void MakeOwnerDrawn();
cd0b1709 62
bfc6fde4 63protected:
fcf90ee1 64 // send a notification event, return true if processed
edccf428
VZ
65 bool SendClickEvent();
66
036da5e3
VZ
67 // default button handling
68 void SetTmpDefault();
69 void UnsetTmpDefault();
70
7fb1b2b4
VZ
71 // set or unset BS_DEFPUSHBUTTON style
72 static void SetDefaultStyle(wxButton *btn, bool on);
036da5e3 73
5b2f31eb 74 // usually overridden base class virtuals
f68586e5 75 virtual wxSize DoGetBestSize() const;
1e6feb95
VZ
76
77private:
fc7a2a60 78 DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton)
2bda0e17
KB
79};
80
81#endif
bbcdf8bc 82 // _WX_BUTTON_H_