]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRadioBox class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "radiobox.h"
19 #include "wx/control.h"
21 WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr
;
24 class WXDLLEXPORT wxBitmap
;
26 class WXDLLEXPORT wxRadioBox
: public wxControl
28 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
32 #if WXWIN_COMPATIBILITY
33 wxRadioBox(wxWindow
*parent
, wxFunction func
, const char *title
,
34 int x
= -1, int y
= -1, int width
= -1, int height
= -1,
35 int n
= 0, char **choices
= NULL
,
36 int majorDim
= 0, long style
= wxRA_HORIZONTAL
, const char *name
= wxRadioBoxNameStr
);
39 inline wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
40 int x, int y, int width, int height,
41 int n, wxBitmap **choices,
42 int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr)
44 Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, (const wxBitmap **)choices, majorDim, style,
45 wxDefaultValidator, name);
52 inline wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
53 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
54 int n
= 0, const wxString choices
[] = NULL
,
55 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
56 const wxValidator
& val
= wxDefaultValidator
, const wxString
& name
= wxRadioBoxNameStr
)
58 Create(parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name
);
62 wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
63 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
64 int n = 0, const wxBitmap *choices[] = NULL,
65 int majorDim = 0, long style = wxRA_HORIZONTAL,
66 const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
68 Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
74 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
75 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
76 int n
= 0, const wxString choices
[] = NULL
,
77 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
78 const wxValidator
& val
= wxDefaultValidator
, const wxString
& name
= wxRadioBoxNameStr
);
81 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
82 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
83 int n = 0, const wxBitmap *choices[] = NULL,
84 int majorDim = 0, long style = wxRA_HORIZONTAL,
85 const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
88 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
89 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
90 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
92 int FindString(const wxString
& s
) const;
93 void SetSelection(int N
);
94 int GetSelection(void) const;
95 wxString
GetString(int N
) const;
96 void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
97 void GetSize(int *x
, int *y
) const;
98 void GetPosition(int *x
, int *y
) const;
99 wxString
GetLabel(void) const;
100 void SetLabel(const wxString
& label
);
101 void SetLabel(int item
, const wxString
& label
) ;
102 void SetLabel(int item
, wxBitmap
*bitmap
) ;
103 wxString
GetLabel(int item
) const;
104 bool Show(bool show
);
106 void Enable(bool enable
);
107 void Enable(int item
, bool enable
);
108 void Show(int item
, bool show
) ;
109 inline void SetLabelFont(const wxFont
& WXUNUSED(font
)) {};
110 inline void SetButtonFont(const wxFont
& font
) { SetFont(font
); }
112 virtual wxString
GetStringSelection(void) const;
113 virtual bool SetStringSelection(const wxString
& s
);
114 inline virtual int Number(void) const { return m_noItems
; } ;
115 void Command(wxCommandEvent
& event
);
117 inline int GetNumberOfRowsOrCols(void) const { return m_noRowsOrCols
; }
118 inline void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
121 inline WXHWND
*GetRadioButtons(void) const { return m_radioButtons
; }
122 bool ContainsHWND(WXHWND hWnd
) const ;
125 WXHWND
* m_radioButtons
;
127 int * m_radioWidth
; // for bitmaps
128 int * m_radioHeight
;
132 int m_selectedButton
;