]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/choice.h
Ownerdrawn updates
[wxWidgets.git] / include / wx / mac / choice.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: choice.h
3 // Purpose: wxChoice class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CHOICE_H_
13 #define _WX_CHOICE_H_
14
15 #ifdef __GNUG__
16 #pragma interface "choice.h"
17 #endif
18
19 #include "wx/control.h"
20
21 #include <wx/dynarray.h>
22
23 WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
24
25 WX_DEFINE_ARRAY( char * , wxChoiceDataArray ) ;
26
27 // Choice item
28 class WXDLLEXPORT wxChoice: public wxChoiceBase
29 {
30 DECLARE_DYNAMIC_CLASS(wxChoice)
31
32 public:
33 wxChoice() {}
34 ~wxChoice() ;
35
36 wxChoice(wxWindow *parent, wxWindowID id,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 int n = 0, const wxString choices[] = NULL,
40 long style = 0,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxChoiceNameStr)
43 {
44 Create(parent, id, pos, size, n, choices, style, validator, name);
45 }
46
47 bool Create(wxWindow *parent, wxWindowID id,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 int n = 0, const wxString choices[] = NULL,
51 long style = 0,
52 const wxValidator& validator = wxDefaultValidator,
53 const wxString& name = wxChoiceNameStr);
54
55 virtual int DoAppend(const wxString& item);
56 virtual void Delete(int n);
57 virtual void Clear();
58 virtual int GetCount() const ;
59 virtual int GetSelection() const ;
60 virtual void SetSelection(int n);
61 virtual int FindString(const wxString& s) const;
62 virtual wxString GetString(int n) const ;
63 virtual void SetString( int , const wxString& s ) ;
64 void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
65
66 /*
67 virtual void Append(const wxString& item);
68 // Added min Append and GetClientData
69 virtual void Append(const wxString& item, void *client_data);
70 virtual void *GetClientData(int index) const;
71 virtual inline void Select( int n ) { SetSelection( n ); }
72 virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
73 virtual wxString GetStringSelection() const ;
74 virtual bool SetStringSelection(const wxString& sel);
75
76 virtual inline int Number() const { return m_strings.GetCount(); }
77 virtual inline int GetCount() const { return m_strings.GetCount(); }
78 virtual void Command(wxCommandEvent& event);
79
80 virtual inline int GetColumns() const { return 1 ; };
81 */
82 protected:
83 virtual void DoSetItemClientData( int n, void* clientData );
84 virtual void* DoGetItemClientData( int n ) const;
85 virtual void DoSetItemClientObject( int n, wxClientData* clientData );
86 virtual wxClientData* DoGetItemClientObject( int n ) const;
87
88 virtual void DoSetSize(int x, int y,
89 int width, int height,
90 int sizeFlags = wxSIZE_AUTO);
91
92 // free all memory we have (used by Clear() and dtor)
93 void Free();
94
95 wxArrayString m_strings;
96 wxChoiceDataArray m_dataArray ;
97 MenuHandle m_macPopUpMenuHandle ;
98 };
99
100 #endif
101 // _WX_CHOICE_H_