]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/choice.h
Always use XPMs in this sample
[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
7// RCS-ID: $Id:
8// Copyright: (c) 2003 David Elliott
9// Licence: wxWindows license
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
DE
17
18// ========================================================================
19// wxChoice
20// ========================================================================
f154ff60 21class WXDLLEXPORT wxChoice: public wxChoiceBase /*, protected wxCocoaNSPopUpButton */, protected wxCocoaNSMenu
da0634c1
DE
22{
23 DECLARE_DYNAMIC_CLASS(wxChoice)
24 DECLARE_EVENT_TABLE()
25// WX_DECLARE_COCOA_OWNER(NSTableView,NSControl,NSView)
26// ------------------------------------------------------------------------
27// initialization
28// ------------------------------------------------------------------------
29public:
f154ff60 30 wxChoice() { Init(); }
da0634c1
DE
31 wxChoice(wxWindow *parent, wxWindowID winid,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 int n = 0, const wxString choices[] = NULL,
35 long style = 0,
36 const wxValidator& validator = wxDefaultValidator,
37 const wxString& name = wxChoiceNameStr)
38 {
f154ff60 39 Init();
da0634c1
DE
40 Create(parent, winid, pos, size, n, choices, style, validator, name);
41 }
42
43 bool Create(wxWindow *parent, wxWindowID winid,
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxDefaultSize,
46 int n = 0, const wxString choices[] = NULL,
47 long style = 0,
48 const wxValidator& validator = wxDefaultValidator,
49 const wxString& name = wxChoiceNameStr);
50 virtual ~wxChoice();
f154ff60
DE
51protected:
52 void Init();
da0634c1
DE
53
54// ------------------------------------------------------------------------
55// Cocoa callbacks
56// ------------------------------------------------------------------------
57protected:
f154ff60 58 void CocoaNotification_menuDidSendAction(WX_NSNotification notification);
da0634c1
DE
59// ------------------------------------------------------------------------
60// Implementation
61// ------------------------------------------------------------------------
62public:
63 virtual void Clear();
64 virtual void Delete(int);
65 virtual int GetCount() const;
66 virtual wxString GetString(int) const;
67 virtual void SetString(int, const wxString&);
68 virtual int FindString(const wxString&) const;
69 virtual int GetSelection() const;
70 virtual int DoAppend(const wxString&);
be657756 71 virtual int DoInsert(const wxString&, int);
da0634c1
DE
72 virtual void DoSetItemClientData(int, void*);
73 virtual void* DoGetItemClientData(int) const;
74 virtual void DoSetItemClientObject(int, wxClientData*);
75 virtual wxClientData* DoGetItemClientObject(int) const;
76 virtual void SetSelection(int);
f154ff60
DE
77protected:
78 wxSortedArrayString *m_sortedStrings;
79 wxArrayPtrVoid m_itemsClientData;
da0634c1
DE
80};
81
82#endif // __WX_COCOA_CHOICE_H__