]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/combobox.h
Use CmdDown in mouse events instead of ControlDown so Mac users can
[wxWidgets.git] / include / wx / msw / combobox.h
CommitLineData
2bda0e17 1/////////////////////////////////////////////////////////////////////////////
f6bcfd97 2// Name: wx/msw/combobox.h
2bda0e17
KB
3// Purpose: wxComboBox class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc 8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_COMBOBOX_H_
13#define _WX_COMBOBOX_H_
2bda0e17 14
2bda0e17
KB
15#include "wx/choice.h"
16
47d67540 17#if wxUSE_COMBOBOX
2bda0e17 18
4438caf4
VZ
19// ----------------------------------------------------------------------------
20// Combobox control
21// ----------------------------------------------------------------------------
22
2bda0e17
KB
23class WXDLLEXPORT wxComboBox: public wxChoice
24{
4438caf4 25public:
7d90194c 26 wxComboBox() { }
4438caf4
VZ
27
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,
33 long style = 0,
34 const wxValidator& validator = wxDefaultValidator,
6463b9f5
JS
35 const wxString& name = wxComboBoxNameStr)
36 {
37 Create(parent, id, value, pos, size, n, choices, style, validator, name);
38 }
584ad2a3
MB
39 wxComboBox(wxWindow *parent, wxWindowID id,
40 const wxString& value,
41 const wxPoint& pos,
42 const wxSize& size,
43 const wxArrayString& choices,
44 long style = 0,
45 const wxValidator& validator = wxDefaultValidator,
46 const wxString& name = wxComboBoxNameStr)
47 {
48 Create(parent, id, value, pos, size, choices, style, validator, name);
49 }
4438caf4 50
f6bcfd97
BP
51 bool Create(wxWindow *parent,
52 wxWindowID id,
53 const wxString& value = wxEmptyString,
54 const wxPoint& pos = wxDefaultPosition,
55 const wxSize& size = wxDefaultSize,
56 int n = 0,
57 const wxString choices[] = NULL,
58 long style = 0,
59 const wxValidator& validator = wxDefaultValidator,
60 const wxString& name = wxComboBoxNameStr);
584ad2a3
MB
61 bool Create(wxWindow *parent,
62 wxWindowID id,
63 const wxString& value,
64 const wxPoint& pos,
65 const wxSize& size,
66 const wxArrayString& choices,
67 long style = 0,
68 const wxValidator& validator = wxDefaultValidator,
69 const wxString& name = wxComboBoxNameStr);
4438caf4
VZ
70
71 // List functions: see wxChoice
72
73 // Text field functions
7d90194c 74 virtual wxString GetValue() const;
4438caf4
VZ
75 virtual void SetValue(const wxString& value);
76
77 // Clipboard operations
78 virtual void Copy();
79 virtual void Cut();
80 virtual void Paste();
150e31d2
JS
81 virtual bool CanCopy() const;
82 virtual bool CanCut() const;
83 virtual bool CanPaste() const;
4438caf4
VZ
84 virtual void SetInsertionPoint(long pos);
85 virtual void SetInsertionPointEnd();
86 virtual long GetInsertionPoint() const;
7d8268a1 87 virtual wxTextPos GetLastPosition() const;
4438caf4
VZ
88 virtual void Replace(long from, long to, const wxString& value);
89 virtual void Remove(long from, long to);
7d90194c 90 virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
4438caf4 91 virtual void SetSelection(long from, long to);
7d90194c 92 virtual int GetSelection() const { return wxChoice::GetSelection(); }
3f5ca6b1 93 virtual void GetSelection(long* from, long* to) const;
4438caf4
VZ
94 virtual void SetEditable(bool editable);
95
7d90194c
VZ
96 virtual void Undo();
97 virtual void Redo();
150e31d2
JS
98 virtual bool CanUndo() const;
99 virtual bool CanRedo() const;
100 virtual void SelectAll();
7d90194c 101 virtual bool IsEditable() const;
150e31d2
JS
102 virtual bool HasSelection() const;
103
f6bcfd97 104 // implementation only from now on
4438caf4 105 virtual bool MSWCommand(WXUINT param, WXWORD id);
f6bcfd97 106 bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
c140b7e7 107 virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
3a7d5f7c 108
f6bcfd97 109 WXHWND GetEditHWND() const;
fc7a2a60 110
150e31d2
JS
111 // Standard event handling
112 void OnCut(wxCommandEvent& event);
113 void OnCopy(wxCommandEvent& event);
114 void OnPaste(wxCommandEvent& event);
115 void OnUndo(wxCommandEvent& event);
116 void OnRedo(wxCommandEvent& event);
117 void OnDelete(wxCommandEvent& event);
118 void OnSelectAll(wxCommandEvent& event);
119
120 void OnUpdateCut(wxUpdateUIEvent& event);
121 void OnUpdateCopy(wxUpdateUIEvent& event);
122 void OnUpdatePaste(wxUpdateUIEvent& event);
123 void OnUpdateUndo(wxUpdateUIEvent& event);
124 void OnUpdateRedo(wxUpdateUIEvent& event);
125 void OnUpdateDelete(wxUpdateUIEvent& event);
126 void OnUpdateSelectAll(wxUpdateUIEvent& event);
127
71e57cd6
VZ
128 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
129
fc7a2a60
VZ
130private:
131 DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
150e31d2 132 DECLARE_EVENT_TABLE()
2bda0e17
KB
133};
134
47d67540 135#endif // wxUSE_COMBOBOX
2bda0e17 136#endif
bbcdf8bc 137 // _WX_COMBOBOX_H_