]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
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, const wxWindowID id, | |
34 | const wxPoint& pos = wxDefaultPosition, | |
35 | const wxSize& size = wxDefaultSize, | |
36 | const int n = 0, const wxString choices[] = NULL, | |
37 | const 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, const wxWindowID id, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
46 | const wxSize& size = wxDefaultSize, | |
47 | const int n = 0, const wxString choices[] = NULL, | |
48 | const 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(const int n); | |
54 | virtual void Clear(void); | |
55 | virtual int GetSelection(void) const ; | |
56 | virtual void SetSelection(const int n); | |
57 | virtual int FindString(const wxString& s) const; | |
58 | virtual wxString GetString(const int n) const ; | |
59 | virtual void SetSize(const int x, const int y, const int width, const int height, const 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(const WXUINT param, const WXWORD id); | |
67 | ||
68 | virtual inline void SetColumns(const int WXUNUSED(n) = 1 ) { /* No effect */ } ; | |
69 | virtual inline int GetColumns(void) const { return 1 ; }; | |
70 | ||
71 | virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const 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__ |