1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/wince/choicece.h
3 // Purpose: wxChoice implementation for smart phones driven by WinCE
4 // Author: Wlodzimierz ABX Skiba
8 // Copyright: (c) Wlodzimierz Skiba
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CHOICECE_H_BASE_
13 #define _WX_CHOICECE_H_BASE_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
23 #include "wx/dynarray.h"
25 class WXDLLIMPEXP_FWD_CORE wxChoice
;
26 WX_DEFINE_EXPORTED_ARRAY_PTR(wxChoice
*, wxArrayChoiceSpins
);
28 // ----------------------------------------------------------------------------
30 // ----------------------------------------------------------------------------
32 class WXDLLEXPORT wxChoice
: public wxChoiceBase
39 wxChoice(wxWindow
*parent
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
,
43 int n
= 0, const wxString choices
[] = NULL
,
45 const wxValidator
& validator
= wxDefaultValidator
,
46 const wxString
& name
= wxChoiceNameStr
)
48 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
50 wxChoice(wxWindow
*parent
,
54 const wxArrayString
& choices
,
56 const wxValidator
& validator
= wxDefaultValidator
,
57 const wxString
& name
= wxChoiceNameStr
)
59 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
62 bool Create(wxWindow
*parent
,
64 const wxPoint
& pos
= wxDefaultPosition
,
65 const wxSize
& size
= wxDefaultSize
,
66 int n
= 0, const wxString choices
[] = NULL
,
68 const wxValidator
& validator
= wxDefaultValidator
,
69 const wxString
& name
= wxChoiceNameStr
);
71 bool Create(wxWindow
*parent
,
75 const wxArrayString
& choices
,
77 const wxValidator
& validator
= wxDefaultValidator
,
78 const wxString
& name
= wxChoiceNameStr
);
80 // implement base class pure virtuals
81 virtual int DoAppend(const wxString
& item
);
82 virtual int DoInsert(const wxString
& item
, unsigned int pos
);
83 virtual void Delete(unsigned int n
);
84 virtual void Clear() ;
86 virtual unsigned int GetCount() const;
87 virtual int GetSelection() const;
88 virtual void SetSelection(int n
);
90 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
91 virtual wxString
GetString(unsigned int n
) const;
92 virtual void SetString(unsigned int n
, const wxString
& s
);
94 // get the subclassed window proc of the buddy list of choices
95 WXFARPROC
GetBuddyWndProc() const { return m_wndProcBuddy
; }
97 // return the choice object whose buddy is the given window or NULL
98 static wxChoice
*GetChoiceForListBox(WXHWND hwndBuddy
);
100 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
103 virtual void DoSetItemClientData(unsigned int n
, void* clientData
);
104 virtual void* DoGetItemClientData(unsigned int n
) const;
105 virtual void DoSetItemClientObject(unsigned int n
, wxClientData
* clientData
);
106 virtual wxClientData
* DoGetItemClientObject(unsigned int n
) const;
108 // MSW implementation
109 virtual void DoGetPosition(int *x
, int *y
) const;
110 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
111 virtual wxSize
DoGetBestSize() const;
112 virtual void DoGetSize(int *width
, int *height
) const;
114 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
116 // create and initialize the control
117 bool CreateAndInit(wxWindow
*parent
, wxWindowID id
,
120 int n
, const wxString choices
[],
122 const wxValidator
& validator
,
123 const wxString
& name
);
125 // free all memory we have (used by Clear() and dtor)
128 // the data for the "buddy" list
130 WXFARPROC m_wndProcBuddy
;
132 // all existing wxChoice - this allows to find the one corresponding to
133 // the given buddy window in GetSpinChoiceCtrl()
134 static wxArrayChoiceSpins ms_allChoiceSpins
;
137 DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice
)
140 #endif // wxUSE_CHOICE
142 #endif // _WX_CHOICECE_H_BASE_