1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/radiobox.h
3 // Purpose: wxRadioBox class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RADIOBOX_H_
13 #define _WX_RADIOBOX_H_
16 class WXDLLIMPEXP_FWD_CORE wxBitmap
;
18 class WXDLLIMPEXP_CORE wxRadioBox
: public wxControl
, public wxRadioBoxBase
23 inline wxRadioBox( wxWindow
* pParent
25 ,const wxString
& rsTitle
26 ,const wxPoint
& rPos
= wxDefaultPosition
27 ,const wxSize
& rSize
= wxDefaultSize
29 ,const wxString asChoices
[] = NULL
31 ,long lStyle
= wxRA_SPECIFY_COLS
32 ,const wxValidator
& rVal
= wxDefaultValidator
33 ,const wxString
& rsName
= wxRadioBoxNameStr
50 inline wxRadioBox( wxWindow
* pParent
52 ,const wxString
& rsTitle
55 ,const wxArrayString
& asChoices
57 ,long lStyle
= wxRA_SPECIFY_COLS
58 ,const wxValidator
& rVal
= wxDefaultValidator
59 ,const wxString
& rsName
= wxRadioBoxNameStr
75 virtual ~wxRadioBox();
77 bool Create( wxWindow
* pParent
79 ,const wxString
& rsTitle
80 ,const wxPoint
& rPos
= wxDefaultPosition
81 ,const wxSize
& rSize
= wxDefaultSize
83 ,const wxString asChoices
[] = NULL
85 ,long lStyle
= wxRA_SPECIFY_COLS
86 ,const wxValidator
& rVal
= wxDefaultValidator
87 ,const wxString
& rsName
= wxRadioBoxNameStr
90 bool Create( wxWindow
* pParent
92 ,const wxString
& rsTitle
95 ,const wxArrayString
& asChoices
97 ,long lStyle
= wxRA_SPECIFY_COLS
98 ,const wxValidator
& rVal
= wxDefaultValidator
99 ,const wxString
& rsName
= wxRadioBoxNameStr
103 virtual bool Enable(bool bEnable
= true);
104 virtual bool Enable(unsigned int nItem
, bool bEnable
= true);
105 virtual bool IsItemEnabled(unsigned int WXUNUSED(n
)) const
112 virtual bool Show(bool bShow
= true);
113 virtual bool Show(unsigned int nItem
, bool bShow
= true);
114 virtual bool IsItemShown(unsigned int WXUNUSED(n
)) const
120 void Command(wxCommandEvent
& rEvent
);
121 bool ContainsHWND(WXHWND hWnd
) const;
123 virtual WXHBRUSH
OnCtlColor( WXHDC hDC
130 virtual bool OS2Command( WXUINT uParam
133 void SendNotificationEvent(void);
134 MRESULT
WindowProc( WXUINT uMsg
142 virtual unsigned int GetCount() const;
143 inline WXHWND
* GetRadioButtons(void) const { return m_ahRadioButtons
; }
144 int GetSelection(void) const;
145 void GetSize(int* pnX
, int* pnY
) const;
146 inline int GetSizeFlags(void) const { return m_nSizeFlags
; }
147 virtual wxString
GetString(unsigned int nIndex
) const;
148 virtual wxString
GetStringSelection(void) const;
150 inline void SetButtonFont(const wxFont
& rFont
) { SetFont(rFont
); }
152 virtual bool SetFont(const wxFont
& rFont
);
153 inline void SetLabelFont(const wxFont
& WXUNUSED(font
)) {};
154 virtual void SetSelection(int nIndex
);
155 virtual void SetString(unsigned int nNum
, const wxString
& rsLabel
);
156 virtual bool SetStringSelection(const wxString
& rsStr
);
158 virtual void SetLabel(const wxString
& rsLabel
)
159 { wxControl::SetLabel(rsLabel
); }
160 virtual wxString
GetLabel() const
161 { return wxControl::GetLabel(); }
163 void SetLabel( int nItem
, const wxString
& rsLabel
);
164 void SetLabel( int item
, wxBitmap
* pBitmap
);
165 wxString
GetLabel(int nItem
) const;
168 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
169 virtual wxSize
DoGetBestSize(void) const;
170 virtual void DoSetSize( int nX
174 ,int nSizeFlags
= wxSIZE_AUTO
176 wxSize
GetMaxButtonSize(void) const;
177 wxSize
GetTotalButtonSize(const wxSize
& rSizeBtn
) const;
178 void SubclassRadioButton(WXHWND hWndBtn
);
181 WXHWND
* m_ahRadioButtons
;
182 int* m_pnRadioWidth
; // for bitmaps
183 int* m_pnRadioHeight
;
184 int m_nSelectedButton
;
189 unsigned int m_nNoItems
;
191 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
192 }; // end of wxRadioBox
194 #endif // _WX_RADIOBOX_H_