]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/combobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/combobox.h
3 // Purpose: wxComboBox class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COMBOBOX_H_
13 #define _WX_COMBOBOX_H_
15 #include "wx/choice.h"
18 class WXDLLEXPORT wxComboBox
: public wxChoice
20 DECLARE_DYNAMIC_CLASS(wxComboBox
)
23 wxComboBox() { m_inSetSelection
= false; }
26 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
27 const wxString
& value
= wxEmptyString
,
28 const wxPoint
& pos
= wxDefaultPosition
,
29 const wxSize
& size
= wxDefaultSize
,
30 int n
= 0, const wxString choices
[] = NULL
,
32 const wxValidator
& validator
= wxDefaultValidator
,
33 const wxString
& name
= wxComboBoxNameStr
)
35 m_inSetSelection
= false;
36 Create(parent
, id
, value
, pos
, size
, n
, choices
,
37 style
, validator
, name
);
40 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
41 const wxString
& value
,
44 const wxArrayString
& choices
,
46 const wxValidator
& validator
= wxDefaultValidator
,
47 const wxString
& name
= wxComboBoxNameStr
)
49 m_inSetSelection
= false;
50 Create(parent
, id
, value
, pos
, size
, choices
,
51 style
, validator
, name
);
54 bool Create(wxWindow
*parent
, wxWindowID id
,
55 const wxString
& value
= wxEmptyString
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 int n
= 0, const wxString choices
[] = NULL
,
60 const wxValidator
& validator
= wxDefaultValidator
,
61 const wxString
& name
= wxComboBoxNameStr
);
63 bool Create(wxWindow
*parent
, wxWindowID id
,
64 const wxString
& value
,
67 const wxArrayString
& choices
,
69 const wxValidator
& validator
= wxDefaultValidator
,
70 const wxString
& name
= wxComboBoxNameStr
);
72 // implementation of wxControlWithItems
73 virtual int DoAppend(const wxString
& item
);
74 virtual int DoInsert(const wxString
& item
, int pos
);
75 virtual void Delete(int n
);
77 virtual int GetSelection() const ;
78 virtual void SetSelection(int n
);
79 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
80 virtual wxString
GetString(int n
) const ;
81 virtual void SetString(int n
, const wxString
& s
);
83 // Text field functions
84 virtual wxString
GetValue() const ;
85 virtual void SetValue(const wxString
& value
);
87 // Clipboard operations
91 virtual void SetInsertionPoint(long pos
);
92 virtual void SetInsertionPointEnd();
93 virtual long GetInsertionPoint() const ;
94 virtual wxTextPos
GetLastPosition() const ;
95 virtual void Replace(long from
, long to
, const wxString
& value
);
96 virtual void Remove(long from
, long to
);
97 virtual void SetSelection(long from
, long to
);
98 virtual void SetEditable(bool editable
);
101 virtual void ChangeFont(bool keepOriginalSize
= true);
102 virtual void ChangeBackgroundColour();
103 virtual void ChangeForegroundColour();
104 WXWidget
GetTopWidget() const { return m_mainWidget
; }
105 WXWidget
GetMainWidget() const { return m_mainWidget
; }
107 virtual wxSize
DoGetBestSize() const;
109 virtual void DoSetSize(int x
, int y
,
110 int width
, int height
,
111 int sizeFlags
= wxSIZE_AUTO
);
113 // only implemented for native combo box
114 void AdjustDropDownListSize();
116 // implementation detail, should really be private
118 bool m_inSetSelection
;