1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/radiobox.h
3 // Purpose: wxRadioBox class
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_RADIOBOX_H_
12 #define _WX_RADIOBOX_H_
15 class WXDLLIMPEXP_FWD_CORE wxBitmap
;
17 class WXDLLIMPEXP_CORE wxRadioBox
: public wxControl
, public wxRadioBoxBase
22 inline wxRadioBox( wxWindow
* pParent
24 ,const wxString
& rsTitle
25 ,const wxPoint
& rPos
= wxDefaultPosition
26 ,const wxSize
& rSize
= wxDefaultSize
28 ,const wxString asChoices
[] = NULL
30 ,long lStyle
= wxRA_SPECIFY_COLS
31 ,const wxValidator
& rVal
= wxDefaultValidator
32 ,const wxString
& rsName
= wxRadioBoxNameStr
49 inline wxRadioBox( wxWindow
* pParent
51 ,const wxString
& rsTitle
54 ,const wxArrayString
& asChoices
56 ,long lStyle
= wxRA_SPECIFY_COLS
57 ,const wxValidator
& rVal
= wxDefaultValidator
58 ,const wxString
& rsName
= wxRadioBoxNameStr
74 virtual ~wxRadioBox();
76 bool Create( wxWindow
* pParent
78 ,const wxString
& rsTitle
79 ,const wxPoint
& rPos
= wxDefaultPosition
80 ,const wxSize
& rSize
= wxDefaultSize
82 ,const wxString asChoices
[] = NULL
84 ,long lStyle
= wxRA_SPECIFY_COLS
85 ,const wxValidator
& rVal
= wxDefaultValidator
86 ,const wxString
& rsName
= wxRadioBoxNameStr
89 bool Create( wxWindow
* pParent
91 ,const wxString
& rsTitle
94 ,const wxArrayString
& asChoices
96 ,long lStyle
= wxRA_SPECIFY_COLS
97 ,const wxValidator
& rVal
= wxDefaultValidator
98 ,const wxString
& rsName
= wxRadioBoxNameStr
102 virtual bool Enable(bool bEnable
= true);
103 virtual bool Enable(unsigned int nItem
, bool bEnable
= true);
104 virtual bool IsItemEnabled(unsigned int WXUNUSED(n
)) const
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
119 void Command(wxCommandEvent
& rEvent
);
120 bool ContainsHWND(WXHWND hWnd
) const;
122 virtual WXHBRUSH
OnCtlColor( WXHDC hDC
129 virtual bool OS2Command( WXUINT uParam
132 void SendNotificationEvent(void);
133 MRESULT
WindowProc( WXUINT uMsg
141 virtual unsigned int GetCount() const;
142 inline WXHWND
* GetRadioButtons(void) const { return m_ahRadioButtons
; }
143 int GetSelection(void) const;
144 void GetSize(int* pnX
, int* pnY
) const;
145 inline int GetSizeFlags(void) const { return m_nSizeFlags
; }
146 virtual wxString
GetString(unsigned int nIndex
) const;
147 virtual wxString
GetStringSelection(void) const;
149 inline void SetButtonFont(const wxFont
& rFont
) { SetFont(rFont
); }
151 virtual bool SetFont(const wxFont
& rFont
);
152 inline void SetLabelFont(const wxFont
& WXUNUSED(font
)) {}
153 virtual void SetSelection(int nIndex
);
154 virtual void SetString(unsigned int nNum
, const wxString
& rsLabel
);
155 virtual bool SetStringSelection(const wxString
& rsStr
);
157 virtual void SetLabel(const wxString
& rsLabel
)
158 { wxControl::SetLabel(rsLabel
); }
159 virtual wxString
GetLabel() const
160 { return wxControl::GetLabel(); }
162 void SetLabel( int nItem
, const wxString
& rsLabel
);
163 void SetLabel( int item
, wxBitmap
* pBitmap
);
164 wxString
GetLabel(int nItem
) const;
167 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
168 virtual wxSize
DoGetBestSize(void) const;
169 virtual void DoSetSize( int nX
173 ,int nSizeFlags
= wxSIZE_AUTO
175 wxSize
GetMaxButtonSize(void) const;
176 wxSize
GetTotalButtonSize(const wxSize
& rSizeBtn
) const;
177 void SubclassRadioButton(WXHWND hWndBtn
);
180 WXHWND
* m_ahRadioButtons
;
181 int* m_pnRadioWidth
; // for bitmaps
182 int* m_pnRadioHeight
;
183 int m_nSelectedButton
;
188 unsigned int m_nNoItems
;
190 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
191 }; // end of wxRadioBox
193 #endif // _WX_RADIOBOX_H_