Added wxUSE_COMBOBOX guard
[wxWidgets.git] / src / cocoa / combobox.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        cocoa/combobox.mm
3 // Purpose:     wxComboBox
4 // Author:      David Elliott
5 // Modified by:
6 // Created:     2003/07/14
7 // RCS-ID:      $Id$
8 // Copyright:   (c) 2003 David Elliott
9 // Licence:     wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13
14 #if wxUSE_COMBOBOX
15
16 #include "wx/app.h"
17 #include "wx/combobox.h"
18 #include "wx/log.h"
19
20 #include "wx/cocoa/autorelease.h"
21 #include "wx/cocoa/string.h"
22
23 #import <AppKit/NSComboBox.h>
24
25 IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxTextCtrl)
26 BEGIN_EVENT_TABLE(wxComboBox, wxTextCtrl)
27 END_EVENT_TABLE()
28 // WX_IMPLEMENT_COCOA_OWNER(wxComboBox,NSComboBox,NSTextField,NSView)
29
30 bool wxComboBox::Create(wxWindow *parent, wxWindowID winid,
31             const wxString& value,
32             const wxPoint& pos,
33             const wxSize& size,
34             int n, const wxString choices[],
35             long style,
36             const wxValidator& validator,
37             const wxString& name)
38 {
39     wxAutoNSAutoreleasePool pool;
40     if(!CreateControl(parent,winid,pos,size,style,validator,name))
41         return false;
42
43     m_cocoaNSView = NULL;
44     SetNSTextField([[NSComboBox alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
45     [m_cocoaNSView release];
46     [GetNSTextField() setStringValue:wxNSStringWithWxString(value.c_str())];
47     [GetNSControl() sizeToFit];
48     if(m_parent)
49         m_parent->CocoaAddChild(this);
50     return true;
51 }
52
53 wxComboBox::~wxComboBox()
54 {
55 }
56
57 void wxComboBox::SetSelection(int)
58 {
59 }
60
61 wxString wxComboBox::GetStringSelection()
62 {
63     return wxEmptyString;
64 }
65
66 void wxComboBox::SetStringSelection(wxString& selection)
67 {
68 }
69
70 void wxComboBox::Clear()
71 {
72 }
73
74 void wxComboBox::Delete(int)
75 {
76 }
77
78 int wxComboBox::GetCount() const
79 {
80     return 0;
81 }
82
83 wxString wxComboBox::GetString(int) const
84 {
85     return wxEmptyString;
86 }
87
88 void wxComboBox::SetString(int, const wxString&)
89 {
90 }
91
92 int wxComboBox::FindString(const wxString&) const
93 {
94     return 0;
95 }
96
97 int wxComboBox::GetSelection() const
98 {
99     return 0;
100 }
101
102 int wxComboBox::DoAppend(const wxString&)
103 {
104     return 0;
105 }
106
107 int wxComboBox::DoInsert(const wxString&, int)
108 {
109     return 0;
110 }
111
112 void wxComboBox::DoSetItemClientData(int, void*)
113 {
114 }
115
116 void* wxComboBox::DoGetItemClientData(int) const
117 {
118     return NULL;
119 }
120
121 void wxComboBox::DoSetItemClientObject(int, wxClientData*)
122 {
123 }
124
125 wxClientData* wxComboBox::DoGetItemClientObject(int) const
126 {
127     return NULL;
128 }
129
130 #endif //wxUSE_COMBOBOX