1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/classic/combobox.h
3 // Purpose: wxComboBox class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COMBOBOX_H_
13 #define _WX_COMBOBOX_H_
15 #include "wx/choice.h"
17 WXDLLEXPORT_DATA(extern const wxChar
) wxComboBoxNameStr
[];
20 class WXDLLEXPORT wxComboBox
: public wxControl
, public wxComboBoxBase
22 DECLARE_DYNAMIC_CLASS(wxComboBox
)
25 inline wxComboBox() {}
26 virtual ~wxComboBox();
27 // override the base class virtuals involved in geometry calculations
28 virtual wxSize
DoGetBestSize() const;
29 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
31 // forward these functions to all subcontrols
32 virtual bool Enable(bool enable
= true);
33 virtual bool Show(bool show
= true);
34 virtual void SetFocus();
37 virtual void DelegateTextChanged( const wxString
& value
);
38 virtual void DelegateChoice( const wxString
& value
);
40 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
41 const wxString
& value
= wxEmptyString
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
44 int n
= 0, const wxString choices
[] = NULL
,
46 const wxValidator
& validator
= wxDefaultValidator
,
47 const wxString
& name
= wxComboBoxNameStr
)
49 Create(parent
, id
, value
, pos
, size
, n
, choices
, style
, validator
, name
);
51 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
52 const wxString
& value
,
55 const wxArrayString
& choices
,
57 const wxValidator
& validator
= wxDefaultValidator
,
58 const wxString
& name
= wxComboBoxNameStr
)
60 Create(parent
, id
, value
, pos
, size
, choices
, style
, validator
, name
);
63 bool Create(wxWindow
*parent
, wxWindowID id
,
64 const wxString
& value
= wxEmptyString
,
65 const wxPoint
& pos
= wxDefaultPosition
,
66 const wxSize
& size
= wxDefaultSize
,
67 int n
= 0, const wxString choices
[] = NULL
,
69 const wxValidator
& validator
= wxDefaultValidator
,
70 const wxString
& name
= wxComboBoxNameStr
);
71 bool Create(wxWindow
*parent
, wxWindowID id
,
72 const wxString
& value
,
75 const wxArrayString
& choices
,
77 const wxValidator
& validator
= wxDefaultValidator
,
78 const wxString
& name
= wxComboBoxNameStr
);
81 virtual void Delete(unsigned int n
);
84 virtual int GetSelection() const ;
85 virtual void SetSelection(int n
);
86 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
87 virtual wxString
GetString(unsigned int n
) const ;
88 virtual wxString
GetStringSelection() const ;
89 virtual void SetString(unsigned int n
, const wxString
& s
);
91 // Text field functions
92 virtual wxString
GetValue() const ;
93 virtual void SetValue(const wxString
& value
);
95 // Clipboard operations
99 virtual void SetInsertionPoint(long pos
);
100 virtual void SetInsertionPointEnd();
101 virtual long GetInsertionPoint() const ;
102 virtual wxTextPos
GetLastPosition() const ;
103 virtual void Replace(long from
, long to
, const wxString
& value
);
104 virtual void Remove(long from
, long to
);
105 virtual void SetSelection(long from
, long to
);
106 virtual void SetEditable(bool editable
);
107 virtual unsigned int GetCount() const { return m_choice
->GetCount() ; }
109 virtual bool IsEditable() const ;
111 virtual void Undo() ;
112 virtual void Redo() ;
113 virtual void SelectAll() ;
115 virtual bool CanCopy() const ;
116 virtual bool CanCut() const ;
117 virtual bool CanPaste() const ;
118 virtual bool CanUndo() const ;
119 virtual bool CanRedo() const ;
121 void MacHandleControlClick( WXWidget control
, wxInt16 controlpart
, bool mouseStillDown
) ;
123 wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
126 virtual int DoAppend(const wxString
& item
) ;
127 virtual int DoInsert(const wxString
& item
, unsigned int pos
) ;
129 virtual void DoSetItemClientData(unsigned int n
, void* clientData
);
130 virtual void* DoGetItemClientData(unsigned int n
) const ;
131 virtual void DoSetItemClientObject(unsigned int n
, wxClientData
* clientData
);
132 virtual wxClientData
* DoGetItemClientObject(unsigned int n
) const ;