]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/radiobox.h
3 // Purpose: wxRadioBox class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RADIOBOX_H_
13 #define _WX_RADIOBOX_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "radiobox.h"
19 class WXDLLEXPORT wxBitmap
;
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxRadioBox
: public wxControl
, public wxRadioBoxBase
30 wxRadioBox(wxWindow
*parent
,
32 const wxString
& title
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 int n
= 0, const wxString choices
[] = NULL
,
37 long style
= wxRA_HORIZONTAL
,
38 const wxValidator
& val
= wxDefaultValidator
,
39 const wxString
& name
= wxRadioBoxNameStr
);
43 bool Create(wxWindow
*parent
,
45 const wxString
& title
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 int n
= 0, const wxString choices
[] = NULL
,
50 long style
= wxRA_HORIZONTAL
,
51 const wxValidator
& val
= wxDefaultValidator
,
52 const wxString
& name
= wxRadioBoxNameStr
);
54 // implement the radiobox interface
55 virtual void SetSelection(int n
);
56 virtual int GetSelection() const;
57 virtual int GetCount() const;
58 virtual wxString
GetString(int n
) const;
59 virtual void SetString(int n
, const wxString
& label
);
60 virtual void Enable(int n
, bool enable
= TRUE
);
61 virtual void Show(int n
, bool show
= TRUE
);
62 virtual int GetColumnCount() const;
63 virtual int GetRowCount() const;
65 virtual bool Show(bool show
= TRUE
);
67 virtual bool Enable(bool enable
= TRUE
);
68 void SetLabelFont(const wxFont
& WXUNUSED(font
)) {};
69 void SetButtonFont(const wxFont
& font
) { SetFont(font
); }
71 void Command(wxCommandEvent
& event
);
73 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols
; }
74 void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
76 // implementation only from now on
77 // -------------------------------
79 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
81 // FIXME: are they used? missing "Do" prefix?
82 void GetSize(int *x
, int *y
) const;
83 void GetPosition(int *x
, int *y
) const;
85 virtual bool SetFont(const wxFont
& font
);
87 long MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
88 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
90 WXWPARAM wParam
, WXLPARAM lParam
);
91 WXHWND
*GetRadioButtons() const { return m_radioButtons
; }
92 bool ContainsHWND(WXHWND hWnd
) const;
93 void SendNotificationEvent();
95 // get the number of buttons per column/row
96 int GetNumVer() const;
97 int GetNumHor() const;
100 // subclass one radio button
101 void SubclassRadioButton(WXHWND hWndBtn
);
103 // get the max size of radio buttons
104 wxSize
GetMaxButtonSize() const;
106 // get the total size occupied by the radio box buttons
107 wxSize
GetTotalButtonSize(const wxSize
& sizeBtn
) const;
109 WXHWND
* m_radioButtons
;
111 int * m_radioWidth
; // for bitmaps
116 int m_selectedButton
;
118 virtual void DoSetSize(int x
, int y
,
119 int width
, int height
,
120 int sizeFlags
= wxSIZE_AUTO
);
121 virtual wxSize
DoGetBestSize() const;
124 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
125 DECLARE_NO_COPY_CLASS(wxRadioBox
)