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
; }
102 virtual void DoSetItemClientData( int n
, void* clientData
);
103 virtual void* DoGetItemClientData( int n
) const;
104 virtual void DoSetItemClientObject( int n
, wxClientData
* clientData
);
105 virtual wxClientData
* DoGetItemClientObject( int n
) const;
107 // MSW implementation
108 virtual void DoGetPosition(int *x
, int *y
) const;
109 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
110 virtual wxSize
DoGetBestSize() const;
111 virtual void DoGetSize(int *width
, int *height
) const;
113 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
115 // create and initialize the control
116 bool CreateAndInit(wxWindow
*parent
, wxWindowID id
,
119 int n
, const wxString choices
[],
121 const wxValidator
& validator
,
122 const wxString
& name
);
124 // free all memory we have (used by Clear() and dtor)
127 // the data for the "buddy" list
129 WXFARPROC m_wndProcBuddy
;
131 // all existing wxChoice - this allows to find the one corresponding to
132 // the given buddy window in GetSpinChoiceCtrl()
133 static wxArrayChoiceSpins ms_allChoiceSpins
;
136 DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice
)
139 #endif // wxUSE_CHOICE
141 #endif // _WX_CHOICECE_H_BASE_