]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/radiobox.h
carbon compat routine define
[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 WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
16
17 // List box item
18 class WXDLLEXPORT wxBitmap ;
19
20 class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase
21 {
22 DECLARE_DYNAMIC_CLASS(wxRadioBox)
23 public:
24 wxRadioBox();
25
26 inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
27 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
28 int n = 0, const wxString choices[] = NULL,
29 int majorDim = 0, long style = wxRA_HORIZONTAL,
30 #if wxUSE_VALIDATORS
31 const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
32 #endif
33 {
34 Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
35 }
36
37 ~wxRadioBox();
38
39 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
40 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
41 int n = 0, const wxString choices[] = NULL,
42 int majorDim = 0, long style = wxRA_HORIZONTAL,
43 #if wxUSE_VALIDATORS
44 const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
45 #endif
46
47 virtual bool OS2Command(WXUINT param, WXWORD id);
48 virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
49 WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
50
51 int FindString(const wxString& s) const;
52 void SetSelection(int N);
53 int GetSelection() const;
54 virtual int GetCount() const;
55 wxString GetString(int N) const;
56 virtual void SetString(int n, const wxString& label);
57 virtual int GetColumnCount() const;
58 virtual int GetRowCount() const;
59
60 void GetSize(int *x, int *y) const;
61 void GetPosition(int *x, int *y) const;
62
63 void SetLabel(int item, const wxString& label);
64 void SetLabel(int item, wxBitmap *bitmap);
65 wxString GetLabel(int item) const;
66 bool Show(bool show);
67 void SetFocus();
68 bool Enable(bool enable);
69 void Enable(int item, bool enable);
70 void Show(int item, bool show) ;
71 inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
72 inline void SetButtonFont(const wxFont& font) { SetFont(font); }
73
74 virtual wxString GetStringSelection() const;
75 virtual bool SetStringSelection(const wxString& s);
76 inline virtual int Number() const { return m_noItems; } ;
77 void Command(wxCommandEvent& event);
78
79 inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
80 inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
81
82 // implementation only from now on
83 // -------------------------------
84
85 WXHWND *GetRadioButtons() const { return m_radioButtons; }
86 bool ContainsHWND(WXHWND hWnd) const;
87 void SendNotificationEvent();
88
89 // get the number of buttons per column/row
90 int GetNumVer() const;
91 int GetNumHor() const;
92
93 #if WXWIN_COMPATIBILITY
94 wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
95 int x = -1, int y = -1, int width = -1, int height = -1,
96 int n = 0, char **choices = NULL,
97 int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
98 #endif // WXWIN_COMPATIBILITY
99
100 protected:
101 void SubclassRadioButton(WXHWND hWndBtn);
102
103 WXHWND * m_radioButtons;
104 int m_majorDim ;
105 int * m_radioWidth; // for bitmaps
106 int * m_radioHeight;
107
108 int m_noItems;
109 int m_noRowsOrCols;
110 int m_selectedButton;
111
112 virtual void DoSetSize(int x, int y,
113 int width, int height,
114 int sizeFlags = wxSIZE_AUTO);
115 private:
116 virtual void SetLabel(const wxString& label)
117 { wxWindowBase::SetLabel(label); }
118 wxString GetLabel() const
119 { return(wxWindowBase::GetLabel()); }
120 };
121
122 #endif
123 // _WX_RADIOBOX_H_