]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/radiobut.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / msw / radiobut.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/msw/radiobut.h
3// Purpose: wxRadioButton class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// Copyright: (c) Julian Smart
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_RADIOBUT_H_
12#define _WX_RADIOBUT_H_
13
14class WXDLLIMPEXP_CORE wxRadioButton: public wxControl
15{
16public:
17 // ctors and creation functions
18 wxRadioButton() { Init(); }
19
20 wxRadioButton(wxWindow *parent,
21 wxWindowID id,
22 const wxString& label,
23 const wxPoint& pos = wxDefaultPosition,
24 const wxSize& size = wxDefaultSize,
25 long style = 0,
26 const wxValidator& validator = wxDefaultValidator,
27 const wxString& name = wxRadioButtonNameStr)
28 {
29 Init();
30
31 Create(parent, id, label, pos, size, style, validator, name);
32 }
33
34 bool Create(wxWindow *parent,
35 wxWindowID id,
36 const wxString& label,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 long style = 0,
40 const wxValidator& validator = wxDefaultValidator,
41 const wxString& name = wxRadioButtonNameStr);
42
43 // implement the radio button interface
44 virtual void SetValue(bool value);
45 virtual bool GetValue() const;
46
47 // implementation only from now on
48 virtual bool MSWCommand(WXUINT param, WXWORD id);
49 virtual void Command(wxCommandEvent& event);
50 virtual bool HasTransparentBackground() { return true; }
51
52 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
53
54protected:
55 virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
56 virtual wxSize DoGetBestSize() const;
57
58private:
59 // common part of all ctors
60 void Init();
61
62 // we need to store the state internally as the result of GetValue()
63 // sometimes gets out of sync in WM_COMMAND handler
64 bool m_isChecked;
65
66 DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton)
67};
68
69#endif
70 // _WX_RADIOBUT_H_