]>
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"
16 #include "wx/textentry.h"
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 class WXDLLEXPORT wxComboBox
: public wxChoice
,
30 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 Create(parent
, id
, value
, pos
, size
, n
, choices
, style
, validator
, name
);
41 wxComboBox(wxWindow
*parent
, wxWindowID id
,
42 const wxString
& value
,
45 const wxArrayString
& choices
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxComboBoxNameStr
)
50 Create(parent
, id
, value
, pos
, size
, choices
, style
, validator
, name
);
53 bool Create(wxWindow
*parent
,
55 const wxString
& value
= wxEmptyString
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
59 const wxString choices
[] = NULL
,
61 const wxValidator
& validator
= wxDefaultValidator
,
62 const wxString
& name
= wxComboBoxNameStr
);
63 bool Create(wxWindow
*parent
,
65 const wxString
& value
,
68 const wxArrayString
& choices
,
70 const wxValidator
& validator
= wxDefaultValidator
,
71 const wxString
& name
= wxComboBoxNameStr
);
73 // resolve ambiguities among virtual functions inherited from both base
75 virtual void SetValue(const wxString
& value
);
76 virtual wxString
GetStringSelection() const
77 { return wxChoice::GetStringSelection(); }
79 virtual void SetSelection(int n
) { wxChoice::SetSelection(n
); }
80 virtual void SetSelection(long from
, long to
)
81 { wxTextEntry::SetSelection(from
, to
); }
82 virtual int GetSelection() const { return wxChoice::GetSelection(); }
83 virtual void GetSelection(long *from
, long *to
) const
84 { wxTextEntry::GetSelection(from
, to
); }
86 virtual bool IsEditable() const;
88 // implementation only from now on
89 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
90 bool MSWProcessEditMsg(WXUINT msg
, WXWPARAM wParam
, WXLPARAM lParam
);
91 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
92 bool MSWShouldPreProcessMessage(WXMSG
*pMsg
);
94 // Standard event handling
95 void OnCut(wxCommandEvent
& event
);
96 void OnCopy(wxCommandEvent
& event
);
97 void OnPaste(wxCommandEvent
& event
);
98 void OnUndo(wxCommandEvent
& event
);
99 void OnRedo(wxCommandEvent
& event
);
100 void OnDelete(wxCommandEvent
& event
);
101 void OnSelectAll(wxCommandEvent
& event
);
103 void OnUpdateCut(wxUpdateUIEvent
& event
);
104 void OnUpdateCopy(wxUpdateUIEvent
& event
);
105 void OnUpdatePaste(wxUpdateUIEvent
& event
);
106 void OnUpdateUndo(wxUpdateUIEvent
& event
);
107 void OnUpdateRedo(wxUpdateUIEvent
& event
);
108 void OnUpdateDelete(wxUpdateUIEvent
& event
);
109 void OnUpdateSelectAll(wxUpdateUIEvent
& event
);
112 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
115 virtual void DoSetToolTip(wxToolTip
*tip
);
118 virtual WXHWND
GetEditHWND() const;
121 DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox
)
122 DECLARE_EVENT_TABLE()
125 #endif // wxUSE_COMBOBOX
127 #endif // _WX_COMBOBOX_H_