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 // ----------------------------------------------------------------------------
19 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
20 #pragma interface "choicece.h"
27 #include "wx/dynarray.h"
29 class WXDLLEXPORT wxChoice
;
30 WX_DEFINE_EXPORTED_ARRAY_PTR(wxChoice
*, wxArrayChoiceSpins
);
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
36 class WXDLLEXPORT wxChoice
: public wxChoiceBase
43 wxChoice(wxWindow
*parent
,
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 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
54 wxChoice(wxWindow
*parent
,
58 const wxArrayString
& choices
,
60 const wxValidator
& validator
= wxDefaultValidator
,
61 const wxString
& name
= wxChoiceNameStr
)
63 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
66 bool Create(wxWindow
*parent
,
68 const wxPoint
& pos
= wxDefaultPosition
,
69 const wxSize
& size
= wxDefaultSize
,
70 int n
= 0, const wxString choices
[] = NULL
,
72 const wxValidator
& validator
= wxDefaultValidator
,
73 const wxString
& name
= wxChoiceNameStr
);
75 bool Create(wxWindow
*parent
,
79 const wxArrayString
& choices
,
81 const wxValidator
& validator
= wxDefaultValidator
,
82 const wxString
& name
= wxChoiceNameStr
);
84 // implement base class pure virtuals
85 virtual int DoAppend(const wxString
& item
);
86 virtual int DoInsert(const wxString
& item
, int pos
);
87 virtual void Delete(int n
);
88 virtual void Clear() ;
90 virtual int GetCount() const;
91 virtual int GetSelection() const;
92 virtual void SetSelection(int n
);
94 virtual int FindString(const wxString
& s
) const;
95 virtual wxString
GetString(int n
) const;
96 virtual void SetString(int n
, const wxString
& s
);
98 // get the subclassed window proc of the buddy list of choices
99 WXFARPROC
GetBuddyWndProc() const { return m_wndProcBuddy
; }
101 // return the choice object whose buddy is the given window or NULL
102 static wxChoice
*GetChoiceForListBox(WXHWND hwndBuddy
);
104 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
107 virtual void DoSetItemClientData( int n
, void* clientData
);
108 virtual void* DoGetItemClientData( int n
) const;
109 virtual void DoSetItemClientObject( int n
, wxClientData
* clientData
);
110 virtual wxClientData
* DoGetItemClientObject( int n
) const;
112 // MSW implementation
113 virtual void DoGetPosition(int *x
, int *y
) const;
114 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
115 virtual wxSize
DoGetBestSize() const;
116 virtual void DoGetSize(int *width
, int *height
) const;
118 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
120 // create and initialize the control
121 bool CreateAndInit(wxWindow
*parent
, wxWindowID id
,
124 int n
, const wxString choices
[],
126 const wxValidator
& validator
,
127 const wxString
& name
);
129 // free all memory we have (used by Clear() and dtor)
132 // the data for the "buddy" list
134 WXFARPROC m_wndProcBuddy
;
136 // all existing wxChoice - this allows to find the one corresponding to
137 // the given buddy window in GetSpinChoiceCtrl()
138 static wxArrayChoiceSpins ms_allChoiceSpins
;
141 DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice
)
144 #endif // wxUSE_CHOICE
146 #endif // _WX_CHOICECE_H_BASE_