]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/combobox.h
forward declare wxMenu
[wxWidgets.git] / include / wx / motif / combobox.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: combobox.h
3// Purpose: wxComboBox class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
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#ifdef __GNUG__
16#pragma interface "combobox.h"
17#endif
18
19#include "wx/choice.h"
20
21WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr;
22WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
23
24// Combobox item
25class WXDLLEXPORT wxComboBox: public wxChoice
26{
bfc6fde4 27 DECLARE_DYNAMIC_CLASS(wxComboBox)
83df96d6 28
bfc6fde4 29public:
ec75d791 30 wxComboBox() {}
bfc6fde4 31 ~wxComboBox();
83df96d6 32
bfc6fde4 33 inline wxComboBox(wxWindow *parent, wxWindowID id,
83df96d6
JS
34 const wxString& value = wxEmptyString,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 int n = 0, const wxString choices[] = NULL,
38 long style = 0,
39 const wxValidator& validator = wxDefaultValidator,
40 const wxString& name = wxComboBoxNameStr)
bfc6fde4 41 {
ec75d791
MB
42 Create(parent, id, value, pos, size, n, choices,
43 style, validator, name);
bfc6fde4 44 }
83df96d6 45
bfc6fde4 46 bool Create(wxWindow *parent, wxWindowID id,
83df96d6
JS
47 const wxString& value = wxEmptyString,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 int n = 0, const wxString choices[] = NULL,
51 long style = 0,
52 const wxValidator& validator = wxDefaultValidator,
53 const wxString& name = wxComboBoxNameStr);
54
ec75d791
MB
55 // implementation of wxControlWithItems
56 virtual int DoAppend(const wxString& item);
bfc6fde4
VZ
57 virtual void Delete(int n);
58 virtual void Clear();
59 virtual int GetSelection() const ;
60 virtual void SetSelection(int n);
61 virtual int FindString(const wxString& s) const;
62 virtual wxString GetString(int n) const ;
9b1bd0c6
MB
63 virtual void SetString(int n, const wxString& s);
64
bfc6fde4
VZ
65 // Text field functions
66 virtual wxString GetValue() const ;
67 virtual void SetValue(const wxString& value);
83df96d6 68
bfc6fde4
VZ
69 // Clipboard operations
70 virtual void Copy();
71 virtual void Cut();
72 virtual void Paste();
73 virtual void SetInsertionPoint(long pos);
74 virtual void SetInsertionPointEnd();
75 virtual long GetInsertionPoint() const ;
76 virtual long GetLastPosition() const ;
77 virtual void Replace(long from, long to, const wxString& value);
78 virtual void Remove(long from, long to);
79 virtual void SetSelection(long from, long to);
80 virtual void SetEditable(bool editable);
83df96d6 81
bfc6fde4
VZ
82 // Implementation
83 virtual void ChangeFont(bool keepOriginalSize = TRUE);
84 virtual void ChangeBackgroundColour();
85 virtual void ChangeForegroundColour();
86 WXWidget GetTopWidget() const { return m_mainWidget; }
87 WXWidget GetMainWidget() const { return m_mainWidget; }
ec75d791
MB
88
89 virtual wxSize DoGetBestSize() const;
bfc6fde4
VZ
90protected:
91 virtual void DoSetSize(int x, int y,
83df96d6
JS
92 int width, int height,
93 int sizeFlags = wxSIZE_AUTO);
e1aae528
MB
94private:
95 // only implemented for native combo box
96 void AdjustDropDownListSize();
9b6dbb09
JS
97};
98
99#endif
83df96d6 100// _WX_COMBOBOX_H_