]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/choice.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxChoice class
4 // Author: Julian Smart
5 // Modified by: Vadim Zeitlin to derive from wxChoiceBase
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "choice.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class WXDLLEXPORT wxChoice
: public wxChoiceBase
30 wxChoice(wxWindow
*parent
,
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
);
41 wxChoice(wxWindow
*parent
,
45 const wxArrayString
& choices
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxChoiceNameStr
)
50 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
53 bool Create(wxWindow
*parent
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
57 int n
= 0, const wxString choices
[] = NULL
,
59 const wxValidator
& validator
= wxDefaultValidator
,
60 const wxString
& name
= wxChoiceNameStr
);
61 bool Create(wxWindow
*parent
,
65 const wxArrayString
& choices
,
67 const wxValidator
& validator
= wxDefaultValidator
,
68 const wxString
& name
= wxChoiceNameStr
);
70 // implement base class pure virtuals
71 virtual int DoAppend(const wxString
& item
);
72 virtual int DoInsert(const wxString
& item
, int pos
);
73 virtual void Delete(int n
);
76 virtual int GetCount() const;
77 virtual int GetSelection() const;
78 virtual void SetSelection(int n
);
80 virtual int FindString(const wxString
& s
) const;
81 virtual wxString
GetString(int n
) const;
82 virtual void SetString(int n
, const wxString
& s
);
85 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
86 long MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
87 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
88 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
91 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
92 virtual void DoSetItemClientData( int n
, void* clientData
);
93 virtual void* DoGetItemClientData( int n
) const;
94 virtual void DoSetItemClientObject( int n
, wxClientData
* clientData
);
95 virtual wxClientData
* DoGetItemClientObject( int n
) const;
98 virtual wxSize
DoGetBestSize() const;
99 virtual void DoGetSize(int *w
, int *h
) const;
100 virtual void DoSetSize(int x
, int y
,
101 int width
, int height
,
102 int sizeFlags
= wxSIZE_AUTO
);
104 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
106 // get the real height of the control
107 int GetVisibleHeight() const;
109 // update the height of the drop down list to fit the number of items we
110 // have (without changing the visible height)
111 void UpdateVisibleHeight();
113 // create and initialize the control
114 bool CreateAndInit(wxWindow
*parent
, wxWindowID id
,
117 int n
, const wxString choices
[],
119 const wxValidator
& validator
,
120 const wxString
& name
);
122 // free all memory we have (used by Clear() and dtor)
125 DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice
)
128 #endif // _WX_CHOICE_H_