]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/button.h
Changed generic wxScrolledWindow -> wxGenericScrolledWindow
[wxWidgets.git] / include / wx / msw / button.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: button.h
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
edccf428 9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_BUTTON_H_
13#define _WX_BUTTON_H_
2bda0e17
KB
14
15#ifdef __GNUG__
16#pragma interface "button.h"
17#endif
18
19#include "wx/control.h"
2bda0e17 20
32c1cda2 21WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
2bda0e17 22
edccf428 23// ----------------------------------------------------------------------------
2bda0e17 24// Pushbutton
edccf428
VZ
25// ----------------------------------------------------------------------------
26
bfc6fde4 27class WXDLLEXPORT wxButton : public wxControl
2bda0e17 28{
bfc6fde4
VZ
29DECLARE_DYNAMIC_CLASS(wxButton)
30
31public:
32 wxButton() { }
33 wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize, long style = 0,
36 const wxValidator& validator = wxDefaultValidator,
37 const wxString& name = wxButtonNameStr)
38 {
39 Create(parent, id, label, pos, size, style, validator, name);
40 }
41
42 bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize, long style = 0,
45 const wxValidator& validator = wxDefaultValidator,
46 const wxString& name = wxButtonNameStr);
47
edccf428
VZ
48 virtual ~wxButton();
49
bfc6fde4 50 virtual void SetDefault();
edccf428 51
e1f36ff8
VZ
52 static wxSize GetDefaultSize();
53
edccf428 54 // implementation from now on
bfc6fde4 55 virtual void Command(wxCommandEvent& event);
678cd6de 56 virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
bfc6fde4 57 virtual bool MSWCommand(WXUINT param, WXWORD id);
bfc6fde4 58
cd0b1709
VZ
59#ifdef __WIN32__
60 // coloured buttons support
61 virtual bool SetBackgroundColour(const wxColour &colour);
62 virtual bool SetForegroundColour(const wxColour &colour);
63
64 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
65
66private:
67 void MakeOwnerDrawn();
68#endif // __WIN32__
69
bfc6fde4 70protected:
edccf428
VZ
71 // send a notification event, return TRUE if processed
72 bool SendClickEvent();
73
f68586e5 74 virtual wxSize DoGetBestSize() const;
2bda0e17
KB
75};
76
77#endif
bbcdf8bc 78 // _WX_BUTTON_H_