]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/combobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/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"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 class WXDLLEXPORT wxComboBox
: public wxChoice
28 wxComboBox(wxWindow
*parent
, wxWindowID id
,
29 const wxString
& value
= wxEmptyString
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
32 int n
= 0, const wxString choices
[] = NULL
,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxComboBoxNameStr
)
37 Create(parent
, id
, value
, pos
, size
, n
, choices
, style
, validator
, name
);
39 wxComboBox(wxWindow
*parent
, wxWindowID id
,
40 const wxString
& value
,
43 const wxArrayString
& choices
,
45 const wxValidator
& validator
= wxDefaultValidator
,
46 const wxString
& name
= wxComboBoxNameStr
)
48 Create(parent
, id
, value
, pos
, size
, choices
, style
, validator
, name
);
51 bool Create(wxWindow
*parent
,
53 const wxString
& value
= wxEmptyString
,
54 const wxPoint
& pos
= wxDefaultPosition
,
55 const wxSize
& size
= wxDefaultSize
,
57 const wxString choices
[] = NULL
,
59 const wxValidator
& validator
= wxDefaultValidator
,
60 const wxString
& name
= wxComboBoxNameStr
);
61 bool Create(wxWindow
*parent
,
63 const wxString
& value
,
66 const wxArrayString
& choices
,
68 const wxValidator
& validator
= wxDefaultValidator
,
69 const wxString
& name
= wxComboBoxNameStr
);
71 // List functions: see wxChoice
73 // Text field functions
74 virtual wxString
GetValue() const;
75 virtual void SetValue(const wxString
& value
);
77 // Clipboard operations
81 virtual bool CanCopy() const;
82 virtual bool CanCut() const;
83 virtual bool CanPaste() const;
84 virtual void SetInsertionPoint(long pos
);
85 virtual void SetInsertionPointEnd();
86 virtual long GetInsertionPoint() const;
87 virtual wxTextPos
GetLastPosition() const;
88 virtual void Replace(long from
, long to
, const wxString
& value
);
89 virtual void Remove(long from
, long to
);
90 virtual void SetSelection(int n
) { wxChoice::SetSelection(n
); }
91 virtual void SetSelection(long from
, long to
);
92 virtual int GetSelection() const { return wxChoice::GetSelection(); }
93 virtual void GetSelection(long* from
, long* to
) const;
94 virtual void SetEditable(bool editable
);
98 virtual bool CanUndo() const;
99 virtual bool CanRedo() const;
100 virtual void SelectAll();
101 virtual bool IsEditable() const;
102 virtual bool HasSelection() const;
104 // implementation only from now on
105 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
106 bool MSWProcessEditMsg(WXUINT msg
, WXWPARAM wParam
, WXLPARAM lParam
);
107 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
108 bool MSWShouldPreProcessMessage(WXMSG
*pMsg
);
110 WXHWND
GetEditHWND() const;
112 // Standard event handling
113 void OnCut(wxCommandEvent
& event
);
114 void OnCopy(wxCommandEvent
& event
);
115 void OnPaste(wxCommandEvent
& event
);
116 void OnUndo(wxCommandEvent
& event
);
117 void OnRedo(wxCommandEvent
& event
);
118 void OnDelete(wxCommandEvent
& event
);
119 void OnSelectAll(wxCommandEvent
& event
);
121 void OnUpdateCut(wxUpdateUIEvent
& event
);
122 void OnUpdateCopy(wxUpdateUIEvent
& event
);
123 void OnUpdatePaste(wxUpdateUIEvent
& event
);
124 void OnUpdateUndo(wxUpdateUIEvent
& event
);
125 void OnUpdateRedo(wxUpdateUIEvent
& event
);
126 void OnUpdateDelete(wxUpdateUIEvent
& event
);
127 void OnUpdateSelectAll(wxUpdateUIEvent
& event
);
129 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
132 DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox
)
133 DECLARE_EVENT_TABLE()
136 #endif // wxUSE_COMBOBOX