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