]> git.saurik.com Git - wxWidgets.git/blob - src/cocoa/choice.mm
Added missing bakefiles in utils/* and regenerated
[wxWidgets.git] / src / cocoa / choice.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/choice.mm
3 // Purpose: wxChoice
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/wxprec.h"
13 #ifndef WX_PRECOMP
14 #include "wx/log.h"
15 #include "wx/app.h"
16 #include "wx/choice.h"
17 #endif //WX_PRECOMP
18
19 #import <AppKit/NSPopUpButton.h>
20
21 IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
22 BEGIN_EVENT_TABLE(wxChoice, wxChoiceBase)
23 END_EVENT_TABLE()
24 // WX_IMPLEMENT_COCOA_OWNER(wxChoice,NSButton,NSControl,NSView)
25
26 bool wxChoice::Create(wxWindow *parent, wxWindowID winid,
27 const wxPoint& pos,
28 const wxSize& size,
29 int n, const wxString choices[],
30 long style,
31 const wxValidator& validator,
32 const wxString& name)
33 {
34 if(!CreateControl(parent,winid,pos,size,style,validator,name))
35 return false;
36
37 SetNSView([[NSPopUpButton alloc] initWithFrame:MakeDefaultNSRect(size)
38 pullsDown: NO]);
39
40 [m_cocoaNSView sizeToFit];
41 if(m_parent)
42 m_parent->CocoaAddChild(this);
43 SetInitialFrameRect(pos,size);
44
45 return true;
46 }
47
48 wxChoice::~wxChoice()
49 {
50 CocoaRemoveFromParent();
51 }
52
53 void wxChoice::Clear()
54 {
55 }
56
57 void wxChoice::Delete(int)
58 {
59 }
60
61 int wxChoice::GetCount() const
62 {
63 return 0;
64 }
65
66 wxString wxChoice::GetString(int) const
67 {
68 return wxEmptyString;
69 }
70
71 void wxChoice::SetString(int, const wxString&)
72 {
73 }
74
75 int wxChoice::FindString(const wxString&) const
76 {
77 return 0;
78 }
79
80 int wxChoice::GetSelection() const
81 {
82 return 0;
83 }
84
85 int wxChoice::DoAppend(const wxString&)
86 {
87 return 0;
88 }
89
90 int wxChoice::DoInsert(const wxString&, int)
91 {
92 return 0;
93 }
94
95 void wxChoice::DoSetItemClientData(int, void*)
96 {
97 }
98
99 void* wxChoice::DoGetItemClientData(int) const
100 {
101 return NULL;
102 }
103
104 void wxChoice::DoSetItemClientObject(int, wxClientData*)
105 {
106 }
107
108 wxClientData* wxChoice::DoGetItemClientObject(int) const
109 {
110 return NULL;
111 }
112
113 void wxChoice::SetSelection(int)
114 {
115 }
116