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