]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: choice.h | |
3 | // Purpose: wxChoice class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart and Markus Holzem | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __CHOICEH__ | |
13 | #define __CHOICEH__ | |
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: | |
29 | int no_strings; | |
30 | ||
31 | inline wxChoice(void) { no_strings = 0; } | |
32 | ||
33 | inline wxChoice(wxWindow *parent, wxWindowID id, | |
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 | { | |
41 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
42 | } | |
43 | ||
44 | bool Create(wxWindow *parent, wxWindowID id, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
46 | const wxSize& size = wxDefaultSize, | |
47 | int n = 0, const wxString choices[] = NULL, | |
48 | long style = 0, | |
49 | const wxValidator& validator = wxDefaultValidator, | |
50 | const wxString& name = wxChoiceNameStr); | |
51 | ||
52 | virtual void Append(const wxString& item); | |
53 | virtual void Delete(int n); | |
54 | virtual void Clear(void); | |
55 | virtual int GetSelection(void) const ; | |
56 | virtual void SetSelection(int n); | |
57 | virtual int FindString(const wxString& s) const; | |
58 | virtual wxString GetString(int n) const ; | |
59 | virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); | |
60 | virtual wxString GetStringSelection(void) const ; | |
61 | virtual bool SetStringSelection(const wxString& sel); | |
62 | ||
63 | virtual inline int Number(void) const { return no_strings; } | |
64 | virtual void Command(wxCommandEvent& event); | |
65 | ||
66 | virtual bool MSWCommand(WXUINT param, WXWORD id); | |
67 | ||
68 | virtual inline void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ } ; | |
69 | virtual inline int GetColumns(void) const { return 1 ; }; | |
70 | ||
71 | virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, | |
72 | WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
73 | ||
74 | long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
75 | }; | |
76 | ||
77 | #endif | |
78 | // __CHOICEH__ |