1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/wince/choicece.h
3 // Purpose: wxChoice implementation for smart phones driven by WinCE
4 // Author: Wlodzimierz ABX Skiba
7 // Copyright: (c) Wlodzimierz Skiba
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_CHOICECE_H_BASE_
12 #define _WX_CHOICECE_H_BASE_
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
22 #include "wx/dynarray.h"
24 class WXDLLIMPEXP_FWD_CORE wxChoice
;
25 WX_DEFINE_EXPORTED_ARRAY_PTR(wxChoice
*, wxArrayChoiceSpins
);
27 // ----------------------------------------------------------------------------
29 // ----------------------------------------------------------------------------
31 class WXDLLIMPEXP_CORE wxChoice
: public wxChoiceBase
38 wxChoice(wxWindow
*parent
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
42 int n
= 0, const wxString choices
[] = NULL
,
44 const wxValidator
& validator
= wxDefaultValidator
,
45 const wxString
& name
= wxChoiceNameStr
)
47 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
49 wxChoice(wxWindow
*parent
,
53 const wxArrayString
& choices
,
55 const wxValidator
& validator
= wxDefaultValidator
,
56 const wxString
& name
= wxChoiceNameStr
)
58 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
61 bool Create(wxWindow
*parent
,
63 const wxPoint
& pos
= wxDefaultPosition
,
64 const wxSize
& size
= wxDefaultSize
,
65 int n
= 0, const wxString choices
[] = NULL
,
67 const wxValidator
& validator
= wxDefaultValidator
,
68 const wxString
& name
= wxChoiceNameStr
);
70 bool Create(wxWindow
*parent
,
74 const wxArrayString
& choices
,
76 const wxValidator
& validator
= wxDefaultValidator
,
77 const wxString
& name
= wxChoiceNameStr
);
79 // implement base class pure virtuals
80 virtual void DoDeleteOneItem(unsigned int n
);
81 virtual void DoClear();
83 virtual unsigned int GetCount() const;
84 virtual int GetSelection() const;
85 virtual void SetSelection(int n
);
87 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
88 virtual wxString
GetString(unsigned int n
) const;
89 virtual void SetString(unsigned int n
, const wxString
& s
);
91 // get the subclassed window proc of the buddy list of choices
92 WXFARPROC
GetBuddyWndProc() const { return m_wndProcBuddy
; }
94 // return the choice object whose buddy is the given window or NULL
95 static wxChoice
*GetChoiceForListBox(WXHWND hwndBuddy
);
97 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
100 virtual int DoInsertItems(const wxArrayStringsAdapter
& items
,
102 void **clientData
, wxClientDataType type
);
104 virtual void DoSetItemClientData(unsigned int n
, void* clientData
);
105 virtual void* DoGetItemClientData(unsigned int n
) const;
107 virtual WXHWND
MSWGetItemsHWND() const { return m_hwndBuddy
; }
109 // MSW implementation
110 virtual void DoGetPosition(int *x
, int *y
) const;
111 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
112 virtual wxSize
DoGetBestSize() const;
113 virtual void DoGetSize(int *width
, int *height
) const;
115 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
117 // create and initialize the control
118 bool CreateAndInit(wxWindow
*parent
, wxWindowID id
,
121 int n
, const wxString choices
[],
123 const wxValidator
& validator
,
124 const wxString
& name
);
126 // the data for the "buddy" list
128 WXFARPROC m_wndProcBuddy
;
130 // all existing wxChoice - this allows to find the one corresponding to
131 // the given buddy window in GetSpinChoiceCtrl()
132 static wxArrayChoiceSpins ms_allChoiceSpins
;
135 DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice
)
138 #endif // wxUSE_CHOICE
140 #endif // _WX_CHOICECE_H_BASE_