1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Generic choice dialogs
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __CHOICEDLGH_G__
13 #define __CHOICEDLGH_G__
16 #pragma interface "choicdgg.h"
20 #include "wx/dialog.h"
22 #define wxCHOICE_HEIGHT 150
23 #define wxCHOICE_WIDTH 200
25 #define wxID_LISTBOX 3000
27 class WXDLLEXPORT wxSingleChoiceDialog
: public wxDialog
29 DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog
)
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
);
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
);
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
);
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
; }
46 void OnOK(wxCommandEvent
& event
);
53 wxString m_stringSelection
;
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
);
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
);
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
);
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
);
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
);
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
);
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);