]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/choice.h
Bump subrelease number
[wxWidgets.git] / include / wx / cocoa / choice.h
CommitLineData
da0634c1
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/choice.h
3// Purpose: wxChoice class
4// Author: David Elliott
5// Modified by:
6// Created: 2003/03/16
853dcc57 7// RCS-ID: $Id$
da0634c1 8// Copyright: (c) 2003 David Elliott
853dcc57 9// Licence: wxWindows licence
da0634c1
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __WX_COCOA_CHOICE_H__
13#define __WX_COCOA_CHOICE_H__
14
f154ff60
DE
15//#include "wx/cocoa/NSPopUpButton.h"
16#include "wx/cocoa/NSMenu.h"
da0634c1 17
584ad2a3
MB
18class WXDLLIMPEXP_BASE wxSortedArrayString;
19
da0634c1
DE
20// ========================================================================
21// wxChoice
22// ========================================================================
f154ff60 23class WXDLLEXPORT wxChoice: public wxChoiceBase /*, protected wxCocoaNSPopUpButton */, protected wxCocoaNSMenu
da0634c1
DE
24{
25 DECLARE_DYNAMIC_CLASS(wxChoice)
26 DECLARE_EVENT_TABLE()
27// WX_DECLARE_COCOA_OWNER(NSTableView,NSControl,NSView)
28// ------------------------------------------------------------------------
29// initialization
30// ------------------------------------------------------------------------
31public:
f154ff60 32 wxChoice() { Init(); }
da0634c1
DE
33 wxChoice(wxWindow *parent, wxWindowID winid,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 int n = 0, const wxString choices[] = NULL,
37 long style = 0,
38 const wxValidator& validator = wxDefaultValidator,
39 const wxString& name = wxChoiceNameStr)
40 {
f154ff60 41 Init();
da0634c1
DE
42 Create(parent, winid, pos, size, n, choices, style, validator, name);
43 }
584ad2a3
MB
44 wxChoice(wxWindow *parent, wxWindowID winid,
45 const wxPoint& pos,
46 const wxSize& size,
47 const wxArrayString& choices,
48 long style = 0,
49 const wxValidator& validator = wxDefaultValidator,
50 const wxString& name = wxChoiceNameStr)
51 {
52 Init();
53 Create(parent, winid, pos, size, choices, style, validator, name);
54 }
da0634c1
DE
55
56 bool Create(wxWindow *parent, wxWindowID winid,
57 const wxPoint& pos = wxDefaultPosition,
58 const wxSize& size = wxDefaultSize,
59 int n = 0, const wxString choices[] = NULL,
60 long style = 0,
61 const wxValidator& validator = wxDefaultValidator,
62 const wxString& name = wxChoiceNameStr);
584ad2a3
MB
63 bool Create(wxWindow *parent, wxWindowID winid,
64 const wxPoint& pos,
65 const wxSize& size,
66 const wxArrayString& choices,
67 long style = 0,
68 const wxValidator& validator = wxDefaultValidator,
69 const wxString& name = wxChoiceNameStr);
da0634c1 70 virtual ~wxChoice();
f154ff60
DE
71protected:
72 void Init();
da0634c1
DE
73
74// ------------------------------------------------------------------------
75// Cocoa callbacks
76// ------------------------------------------------------------------------
77protected:
f154ff60 78 void CocoaNotification_menuDidSendAction(WX_NSNotification notification);
da0634c1
DE
79// ------------------------------------------------------------------------
80// Implementation
81// ------------------------------------------------------------------------
82public:
83 virtual void Clear();
aa61d352
VZ
84 virtual void Delete(unsigned int n);
85 virtual unsigned int GetCount() const;
86 virtual wxString GetString(unsigned int) const;
87 virtual void SetString(unsigned int pos, const wxString&);
853dcc57 88 virtual int FindString(const wxString& s, bool bCase = false) const;
da0634c1
DE
89 virtual int GetSelection() const;
90 virtual int DoAppend(const wxString&);
aa61d352
VZ
91 virtual int DoInsert(const wxString&, unsigned int pos);
92 virtual void DoSetItemClientData(unsigned int, void*);
93 virtual void* DoGetItemClientData(unsigned int) const;
94 virtual void DoSetItemClientObject(unsigned int, wxClientData*);
95 virtual wxClientData* DoGetItemClientObject(unsigned int) const;
96 virtual void SetSelection(int pos);
f154ff60
DE
97protected:
98 wxSortedArrayString *m_sortedStrings;
99 wxArrayPtrVoid m_itemsClientData;
da0634c1
DE
100};
101
102#endif // __WX_COCOA_CHOICE_H__