]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
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 | WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr; | |
22 | ||
23 | // Choice item | |
24 | class WXDLLEXPORT wxChoice: public wxControl | |
25 | { | |
26 | DECLARE_DYNAMIC_CLASS(wxChoice) | |
27 | ||
28 | public: | |
5b781a67 SC |
29 | wxChoice() {} |
30 | ~wxChoice() ; | |
0dbd6262 | 31 | |
5b781a67 | 32 | wxChoice(wxWindow *parent, wxWindowID id, |
0dbd6262 SC |
33 | const wxPoint& pos = wxDefaultPosition, |
34 | const wxSize& size = wxDefaultSize, | |
35 | int n = 0, const wxString choices[] = NULL, | |
36 | long style = 0, | |
37 | const wxValidator& validator = wxDefaultValidator, | |
38 | const wxString& name = wxChoiceNameStr) | |
39 | { | |
40 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
41 | } | |
42 | ||
43 | bool Create(wxWindow *parent, wxWindowID id, | |
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 | ||
51 | virtual void Append(const wxString& item); | |
03e11df5 GD |
52 | // Added min Append and GetClientData |
53 | virtual void Append(const wxString& item, void *client_data); | |
54 | virtual void *GetClientData(int index) const; | |
0dbd6262 SC |
55 | virtual void Delete(int n); |
56 | virtual void Clear(); | |
57 | virtual int GetSelection() const ; | |
58 | virtual void SetSelection(int n); | |
21168619 | 59 | virtual inline void Select( int n ) { SetSelection( n ); } |
0dbd6262 SC |
60 | virtual int FindString(const wxString& s) const; |
61 | virtual wxString GetString(int n) const ; | |
62 | virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); | |
63 | virtual wxString GetStringSelection() const ; | |
64 | virtual bool SetStringSelection(const wxString& sel); | |
65 | ||
05adb9d2 | 66 | virtual inline int Number() const { return m_strings.GetCount(); } |
21168619 | 67 | virtual inline int GetCount() const { return m_strings.GetCount(); } |
0dbd6262 SC |
68 | virtual void Command(wxCommandEvent& event); |
69 | ||
70 | virtual inline void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ } ; | |
71 | virtual inline int GetColumns() const { return 1 ; }; | |
519cb848 | 72 | void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ; |
0dbd6262 SC |
73 | |
74 | protected: | |
05adb9d2 | 75 | wxArrayString m_strings; |
519cb848 | 76 | MenuHandle m_macPopUpMenuHandle ; |
0dbd6262 SC |
77 | }; |
78 | ||
79 | #endif | |
80 | // _WX_CHOICE_H_ |