]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
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_
15 WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr
;
18 class WXDLLEXPORT wxBitmap
;
20 class WXDLLEXPORT wxRadioBox
: public wxControl
, public wxRadioBoxBase
22 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
26 inline wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
27 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
28 int n
= 0, const wxString choices
[] = NULL
,
29 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
31 const wxValidator
& val
= wxDefaultValidator
, const wxString
& name
= wxRadioBoxNameStr
)
34 Create(parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name
);
39 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
40 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
41 int n
= 0, const wxString choices
[] = NULL
,
42 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
44 const wxValidator
& val
= wxDefaultValidator
, const wxString
& name
= wxRadioBoxNameStr
);
47 virtual bool OS2Command(WXUINT param
, WXWORD id
);
48 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
49 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
51 int FindString(const wxString
& s
) const;
52 void SetSelection(int N
);
53 int GetSelection() const;
54 virtual int GetCount() const;
55 wxString
GetString(int N
) const;
56 virtual void SetString(int n
, const wxString
& label
);
57 virtual int GetColumnCount() const;
58 virtual int GetRowCount() const;
60 void GetSize(int *x
, int *y
) const;
61 void GetPosition(int *x
, int *y
) const;
63 void SetLabel(int item
, const wxString
& label
);
64 void SetLabel(int item
, wxBitmap
*bitmap
);
65 wxString
GetLabel(int item
) const;
68 bool Enable(bool enable
);
69 void Enable(int item
, bool enable
);
70 void Show(int item
, bool show
) ;
71 inline void SetLabelFont(const wxFont
& WXUNUSED(font
)) {};
72 inline void SetButtonFont(const wxFont
& font
) { SetFont(font
); }
74 virtual wxString
GetStringSelection() const;
75 virtual bool SetStringSelection(const wxString
& s
);
76 inline virtual int Number() const { return m_noItems
; } ;
77 void Command(wxCommandEvent
& event
);
79 inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols
; }
80 inline void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
82 // implementation only from now on
83 // -------------------------------
85 WXHWND
*GetRadioButtons() const { return m_radioButtons
; }
86 bool ContainsHWND(WXHWND hWnd
) const;
87 void SendNotificationEvent();
89 // get the number of buttons per column/row
90 int GetNumVer() const;
91 int GetNumHor() const;
93 #if WXWIN_COMPATIBILITY
94 wxRadioBox(wxWindow
*parent
, wxFunction func
, const char *title
,
95 int x
= -1, int y
= -1, int width
= -1, int height
= -1,
96 int n
= 0, char **choices
= NULL
,
97 int majorDim
= 0, long style
= wxRA_HORIZONTAL
, const char *name
= wxRadioBoxNameStr
);
98 #endif // WXWIN_COMPATIBILITY
101 void SubclassRadioButton(WXHWND hWndBtn
);
103 WXHWND
* m_radioButtons
;
105 int * m_radioWidth
; // for bitmaps
110 int m_selectedButton
;
112 virtual void DoSetSize(int x
, int y
,
113 int width
, int height
,
114 int sizeFlags
= wxSIZE_AUTO
);
116 virtual void SetLabel(const wxString
& label
)
117 { wxWindowBase::SetLabel(label
); }
118 wxString
GetLabel() const
119 { return(wxWindowBase::GetLabel()); }