]>
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 and Markus Holzem
9 // Licence: wxWindows license
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
)
31 inline wxChoice(void) { no_strings
= 0; }
33 inline wxChoice(wxWindow
*parent
, wxWindowID id
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 int n
= 0, const wxString choices
[] = NULL
,
38 const wxValidator
& validator
= wxDefaultValidator
,
39 const wxString
& name
= wxChoiceNameStr
)
41 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
44 bool Create(wxWindow
*parent
, wxWindowID id
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 int n
= 0, const wxString choices
[] = NULL
,
49 const wxValidator
& validator
= wxDefaultValidator
,
50 const wxString
& name
= wxChoiceNameStr
);
52 virtual void Append(const wxString
& item
);
53 virtual void Delete(int n
);
54 virtual void Clear(void);
55 virtual int GetSelection(void) const ;
56 virtual void SetSelection(int n
);
57 virtual int FindString(const wxString
& s
) const;
58 virtual wxString
GetString(int n
) const ;
59 virtual void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
60 virtual wxString
GetStringSelection(void) const ;
61 virtual bool SetStringSelection(const wxString
& sel
);
63 virtual inline int Number(void) const { return no_strings
; }
64 virtual void Command(wxCommandEvent
& event
);
66 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
68 virtual inline void SetColumns(int WXUNUSED(n
) = 1 ) { /* No effect */ } ;
69 virtual inline int GetColumns(void) const { return 1 ; };
71 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
72 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
74 long MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);