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