]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/radiobox.h
Move unused values into 2.4 compatibility. Source cleaning.
[wxWidgets.git] / include / wx / msw / radiobox.h
CommitLineData
2bda0e17 1/////////////////////////////////////////////////////////////////////////////
1e6feb95 2// Name: wx/msw/radiobox.h
2bda0e17
KB
3// Purpose: wxRadioBox 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_RADIOBOX_H_
13#define _WX_RADIOBOX_H_
2bda0e17 14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
c49245f8 16 #pragma interface "radiobox.h"
2bda0e17
KB
17#endif
18
bd0a76e2
VZ
19#include "wx/statbox.h"
20
21class WXDLLEXPORT wxSubwindows;
2bda0e17 22
1e6feb95
VZ
23// ----------------------------------------------------------------------------
24// wxRadioBox
25// ----------------------------------------------------------------------------
bfc6fde4 26
bd0a76e2 27class WXDLLEXPORT wxRadioBox : public wxStaticBox, public wxRadioBoxBase
1e6feb95 28{
2bda0e17 29public:
bd0a76e2 30 wxRadioBox() { Init(); }
2bda0e17 31
1e6feb95
VZ
32 wxRadioBox(wxWindow *parent,
33 wxWindowID id,
34 const wxString& title,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 int n = 0, const wxString choices[] = NULL,
38 int majorDim = 0,
39 long style = wxRA_HORIZONTAL,
40 const wxValidator& val = wxDefaultValidator,
6463b9f5
JS
41 const wxString& name = wxRadioBoxNameStr)
42 {
bd0a76e2
VZ
43 Init();
44
6463b9f5
JS
45 (void)Create(parent, id, title, pos, size, n, choices, majorDim,
46 style, val, name);
47 }
bd0a76e2 48
584ad2a3
MB
49 wxRadioBox(wxWindow *parent,
50 wxWindowID id,
51 const wxString& title,
52 const wxPoint& pos,
53 const wxSize& size,
54 const wxArrayString& choices,
55 int majorDim = 0,
56 long style = wxRA_HORIZONTAL,
57 const wxValidator& val = wxDefaultValidator,
58 const wxString& name = wxRadioBoxNameStr)
59 {
bd0a76e2
VZ
60 Init();
61
584ad2a3
MB
62 (void)Create(parent, id, title, pos, size, choices, majorDim,
63 style, val, name);
64 }
bfc6fde4 65
bfc6fde4
VZ
66 ~wxRadioBox();
67
1e6feb95
VZ
68 bool Create(wxWindow *parent,
69 wxWindowID id,
70 const wxString& title,
71 const wxPoint& pos = wxDefaultPosition,
72 const wxSize& size = wxDefaultSize,
73 int n = 0, const wxString choices[] = NULL,
74 int majorDim = 0,
75 long style = wxRA_HORIZONTAL,
76 const wxValidator& val = wxDefaultValidator,
77 const wxString& name = wxRadioBoxNameStr);
584ad2a3
MB
78 bool Create(wxWindow *parent,
79 wxWindowID id,
80 const wxString& title,
81 const wxPoint& pos,
82 const wxSize& size,
83 const wxArrayString& choices,
84 int majorDim = 0,
85 long style = wxRA_HORIZONTAL,
86 const wxValidator& val = wxDefaultValidator,
87 const wxString& name = wxRadioBoxNameStr);
1e6feb95
VZ
88
89 // implement the radiobox interface
90 virtual void SetSelection(int n);
bd0a76e2 91 virtual int GetSelection() const { return m_selectedButton; }
1e6feb95
VZ
92 virtual int GetCount() const;
93 virtual wxString GetString(int n) const;
94 virtual void SetString(int n, const wxString& label);
4d08943e
WS
95 virtual void Enable(int n, bool enable = true);
96 virtual void Show(int n, bool show = true);
bd0a76e2
VZ
97 virtual int GetColumnCount() const { return GetNumHor(); }
98 virtual int GetRowCount() const { return GetNumVer(); }
bfc6fde4 99
bd0a76e2 100 // override some base class methods
4d08943e 101 virtual bool Show(bool show = true);
4d08943e 102 virtual bool Enable(bool enable = true);
bd0a76e2
VZ
103 virtual void SetFocus();
104 virtual bool SetFont(const wxFont& font);
105 virtual bool ContainsHWND(WXHWND hWnd) const;
106
6fb99eb3 107 void SetLabelFont(const wxFont& WXUNUSED(font)) {}
bfc6fde4
VZ
108 void SetButtonFont(const wxFont& font) { SetFont(font); }
109
bfc6fde4 110
c49245f8
VZ
111 // implementation only from now on
112 // -------------------------------
113
1e6feb95 114 virtual bool MSWCommand(WXUINT param, WXWORD id);
bd0a76e2 115 void Command(wxCommandEvent& event);
1e6feb95 116
9a5ccab4 117 void SendNotificationEvent();
bfc6fde4 118
e373f51b 119 // get the number of buttons per column/row
c49245f8
VZ
120 int GetNumVer() const;
121 int GetNumHor() const;
122
2bda0e17 123protected:
bd0a76e2
VZ
124 // common part of all ctors
125 void Init();
126
7a5a5718
RD
127 // we can't compute our best size before the items are added to the control
128 virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) { }
129
3ca6a5f0 130 // subclass one radio button
e373f51b
VZ
131 void SubclassRadioButton(WXHWND hWndBtn);
132
3ca6a5f0
BP
133 // get the max size of radio buttons
134 wxSize GetMaxButtonSize() const;
135
136 // get the total size occupied by the radio box buttons
137 wxSize GetTotalButtonSize(const wxSize& sizeBtn) const;
138
bfc6fde4
VZ
139 virtual void DoSetSize(int x, int y,
140 int width, int height,
141 int sizeFlags = wxSIZE_AUTO);
3ca6a5f0 142 virtual wxSize DoGetBestSize() const;
1e6feb95 143
bd0a76e2
VZ
144
145 // the buttons we contain
146 wxSubwindows *m_radioButtons;
147
148 // array of widths and heights of the buttons, may be wxDefaultCoord if the
149 // corresponding quantity should be computed
150 int *m_radioWidth;
151 int *m_radioHeight;
152
153 // the number of elements in major dimension (i.e. number of columns if
154 // wxRA_SPECIFY_COLS or the number of rows if wxRA_SPECIFY_ROWS)
155 int m_majorDim;
156
157 // currently selected button or wxNOT_FOUND if none
158 int m_selectedButton;
159
1e6feb95
VZ
160private:
161 DECLARE_DYNAMIC_CLASS(wxRadioBox)
22f3361e 162 DECLARE_NO_COPY_CLASS(wxRadioBox)
2bda0e17
KB
163};
164
165#endif
bbcdf8bc 166 // _WX_RADIOBOX_H_