]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/radiobox.h
Added reparenting helper classes to help apps to grab the windows
[wxWidgets.git] / include / wx / os2 / radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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 #if wxUSE_VALIDATORS
33 ,const wxValidator& rVal = wxDefaultValidator
34 #endif
35 ,const wxString& rsName = wxRadioBoxNameStr
36 )
37 {
38 Create( pParent
39 ,vId
40 ,rsTitle
41 ,rPos
42 ,rSize
43 ,nNum
44 ,asChoices
45 ,nMajorDim
46 ,lStyle
47 #if wxUSE_VALIDATORS
48 ,rVal
49 #endif
50 ,rsName
51 );
52 }
53
54 ~wxRadioBox();
55
56 bool Create( wxWindow* pParent
57 ,wxWindowID vId
58 ,const wxString& rsTitle
59 ,const wxPoint& rPos = wxDefaultPosition
60 ,const wxSize& rSize = wxDefaultSize
61 ,int nNum = 0
62 ,const wxString asChoices[] = NULL
63 ,int nMajorDim = 0
64 ,long lStyle = wxRA_HORIZONTAL
65 #if wxUSE_VALIDATORS
66 ,const wxValidator& rVal = wxDefaultValidator
67 #endif
68 ,const wxString& rsName = wxRadioBoxNameStr
69 );
70
71 void Command(wxCommandEvent& rEvent);
72 bool ContainsHWND(WXHWND hWnd) const;
73 bool Enable(bool bEnable);
74 void Enable( int nItem
75 ,bool bEnable
76 );
77 int FindString(const wxString& sStr) const;
78
79 virtual WXHBRUSH OnCtlColor( WXHDC hDC
80 ,WXHWND hWnd
81 ,WXUINT uCtlColor
82 ,WXUINT uMessage
83 ,WXWPARAM wParam
84 ,WXLPARAM lParam
85 );
86 virtual bool OS2Command( WXUINT uParam
87 ,WXWORD wId
88 );
89 void SendNotificationEvent(void);
90 void Show( int nItem
91 ,bool bShow = TRUE
92 ) ;
93 bool Show(bool bShow);
94 MRESULT WindowProc( WXUINT uMsg
95 ,WXWPARAM wParam
96 ,WXLPARAM lParam
97 );
98
99
100
101
102 virtual int GetColumnCount(void) const;
103 virtual int GetCount(void) const;
104 inline int GetNumberOfRowsOrCols(void) const { return m_nNoRowsOrCols; }
105 int GetNumHor(void) const;
106 int GetNumVer(void) const;
107 void GetPosition( int* pnX
108 ,int* pnY
109 ) const;
110 inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; }
111 virtual int GetRowCount(void) const;
112 int GetSelection(void) const;
113 void GetSize( int* pnX
114 ,int* pnY
115 ) const;
116 inline int GetSizeFlags(void) const { return m_nSizeFlags; }
117 void AdjustButtons( int nX
118 ,int nY
119 ,int nWidth
120 ,int nHeight
121 ,int nSizeFlags
122 );
123 wxString GetString(int nIndex) const;
124 virtual wxString GetStringSelection(void) const;
125
126 inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
127 void SetFocus(void);
128 virtual bool SetFont(const wxFont& rFont);
129 inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
130 inline void SetNumberOfRowsOrCols(int nNum) { m_nNoRowsOrCols = nNum; }
131 void SetSelection(int nIndex);
132 virtual void SetString( int nNum
133 ,const wxString& rsLabel
134 );
135 virtual bool SetStringSelection(const wxString& rsStr);
136
137 void SetLabel( int nItem
138 ,const wxString& rsLabel
139 );
140 void SetLabel( int item
141 ,wxBitmap* pBitmap
142 );
143 wxString GetLabel(int nItem) const;
144
145
146 protected:
147 virtual wxSize DoGetBestSize(void) const;
148 virtual void DoSetSize( int nX
149 ,int nY
150 ,int nWidth
151 ,int nHeight
152 ,int nSizeFlags = wxSIZE_AUTO
153 );
154 wxSize GetMaxButtonSize(void) const;
155 wxSize GetTotalButtonSize(const wxSize& rSizeBtn) const;
156 void SubclassRadioButton(WXHWND hWndBtn);
157
158
159 WXHWND* m_ahRadioButtons;
160 int m_nMajorDim ;
161 int* m_pnRadioWidth; // for bitmaps
162 int* m_pnRadioHeight;
163 int m_nNoItems;
164 int m_nNoRowsOrCols;
165 int m_nSelectedButton;
166 int m_nSizeFlags;
167
168 private:
169 inline wxString GetLabel() const
170 { return wxWindowBase::GetLabel(); }
171 inline void SetLabel(const wxString& rsLabel)
172 { wxWindowBase::SetLabel(rsLabel); }
173
174 DECLARE_DYNAMIC_CLASS(wxRadioBox)
175 }; // end of wxRadioBox
176
177 #endif
178 // _WX_RADIOBOX_H_