]>
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_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "combobox.h"
19 #include "wx/choice.h"
22 class WXDLLEXPORT wxComboBox
: public wxChoice
24 DECLARE_DYNAMIC_CLASS(wxComboBox
)
27 wxComboBox() { m_inSetSelection
= false; }
30 inline wxComboBox(wxWindow
*parent
, wxWindowID id
,
31 const wxString
& value
= wxEmptyString
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 int n
= 0, const wxString choices
[] = NULL
,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxComboBoxNameStr
)
39 m_inSetSelection
= false;
40 Create(parent
, id
, value
, pos
, size
, n
, choices
,
41 style
, validator
, name
);
44 bool Create(wxWindow
*parent
, wxWindowID id
,
45 const wxString
& value
= wxEmptyString
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 int n
= 0, const wxString choices
[] = NULL
,
50 const wxValidator
& validator
= wxDefaultValidator
,
51 const wxString
& name
= wxComboBoxNameStr
);
53 // implementation of wxControlWithItems
54 virtual int DoAppend(const wxString
& item
);
55 virtual int DoInsert(const wxString
& item
, int pos
);
56 virtual void Delete(int n
);
58 virtual int GetSelection() const ;
59 virtual void SetSelection(int n
);
60 virtual int FindString(const wxString
& s
) const;
61 virtual wxString
GetString(int n
) const ;
62 virtual void SetString(int n
, const wxString
& s
);
64 // Text field functions
65 virtual wxString
GetValue() const ;
66 virtual void SetValue(const wxString
& value
);
68 // Clipboard operations
72 virtual void SetInsertionPoint(long pos
);
73 virtual void SetInsertionPointEnd();
74 virtual long GetInsertionPoint() const ;
75 virtual long GetLastPosition() const ;
76 virtual void Replace(long from
, long to
, const wxString
& value
);
77 virtual void Remove(long from
, long to
);
78 virtual void SetSelection(long from
, long to
);
79 virtual void SetEditable(bool editable
);
82 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
83 virtual void ChangeBackgroundColour();
84 virtual void ChangeForegroundColour();
85 WXWidget
GetTopWidget() const { return m_mainWidget
; }
86 WXWidget
GetMainWidget() const { return m_mainWidget
; }
88 virtual wxSize
DoGetBestSize() const;
90 virtual void DoSetSize(int x
, int y
,
91 int width
, int height
,
92 int sizeFlags
= wxSIZE_AUTO
);
94 // only implemented for native combo box
95 void AdjustDropDownListSize();
97 // implementation detail, should really be private
99 bool m_inSetSelection
;