]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: choicdgg.h | |
3 | // Purpose: Generic choice dialogs | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __CHOICEDLGH_G__ | |
13 | #define __CHOICEDLGH_G__ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface "choicdgg.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/setup.h" | |
20 | #include "wx/dialog.h" | |
21 | ||
22 | #define wxCHOICE_HEIGHT 150 | |
23 | #define wxCHOICE_WIDTH 200 | |
24 | ||
25 | #define wxID_LISTBOX 3000 | |
26 | ||
27 | class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog | |
28 | { | |
29 | DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog) | |
30 | public: | |
31 | wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption, | |
32 | const int n, const wxString *choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition); | |
33 | ||
34 | wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption, | |
35 | const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition); | |
36 | ||
37 | bool Create(wxWindow *parent, const wxString& message, const wxString& caption, | |
38 | const int n, const wxString *choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition); | |
39 | bool Create(wxWindow *parent, const wxString& message, const wxString& caption, | |
40 | const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition); | |
41 | ||
42 | inline int GetSelection(void) const { return m_selection; } | |
43 | inline wxString GetStringSelection(void) const { return m_stringSelection; } | |
44 | inline char *GetSelectionClientData(void) const { return m_clientData; } | |
45 | ||
46 | void OnOK(wxCommandEvent& event); | |
47 | ||
48 | DECLARE_EVENT_TABLE() | |
49 | ||
50 | protected: | |
51 | long m_dialogStyle; | |
52 | int m_selection; | |
53 | wxString m_stringSelection; | |
54 | char* m_clientData; | |
55 | }; | |
56 | ||
57 | wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption, | |
58 | const int n, const wxString *choices, wxWindow *parent = NULL, | |
59 | const int x = -1, const int y = -1, const bool centre = TRUE, | |
60 | const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT); | |
61 | ||
62 | wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption, | |
63 | const int n, char *choices[], wxWindow *parent = NULL, | |
64 | const int x = -1, const int y = -1, const bool centre = TRUE, | |
65 | const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT); | |
66 | ||
67 | // Same as above but gets position in list of strings, instead of string, | |
68 | // or -1 if no selection | |
69 | int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, | |
70 | const int n, const wxString *choices, wxWindow *parent = NULL, | |
71 | const int x = -1, const int y = -1, const bool centre = TRUE, | |
72 | const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT); | |
73 | ||
74 | int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, | |
75 | const int n, char *choices[], wxWindow *parent = NULL, | |
76 | const int x = -1, const int y = -1, const bool centre = TRUE, | |
77 | const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT); | |
78 | ||
79 | // Return client data instead | |
80 | char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption, | |
81 | const int n, const wxString *choices, char **client_data, | |
82 | wxWindow *parent = NULL, const int x = -1, const int y = -1, | |
83 | const bool centre = TRUE, | |
84 | const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT); | |
85 | ||
86 | char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption, | |
87 | const int n, char *choices[], char **client_data, | |
88 | wxWindow *parent = NULL, const int x = -1, const int y = -1, | |
89 | const bool centre = TRUE, | |
90 | const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT); | |
91 | ||
92 | /* | |
93 | int WXDLLEXPORT wxGetMultipleChoice(const wxString& message, const wxString& caption, | |
94 | const int n, const wxString *choices, | |
95 | const int nsel, int * selection, | |
96 | wxWindow *parent = NULL, const int x = -1 , const int y = -1, const bool centre = TRUE, | |
97 | const int width = wxCHOICE_WIDTH, const int height = wxCHOICE_HEIGHT); | |
98 | */ | |
99 | ||
100 | #endif |