]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/combobox.h
Dan 'Bud' Keith's Implementation
[wxWidgets.git] / include / wx / mac / combobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: combobox.h
3 // Purpose: wxComboBox class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
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/textctrl.h"
20 #include "wx/choice.h"
21
22 WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr;
23 WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
24
25 // Combobox item
26 class WXDLLEXPORT wxComboBox: public wxChoice
27 {
28 DECLARE_DYNAMIC_CLASS(wxComboBox)
29
30 public:
31 inline wxComboBox() {}
32 virtual ~wxComboBox();
33 // override the base class virtuals involved in geometry calculations
34 virtual wxSize DoGetBestSize() const;
35 virtual void DoMoveWindow(int x, int y, int width, int height);
36
37 // forward these functions to all subcontrols
38 virtual bool Enable(bool enable = TRUE);
39 virtual bool Show(bool show = TRUE);
40
41 // callback functions
42 virtual void DelegateTextChanged( const wxString& value );
43 virtual void DelegateChoice( const wxString& value );
44
45 inline wxComboBox(wxWindow *parent, wxWindowID id,
46 const wxString& value = wxEmptyString,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
49 int n = 0, const wxString choices[] = NULL,
50 long style = 0,
51 const wxValidator& validator = wxDefaultValidator,
52 const wxString& name = wxComboBoxNameStr)
53 {
54 Create(parent, id, value, pos, size, n, choices, style, validator, name);
55 }
56
57 bool Create(wxWindow *parent, wxWindowID id,
58 const wxString& value = wxEmptyString,
59 const wxPoint& pos = wxDefaultPosition,
60 const wxSize& size = wxDefaultSize,
61 int n = 0, const wxString choices[] = NULL,
62 long style = 0,
63 const wxValidator& validator = wxDefaultValidator,
64 const wxString& name = wxComboBoxNameStr);
65
66 // List functions
67 virtual void Append(const wxString& item);
68 virtual void Delete(int n);
69 virtual void Clear();
70 virtual int GetSelection() const ;
71 virtual void SetSelection(int n);
72 virtual int FindString(const wxString& s) const;
73 virtual wxString GetString(int n) const ;
74 virtual wxString GetStringSelection() const ;
75 virtual bool SetStringSelection(const wxString& sel);
76
77 // Text field functions
78 virtual wxString GetValue() const ;
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(long from, long to);
92 virtual void SetEditable(bool editable);
93 void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
94 protected:
95 // the subcontrols
96 wxTextCtrl* m_text;
97 wxChoice* m_choice;
98 };
99
100 #endif
101 // _WX_COMBOBOX_H_