]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/cocoa/choice.h
Reordered includes to have OS2EMX_PLAIN_CHAR defined prior to including os2.h
[wxWidgets.git] / include / wx / cocoa / choice.h
... / ...
CommitLineData
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
15//#include "wx/cocoa/NSPopUpButton.h"
16#include "wx/cocoa/NSMenu.h"
17
18// ========================================================================
19// wxChoice
20// ========================================================================
21class WXDLLEXPORT wxChoice: public wxChoiceBase /*, protected wxCocoaNSPopUpButton */, protected wxCocoaNSMenu
22{
23 DECLARE_DYNAMIC_CLASS(wxChoice)
24 DECLARE_EVENT_TABLE()
25// WX_DECLARE_COCOA_OWNER(NSTableView,NSControl,NSView)
26// ------------------------------------------------------------------------
27// initialization
28// ------------------------------------------------------------------------
29public:
30 wxChoice() { Init(); }
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 {
39 Init();
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();
51protected:
52 void Init();
53
54// ------------------------------------------------------------------------
55// Cocoa callbacks
56// ------------------------------------------------------------------------
57protected:
58 void CocoaNotification_menuDidSendAction(WX_NSNotification notification);
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&);
71 virtual int DoInsert(const wxString&, int);
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);
77protected:
78 wxSortedArrayString *m_sortedStrings;
79 wxArrayPtrVoid m_itemsClientData;
80};
81
82#endif // __WX_COCOA_CHOICE_H__