]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/combobox.h
1 /////////////////////////////////////////////////////////////////////////////
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_
16 #pragma interface "combobox.h"
19 #include "wx/choice.h"
21 WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr
;
22 WXDLLEXPORT_DATA(extern const char*) wxEmptyString
;
25 class WXDLLEXPORT wxComboBox
: public wxChoice
27 DECLARE_DYNAMIC_CLASS(wxComboBox
)
30 inline wxComboBox() {}
33 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
34 const wxString
& value
= wxEmptyString
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
37 int n
= 0, const wxString choices
[] = NULL
,
39 const wxValidator
& validator
= wxDefaultValidator
,
40 const wxString
& name
= wxComboBoxNameStr
)
42 Create(parent
, id
, value
, pos
, size
, n
, choices
, style
, validator
, name
);
45 bool Create(wxWindow
*parent
, wxWindowID id
,
46 const wxString
& value
= wxEmptyString
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 int n
= 0, const wxString choices
[] = NULL
,
51 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxComboBoxNameStr
);
54 virtual void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
55 virtual void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
56 { wxWindow::SetSize(rect
, sizeFlags
); }
57 virtual void SetSize(const wxSize
& size
) { wxWindow::SetSize(size
); }
58 virtual void SetSize(int width
, int height
) { SetSize(-1, -1, width
, height
, wxSIZE_USE_EXISTING
); }
61 virtual void Append(const wxString
& item
);
62 virtual void Delete(int n
);
64 virtual int GetSelection() const ;
65 virtual void SetSelection(int n
);
66 virtual int FindString(const wxString
& s
) const;
67 virtual wxString
GetString(int n
) const ;
68 virtual wxString
GetStringSelection() const ;
69 virtual bool SetStringSelection(const wxString
& sel
);
70 virtual inline int Number() const { return m_noStrings
; }
72 // Text field functions
73 virtual wxString
GetValue() const ;
74 virtual void SetValue(const wxString
& value
);
76 // Clipboard operations
80 virtual void SetInsertionPoint(long pos
);
81 virtual void SetInsertionPointEnd();
82 virtual long GetInsertionPoint() const ;
83 virtual long GetLastPosition() const ;
84 virtual void Replace(long from
, long to
, const wxString
& value
);
85 virtual void Remove(long from
, long to
);
86 virtual void SetSelection(long from
, long to
);
87 virtual void SetEditable(bool editable
);
90 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
91 virtual void ChangeBackgroundColour();
92 virtual void ChangeForegroundColour();
93 WXWidget
GetTopWidget() const { return m_mainWidget
; }
94 WXWidget
GetMainWidget() const { return m_mainWidget
; }