1 ///////////////////////////////////////////////////////////////////////////// 2 // Name: wx/msw/combobox.h 3 // Purpose: wxComboBox class 4 // Author: Julian Smart 5 // Modified by: 6 // Created: 01/02/97 7 // RCS-ID: $Id: combobox.h,v 1.1 2006/12/02 15:58:30 scara Exp $ 8 // Copyright: (c) Julian Smart 9 // Licence: wxWindows licence 10 ///////////////////////////////////////////////////////////////////////////// 11 12 #ifndef _WX_COMBOBOX_H_ 13 #define _WX_COMBOBOX_H_ 14 15 #ifdef __GNUG__ 16 #pragma interface "combobox.h" 17 #endif 18 19 #include "wx/choice.h" 20 21 #if wxUSE_COMBOBOX 22 23 WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; 24 25 // ---------------------------------------------------------------------------- 26 // Combobox control 27 // ---------------------------------------------------------------------------- 28 29 class WXDLLEXPORT wxComboBox: public wxChoice 30 { DECLARE_DYNAMIC_CLASS(wxComboBox)31 DECLARE_DYNAMIC_CLASS(wxComboBox) 32 33 public: 34 wxComboBox() { } 35 36 wxComboBox(wxWindow *parent, wxWindowID id, 37 const wxString& value = wxEmptyString, 38 const wxPoint& pos = wxDefaultPosition, 39 const wxSize& size = wxDefaultSize, 40 int n = 0, const wxString choices[] = NULL, 41 long style = 0, 42 const wxValidator& validator = wxDefaultValidator, 43 const wxString& name = wxComboBoxNameStr) 44 { 45 Create(parent, id, value, pos, size, n, choices, style, validator, name); 46 } 47 48 bool Create(wxWindow *parent, 49 wxWindowID id, 50 const wxString& value = wxEmptyString, 51 const wxPoint& pos = wxDefaultPosition, 52 const wxSize& size = wxDefaultSize, 53 int n = 0, 54 const wxString choices[] = NULL, 55 long style = 0, 56 const wxValidator& validator = wxDefaultValidator, 57 const wxString& name = wxComboBoxNameStr); 58 59 // List functions: see wxChoice 60 61 // Text field functions GetValue()62 wxString GetValue() const { return GetLabel(); } 63 virtual void SetValue(const wxString& value); 64 65 // Clipboard operations 66 virtual void Copy(); 67 virtual void Cut(); 68 virtual void Paste(); 69 virtual void SetInsertionPoint(long pos); 70 virtual void SetInsertionPointEnd(); 71 virtual long GetInsertionPoint() const; 72 virtual long GetLastPosition() const; 73 virtual void Replace(long from, long to, const wxString& value); 74 virtual void Remove(long from, long to); SetSelection(int n)75 virtual void SetSelection(int n) { wxChoice::SetSelection(n); } 76 virtual void SetSelection(long from, long to); 77 virtual void SetEditable(bool editable); 78 79 // implementation only from now on 80 virtual bool MSWCommand(WXUINT param, WXWORD id); 81 bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam); 82 virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, 83 WXUINT message, WXWPARAM wParam, WXLPARAM lParam); 84 85 WXHWND GetEditHWND() const; 86 }; 87 88 #endif // wxUSE_COMBOBOX 89 #endif 90 // _WX_COMBOBOX_H_ 91