]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
853dcc57 | 2 | // Name: wx/os2/radiobox.h |
0e320a79 | 3 | // Purpose: wxRadioBox class |
cdf1e714 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
cdf1e714 | 6 | // Created: 10/12/99 |
cdf1e714 | 7 | // Copyright: (c) David Webster |
65571936 | 8 | // Licence: wxWindows licence |
0e320a79 DW |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_RADIOBOX_H_ | |
12 | #define _WX_RADIOBOX_H_ | |
13 | ||
0e320a79 | 14 | // List box item |
b5dbe15d | 15 | class WXDLLIMPEXP_FWD_CORE wxBitmap ; |
0e320a79 | 16 | |
53a2db12 | 17 | class WXDLLIMPEXP_CORE wxRadioBox: public wxControl, public wxRadioBoxBase |
0e320a79 | 18 | { |
0e320a79 | 19 | public: |
3c299c3a DW |
20 | wxRadioBox(); |
21 | ||
22 | inline wxRadioBox( wxWindow* pParent | |
23 | ,wxWindowID vId | |
24 | ,const wxString& rsTitle | |
25 | ,const wxPoint& rPos = wxDefaultPosition | |
26 | ,const wxSize& rSize = wxDefaultSize | |
27 | ,int nNum = 0 | |
28 | ,const wxString asChoices[] = NULL | |
29 | ,int nMajorDim = 0 | |
3998c74b | 30 | ,long lStyle = wxRA_SPECIFY_COLS |
3c299c3a | 31 | ,const wxValidator& rVal = wxDefaultValidator |
3c299c3a DW |
32 | ,const wxString& rsName = wxRadioBoxNameStr |
33 | ) | |
34 | { | |
35 | Create( pParent | |
36 | ,vId | |
37 | ,rsTitle | |
38 | ,rPos | |
39 | ,rSize | |
40 | ,nNum | |
41 | ,asChoices | |
42 | ,nMajorDim | |
43 | ,lStyle | |
3c299c3a | 44 | ,rVal |
3c299c3a DW |
45 | ,rsName |
46 | ); | |
47 | } | |
48 | ||
584ad2a3 MB |
49 | inline wxRadioBox( wxWindow* pParent |
50 | ,wxWindowID vId | |
51 | ,const wxString& rsTitle | |
52 | ,const wxPoint& rPos | |
53 | ,const wxSize& rSize | |
54 | ,const wxArrayString& asChoices | |
55 | ,int nMajorDim = 0 | |
3998c74b | 56 | ,long lStyle = wxRA_SPECIFY_COLS |
584ad2a3 MB |
57 | ,const wxValidator& rVal = wxDefaultValidator |
58 | ,const wxString& rsName = wxRadioBoxNameStr | |
59 | ) | |
60 | { | |
61 | Create( pParent | |
62 | ,vId | |
63 | ,rsTitle | |
64 | ,rPos | |
65 | ,rSize | |
66 | ,asChoices | |
67 | ,nMajorDim | |
68 | ,lStyle | |
69 | ,rVal | |
70 | ,rsName | |
71 | ); | |
72 | } | |
73 | ||
d3c7fc99 | 74 | virtual ~wxRadioBox(); |
3c299c3a DW |
75 | |
76 | bool Create( wxWindow* pParent | |
77 | ,wxWindowID vId | |
78 | ,const wxString& rsTitle | |
79 | ,const wxPoint& rPos = wxDefaultPosition | |
80 | ,const wxSize& rSize = wxDefaultSize | |
81 | ,int nNum = 0 | |
82 | ,const wxString asChoices[] = NULL | |
83 | ,int nMajorDim = 0 | |
3998c74b | 84 | ,long lStyle = wxRA_SPECIFY_COLS |
3c299c3a | 85 | ,const wxValidator& rVal = wxDefaultValidator |
3c299c3a DW |
86 | ,const wxString& rsName = wxRadioBoxNameStr |
87 | ); | |
88 | ||
584ad2a3 MB |
89 | bool Create( wxWindow* pParent |
90 | ,wxWindowID vId | |
91 | ,const wxString& rsTitle | |
92 | ,const wxPoint& rPos | |
93 | ,const wxSize& rSize | |
94 | ,const wxArrayString& asChoices | |
95 | ,int nMajorDim = 0 | |
3998c74b | 96 | ,long lStyle = wxRA_SPECIFY_COLS |
584ad2a3 MB |
97 | ,const wxValidator& rVal = wxDefaultValidator |
98 | ,const wxString& rsName = wxRadioBoxNameStr | |
99 | ); | |
100 | ||
7a952d4c | 101 | // Enabling |
853dcc57 | 102 | virtual bool Enable(bool bEnable = true); |
aa61d352 | 103 | virtual bool Enable(unsigned int nItem, bool bEnable = true); |
7a952d4c WS |
104 | virtual bool IsItemEnabled(unsigned int WXUNUSED(n)) const |
105 | { | |
106 | /* TODO */ | |
107 | return true; | |
108 | } | |
109 | ||
110 | // Showing | |
111 | virtual bool Show(bool bShow = true); | |
112 | virtual bool Show(unsigned int nItem, bool bShow = true); | |
113 | virtual bool IsItemShown(unsigned int WXUNUSED(n)) const | |
114 | { | |
115 | /* TODO */ | |
116 | return true; | |
117 | } | |
118 | ||
119 | void Command(wxCommandEvent& rEvent); | |
120 | bool ContainsHWND(WXHWND hWnd) const; | |
3c299c3a DW |
121 | |
122 | virtual WXHBRUSH OnCtlColor( WXHDC hDC | |
123 | ,WXHWND hWnd | |
124 | ,WXUINT uCtlColor | |
125 | ,WXUINT uMessage | |
126 | ,WXWPARAM wParam | |
127 | ,WXLPARAM lParam | |
128 | ); | |
129 | virtual bool OS2Command( WXUINT uParam | |
130 | ,WXWORD wId | |
131 | ); | |
132 | void SendNotificationEvent(void); | |
3c299c3a DW |
133 | MRESULT WindowProc( WXUINT uMsg |
134 | ,WXWPARAM wParam | |
135 | ,WXLPARAM lParam | |
136 | ); | |
137 | ||
138 | ||
139 | ||
140 | ||
aa61d352 | 141 | virtual unsigned int GetCount() const; |
3c299c3a | 142 | inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; } |
3c299c3a | 143 | int GetSelection(void) const; |
aa61d352 | 144 | void GetSize(int* pnX, int* pnY) const; |
3a50d19c | 145 | inline int GetSizeFlags(void) const { return m_nSizeFlags; } |
aa61d352 | 146 | virtual wxString GetString(unsigned int nIndex) const; |
3c299c3a DW |
147 | virtual wxString GetStringSelection(void) const; |
148 | ||
149 | inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); } | |
150 | void SetFocus(void); | |
151 | virtual bool SetFont(const wxFont& rFont); | |
6dd0883d | 152 | inline void SetLabelFont(const wxFont& WXUNUSED(font)) {} |
aa61d352 VZ |
153 | virtual void SetSelection(int nIndex); |
154 | virtual void SetString(unsigned int nNum, const wxString& rsLabel); | |
743e24aa | 155 | virtual bool SetStringSelection(const wxString& rsStr); |
3c299c3a | 156 | |
743e24aa WS |
157 | virtual void SetLabel(const wxString& rsLabel) |
158 | { wxControl::SetLabel(rsLabel); } | |
159 | virtual wxString GetLabel() const | |
160 | { return wxControl::GetLabel(); } | |
54da4255 | 161 | |
743e24aa WS |
162 | void SetLabel( int nItem, const wxString& rsLabel ); |
163 | void SetLabel( int item, wxBitmap* pBitmap ); | |
164 | wxString GetLabel(int nItem) const; | |
11e59d47 | 165 | |
0e320a79 | 166 | protected: |
677dc0ed | 167 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } |
3c299c3a DW |
168 | virtual wxSize DoGetBestSize(void) const; |
169 | virtual void DoSetSize( int nX | |
170 | ,int nY | |
171 | ,int nWidth | |
172 | ,int nHeight | |
173 | ,int nSizeFlags = wxSIZE_AUTO | |
174 | ); | |
743e24aa WS |
175 | wxSize GetMaxButtonSize(void) const; |
176 | wxSize GetTotalButtonSize(const wxSize& rSizeBtn) const; | |
177 | void SubclassRadioButton(WXHWND hWndBtn); | |
3c299c3a DW |
178 | |
179 | ||
743e24aa | 180 | WXHWND* m_ahRadioButtons; |
743e24aa WS |
181 | int* m_pnRadioWidth; // for bitmaps |
182 | int* m_pnRadioHeight; | |
743e24aa WS |
183 | int m_nSelectedButton; |
184 | int m_nSizeFlags; | |
cdf1e714 | 185 | |
11e59d47 | 186 | private: |
3c299c3a | 187 | |
aa61d352 | 188 | unsigned int m_nNoItems; |
8228b893 | 189 | |
3c299c3a DW |
190 | DECLARE_DYNAMIC_CLASS(wxRadioBox) |
191 | }; // end of wxRadioBox | |
0e320a79 | 192 | |
743e24aa | 193 | #endif // _WX_RADIOBOX_H_ |