]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/radiobox.h
added wxUSE_COMBOBCONTROL and wxUSE_OWNERDRAWNCOMBOBOX to wx/setup.h files
[wxWidgets.git] / include / wx / os2 / radiobox.h
CommitLineData
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
0e320a79 7// RCS-ID: $Id$
cdf1e714 8// Copyright: (c) David Webster
65571936 9// Licence: wxWindows licence
0e320a79
DW
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_RADIOBOX_H_
13#define _WX_RADIOBOX_H_
14
0e320a79 15// List box item
54da4255 16class WXDLLEXPORT wxBitmap ;
0e320a79 17
210a651b 18class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase
0e320a79 19{
0e320a79 20public:
3c299c3a
DW
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
3c299c3a 32 ,const wxValidator& rVal = wxDefaultValidator
3c299c3a
DW
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
3c299c3a 45 ,rVal
3c299c3a
DW
46 ,rsName
47 );
48 }
49
584ad2a3
MB
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
3c299c3a
DW
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
3c299c3a 86 ,const wxValidator& rVal = wxDefaultValidator
3c299c3a
DW
87 ,const wxString& rsName = wxRadioBoxNameStr
88 );
89
584ad2a3
MB
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
7a952d4c 102 // Enabling
853dcc57 103 virtual bool Enable(bool bEnable = true);
aa61d352 104 virtual bool Enable(unsigned int nItem, bool bEnable = true);
7a952d4c
WS
105 virtual bool IsItemEnabled(unsigned int WXUNUSED(n)) const
106 {
107 /* TODO */
108 return true;
109 }
110
111 // Showing
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
115 {
116 /* TODO */
117 return true;
118 }
119
120 void Command(wxCommandEvent& rEvent);
121 bool ContainsHWND(WXHWND hWnd) const;
3c299c3a
DW
122
123 virtual WXHBRUSH OnCtlColor( WXHDC hDC
124 ,WXHWND hWnd
125 ,WXUINT uCtlColor
126 ,WXUINT uMessage
127 ,WXWPARAM wParam
128 ,WXLPARAM lParam
129 );
130 virtual bool OS2Command( WXUINT uParam
131 ,WXWORD wId
132 );
133 void SendNotificationEvent(void);
3c299c3a
DW
134 MRESULT WindowProc( WXUINT uMsg
135 ,WXWPARAM wParam
136 ,WXLPARAM lParam
137 );
138
139
140
141
aa61d352 142 virtual unsigned int GetCount() const;
3c299c3a 143 inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; }
3c299c3a 144 int GetSelection(void) const;
aa61d352 145 void GetSize(int* pnX, int* pnY) const;
3a50d19c 146 inline int GetSizeFlags(void) const { return m_nSizeFlags; }
aa61d352 147 virtual wxString GetString(unsigned int nIndex) const;
3c299c3a
DW
148 virtual wxString GetStringSelection(void) const;
149
150 inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
151 void SetFocus(void);
152 virtual bool SetFont(const wxFont& rFont);
153 inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
aa61d352
VZ
154 virtual void SetSelection(int nIndex);
155 virtual void SetString(unsigned int nNum, const wxString& rsLabel);
743e24aa 156 virtual bool SetStringSelection(const wxString& rsStr);
3c299c3a 157
743e24aa
WS
158 virtual void SetLabel(const wxString& rsLabel)
159 { wxControl::SetLabel(rsLabel); }
160 virtual wxString GetLabel() const
161 { return wxControl::GetLabel(); }
54da4255 162
743e24aa
WS
163 void SetLabel( int nItem, const wxString& rsLabel );
164 void SetLabel( int item, wxBitmap* pBitmap );
165 wxString GetLabel(int nItem) const;
11e59d47 166
0e320a79 167protected:
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 186private:
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_