]> git.saurik.com Git - wxWidgets.git/blame - include/wx/palmos/radiobox.h
Compilation fixes for old SDKs (VC6) after recent commit.
[wxWidgets.git] / include / wx / palmos / radiobox.h
CommitLineData
ffecfa5a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/palmos/radiobox.h
3// Purpose: wxRadioBox class
e1d63b79 4// Author: William Osborne - minimal working wxPalmOS port
a152561c 5// Modified by: Wlodzimierz ABX Skiba - native wxRadioBox implementation
ffecfa5a 6// Created: 10/13/04
e1d63b79 7// RCS-ID: $Id$
a152561c 8// Copyright: (c) William Osborne, Wlodzimierz Skiba
ffecfa5a
JS
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_RADIOBOX_H_
13#define _WX_RADIOBOX_H_
14
b5dbe15d
VS
15class WXDLLIMPEXP_FWD_CORE wxBitmap;
16class WXDLLIMPEXP_FWD_CORE wxRadioButton;
ffecfa5a
JS
17
18// ----------------------------------------------------------------------------
19// wxRadioBox
20// ----------------------------------------------------------------------------
21
53a2db12 22class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, public wxRadioBoxBase
ffecfa5a
JS
23{
24public:
1a87edf2
WS
25 wxRadioBox():m_radios(wxKEY_INTEGER,32)
26 {
27 Init();
28 }
ffecfa5a
JS
29
30 wxRadioBox(wxWindow *parent,
31 wxWindowID id,
32 const wxString& title,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize,
35 int n = 0, const wxString choices[] = NULL,
36 int majorDim = 0,
8be10866 37 long style = wxRA_SPECIFY_COLS,
ffecfa5a
JS
38 const wxValidator& val = wxDefaultValidator,
39 const wxString& name = wxRadioBoxNameStr)
1a87edf2 40 :m_radios(wxKEY_INTEGER,n+1)
ffecfa5a 41 {
1a87edf2 42 Init();
ffecfa5a
JS
43 (void)Create(parent, id, title, pos, size, n, choices, majorDim,
44 style, val, name);
45 }
1a87edf2 46
ffecfa5a
JS
47 wxRadioBox(wxWindow *parent,
48 wxWindowID id,
49 const wxString& title,
50 const wxPoint& pos,
51 const wxSize& size,
52 const wxArrayString& choices,
53 int majorDim = 0,
8be10866 54 long style = wxRA_SPECIFY_COLS,
ffecfa5a
JS
55 const wxValidator& val = wxDefaultValidator,
56 const wxString& name = wxRadioBoxNameStr)
1a87edf2 57 :m_radios(wxKEY_INTEGER,choices.GetCount()+1)
ffecfa5a 58 {
1a87edf2 59 Init();
ffecfa5a
JS
60 (void)Create(parent, id, title, pos, size, choices, majorDim,
61 style, val, name);
62 }
63
d3c7fc99 64 virtual ~wxRadioBox();
ffecfa5a
JS
65
66 bool Create(wxWindow *parent,
67 wxWindowID id,
68 const wxString& title,
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& size = wxDefaultSize,
71 int n = 0, const wxString choices[] = NULL,
72 int majorDim = 0,
8be10866 73 long style = wxRA_SPECIFY_COLS,
ffecfa5a
JS
74 const wxValidator& val = wxDefaultValidator,
75 const wxString& name = wxRadioBoxNameStr);
9a727a3b 76
ffecfa5a
JS
77 bool Create(wxWindow *parent,
78 wxWindowID id,
79 const wxString& title,
80 const wxPoint& pos,
81 const wxSize& size,
82 const wxArrayString& choices,
83 int majorDim = 0,
8be10866 84 long style = wxRA_SPECIFY_COLS,
ffecfa5a
JS
85 const wxValidator& val = wxDefaultValidator,
86 const wxString& name = wxRadioBoxNameStr);
87
7a952d4c
WS
88 // Enabling
89 virtual bool Enable(bool enable = true);
90 virtual bool Enable(unsigned int n, bool enable = true);
91 virtual bool IsItemEnabled(unsigned int WXUNUSED(n)) const
92 {
93 /* TODO */
94 return true;
95 }
96
97 // Showing
98 virtual bool Show(bool show = true);
99 virtual bool Show(unsigned int n, bool show = true);
100 virtual bool IsItemShown(unsigned int WXUNUSED(n)) const
101 {
102 /* TODO */
103 return true;
104 }
105
ffecfa5a
JS
106 // implement the radiobox interface
107 virtual void SetSelection(int n);
108 virtual int GetSelection() const;
aa61d352
VZ
109 virtual unsigned int GetCount() const;
110 virtual wxString GetString(unsigned int n) const;
111 virtual void SetString(unsigned int n, const wxString& label);
11f4a344 112
11f4a344
WS
113 virtual void SetLabel(const wxString& label);
114 virtual wxString GetLabel();
115
1a87edf2
WS
116 virtual void DoGetPosition( int *x, int *y ) const;
117 virtual void DoGetSize( int *width, int *height ) const;
118 virtual void DoMoveWindow(int x, int y, int width, int height);
119
120 virtual wxPoint GetClientAreaOrigin() const;
121
ffecfa5a 122 void SetFocus();
ffecfa5a
JS
123 void SetLabelFont(const wxFont& WXUNUSED(font)) {};
124 void SetButtonFont(const wxFont& font) { SetFont(font); }
125
11f4a344
WS
126 virtual void Refresh( bool eraseBackground = true,
127 const wxRect *rect = NULL );
128
ffecfa5a
JS
129 void Command(wxCommandEvent& event);
130
131 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
132 void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
133
134 // implementation only from now on
135 // -------------------------------
136
ffecfa5a
JS
137 virtual bool SetFont(const wxFont& font);
138
ffecfa5a
JS
139 void SendNotificationEvent();
140
ffecfa5a 141protected:
ffecfa5a
JS
142 // get the max size of radio buttons
143 wxSize GetMaxButtonSize() const;
144
145 // get the total size occupied by the radio box buttons
146 wxSize GetTotalButtonSize(const wxSize& sizeBtn) const;
147
8228b893
WS
148 int *m_radioWidth; // for bitmaps
149 int *m_radioHeight;
ffecfa5a 150
8228b893
WS
151 int m_noRowsOrCols;
152 int m_selectedButton;
ffecfa5a 153
ffecfa5a
JS
154 virtual wxSize DoGetBestSize() const;
155
156private:
1a87edf2
WS
157
158 void Init();
17fb3524 159 wxRadioButton *GetRadioButton(int i) const;
1a87edf2
WS
160
161 wxPoint m_pos;
162 wxSize m_size;
163 wxHashTable m_radios;
164
ffecfa5a 165 DECLARE_DYNAMIC_CLASS(wxRadioBox)
c0c133e1 166 wxDECLARE_NO_COPY_CLASS(wxRadioBox);
ffecfa5a
JS
167};
168
169#endif
170 // _WX_RADIOBOX_H_