]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/choice.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxChoice class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "choice.h"
19 #include "wx/control.h"
21 WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr
;
24 class WXDLLEXPORT wxChoice
: public wxControl
26 DECLARE_DYNAMIC_CLASS(wxChoice
)
29 inline wxChoice(void) { m_noStrings
= 0; }
31 inline wxChoice(wxWindow
*parent
, wxWindowID id
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 int n
= 0, const wxString choices
[] = NULL
,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxChoiceNameStr
)
39 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
42 bool Create(wxWindow
*parent
, wxWindowID id
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 int n
= 0, const wxString choices
[] = NULL
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxChoiceNameStr
);
50 virtual void Append(const wxString
& item
);
51 virtual void Delete(int n
);
52 virtual void Clear(void);
53 virtual int GetSelection(void) const ;
54 virtual void SetSelection(int n
);
55 virtual int FindString(const wxString
& s
) const;
56 virtual wxString
GetString(int n
) const ;
57 virtual void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
58 void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
59 { wxWindow::SetSize(rect
, sizeFlags
); }
60 void SetSize(const wxSize
& size
) { wxWindow::SetSize(size
); }
61 virtual wxString
GetStringSelection(void) const ;
62 virtual bool SetStringSelection(const wxString
& sel
);
64 virtual inline int Number(void) const { return m_noStrings
; }
65 virtual void Command(wxCommandEvent
& event
);
67 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
69 virtual inline void SetColumns(int WXUNUSED(n
) = 1 ) { /* No effect */ } ;
70 virtual inline int GetColumns(void) const { return 1 ; };
72 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
73 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
75 long MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);