1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: choicdgg.h
|
|
|
|
// Purpose: Generic choice dialogs
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c)
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __CHOICEDLGH_G__
|
|
|
|
#define __CHOICEDLGH_G__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "choicdgg.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/setup.h"
|
|
|
|
#include "wx/dialog.h"
|
|
|
|
|
|
|
|
#define wxCHOICE_HEIGHT 150
|
|
|
|
#define wxCHOICE_WIDTH 200
|
|
|
|
|
|
|
|
#define wxID_LISTBOX 3000
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
|
|
|
|
public:
|
|
|
|
wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n, const wxString *choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
const wxStringList& choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n, const wxString *choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
1998-05-20 10:01:55 -04:00
|
|
|
bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
const wxStringList& choices, char **clientData = (char **) NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-05-28 07:13:25 -04:00
|
|
|
void SetSelection(int sel) ;
|
1998-05-20 10:01:55 -04:00
|
|
|
inline int GetSelection(void) const { return m_selection; }
|
|
|
|
inline wxString GetStringSelection(void) const { return m_stringSelection; }
|
|
|
|
inline char *GetSelectionClientData(void) const { return m_clientData; }
|
|
|
|
|
|
|
|
void OnOK(wxCommandEvent& event);
|
1998-07-04 11:17:59 -04:00
|
|
|
void OnListBoxDClick(wxCommandEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
protected:
|
|
|
|
long m_dialogStyle;
|
|
|
|
int m_selection;
|
|
|
|
wxString m_stringSelection;
|
|
|
|
char* m_clientData;
|
|
|
|
};
|
|
|
|
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 11:17:59 -04:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n, char *choices[], wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 11:17:59 -04:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
// Same as above but gets position in list of strings, instead of string,
|
|
|
|
// or -1 if no selection
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 11:17:59 -04:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
1998-08-22 23:22:56 -04:00
|
|
|
int n, char *choices[], wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 11:17:59 -04:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
// Return client data instead
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT char* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, const wxString *choices, char **client_data,
|
1998-08-22 23:22:56 -04:00
|
|
|
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
|
1998-07-04 11:17:59 -04:00
|
|
|
bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT char* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, char *choices[], char **client_data,
|
1998-08-22 23:22:56 -04:00
|
|
|
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
|
1998-07-04 11:17:59 -04:00
|
|
|
bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
/*
|
1998-11-22 17:32:53 -05:00
|
|
|
WXDLLEXPORT int wxGetMultipleChoice(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, const wxString *choices,
|
|
|
|
int nsel, int * selection,
|
|
|
|
wxWindow *parent = NULL, int x = -1 , int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 10:01:55 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|