]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/combobox.h
Toolbar/tooltip udates
[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 virtual void SetFocus();
41
42 // callback functions
43 virtual void DelegateTextChanged( const wxString& value );
44 virtual void DelegateChoice( const wxString& value );
45
46 inline wxComboBox(wxWindow *parent, wxWindowID id,
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 {
55 Create(parent, id, value, pos, size, n, choices, style, validator, name);
56 }
57
58 bool Create(wxWindow *parent, wxWindowID id,
59 const wxString& value = wxEmptyString,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 int n = 0, const wxString choices[] = NULL,
63 long style = 0,
64 const wxValidator& validator = wxDefaultValidator,
65 const wxString& name = wxComboBoxNameStr);
66
67 // List functions
68 virtual void Append(const wxString& item);
69 virtual void Delete(int n);
70 virtual void Clear();
71 virtual int GetSelection() const ;
72 virtual void SetSelection(int n);
73 virtual int FindString(const wxString& s) const;
74 virtual wxString GetString(int n) const ;
75 virtual wxString GetStringSelection() const ;
76 virtual bool SetStringSelection(const wxString& sel);
77
78 // Text field functions
79 virtual wxString GetValue() const ;
80 virtual void SetValue(const wxString& value);
81
82 // Clipboard operations
83 virtual void Copy();
84 virtual void Cut();
85 virtual void Paste();
86 virtual void SetInsertionPoint(long pos);
87 virtual void SetInsertionPointEnd();
88 virtual long GetInsertionPoint() const ;
89 virtual long GetLastPosition() const ;
90 virtual void Replace(long from, long to, const wxString& value);
91 virtual void Remove(long from, long to);
92 virtual void SetSelection(long from, long to);
93 virtual void SetEditable(bool editable);
94 void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
95 protected:
96 // the subcontrols
97 wxTextCtrl* m_text;
98 wxChoice* m_choice;
99 };
100
101 #endif
102 // _WX_COMBOBOX_H_