]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/combobox.h
f47d004cb6bae5e730fbd085992e3a90b6c98d87
[wxWidgets.git] / include / wx / msw / combobox.h
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$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COMBOBOX_H_
13 #define _WX_COMBOBOX_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "combobox.h"
17 #endif
18
19 #include "wx/choice.h"
20
21 #if wxUSE_COMBOBOX
22
23 // ----------------------------------------------------------------------------
24 // Combobox control
25 // ----------------------------------------------------------------------------
26
27 class WXDLLEXPORT wxComboBox: public wxChoice
28 {
29 public:
30 wxComboBox() { }
31
32 wxComboBox(wxWindow *parent, wxWindowID id,
33 const wxString& value = wxEmptyString,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 int n = 0, const wxString choices[] = NULL,
37 long style = 0,
38 const wxValidator& validator = wxDefaultValidator,
39 const wxString& name = wxComboBoxNameStr)
40 {
41 Create(parent, id, value, pos, size, n, choices, style, validator, name);
42 }
43 wxComboBox(wxWindow *parent, wxWindowID id,
44 const wxString& value,
45 const wxPoint& pos,
46 const wxSize& size,
47 const wxArrayString& choices,
48 long style = 0,
49 const wxValidator& validator = wxDefaultValidator,
50 const wxString& name = wxComboBoxNameStr)
51 {
52 Create(parent, id, value, pos, size, choices, style, validator, name);
53 }
54
55 bool Create(wxWindow *parent,
56 wxWindowID id,
57 const wxString& value = wxEmptyString,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 int n = 0,
61 const wxString choices[] = NULL,
62 long style = 0,
63 const wxValidator& validator = wxDefaultValidator,
64 const wxString& name = wxComboBoxNameStr);
65 bool Create(wxWindow *parent,
66 wxWindowID id,
67 const wxString& value,
68 const wxPoint& pos,
69 const wxSize& size,
70 const wxArrayString& choices,
71 long style = 0,
72 const wxValidator& validator = wxDefaultValidator,
73 const wxString& name = wxComboBoxNameStr);
74
75 // List functions: see wxChoice
76
77 // Text field functions
78 wxString GetValue() const { return GetLabel(); }
79 virtual void SetValue(const wxString& value);
80
81 // Clipboard operations
82 virtual void Copy();
83 virtual void Cut();
84 virtual void Paste();
85 virtual void SetInsertionPoint(long pos);
86 virtual void SetInsertionPointEnd();
87 virtual long GetInsertionPoint() const;
88 virtual long GetLastPosition() const;
89 virtual void Replace(long from, long to, const wxString& value);
90 virtual void Remove(long from, long to);
91 virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
92 virtual void SetSelection(long from, long to);
93 virtual void SetEditable(bool editable);
94
95 // implementation only from now on
96 virtual bool MSWCommand(WXUINT param, WXWORD id);
97 bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
98 virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
99 WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
100
101 WXHWND GetEditHWND() const;
102
103 private:
104 DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
105 };
106
107 #endif // wxUSE_COMBOBOX
108 #endif
109 // _WX_COMBOBOX_H_