1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: choicdgg.h
|
|
|
|
// Purpose: Generic choice dialogs
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c)
|
1999-06-28 21:39:49 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __CHOICEDLGH_G__
|
|
|
|
#define __CHOICEDLGH_G__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-06-25 21:28:25 +00:00
|
|
|
#pragma interface "choicdgg.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/dialog.h"
|
1999-10-23 23:40:55 +00:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxListBox;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
#define wxCHOICE_HEIGHT 150
|
|
|
|
#define wxCHOICE_WIDTH 200
|
|
|
|
|
1999-08-17 12:31:34 +00:00
|
|
|
#define wxCHOICEDLG_STYLE (wxDEFAULT_DIALOG_STYLE|wxOK | wxCANCEL | wxCENTRE)
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog
|
|
|
|
{
|
1999-06-25 21:28:25 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
public:
|
1999-06-25 21:28:25 +00:00
|
|
|
wxSingleChoiceDialog(wxWindow *parent,
|
|
|
|
const wxString& message,
|
|
|
|
const wxString& caption,
|
|
|
|
int n,
|
|
|
|
const wxString *choices,
|
|
|
|
char **clientData = (char **)NULL,
|
|
|
|
long style = wxCHOICEDLG_STYLE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
|
|
|
|
|
|
|
wxSingleChoiceDialog(wxWindow *parent,
|
|
|
|
const wxString& message,
|
|
|
|
const wxString& caption,
|
|
|
|
const wxStringList& choices,
|
|
|
|
char **clientData = (char **)NULL,
|
|
|
|
long style = wxCHOICEDLG_STYLE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
const wxString& message,
|
|
|
|
const wxString& caption,
|
|
|
|
int n,
|
|
|
|
const wxString *choices,
|
|
|
|
char **clientData = (char **)NULL,
|
|
|
|
long style = wxCHOICEDLG_STYLE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
const wxString& message,
|
|
|
|
const wxString& caption,
|
|
|
|
const wxStringList& choices,
|
|
|
|
char **clientData = (char **)NULL,
|
|
|
|
long style = wxCHOICEDLG_STYLE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-10-26 13:54:58 +00:00
|
|
|
void SetSelection(int sel);
|
1999-06-25 21:28:25 +00:00
|
|
|
int GetSelection() const { return m_selection; }
|
|
|
|
wxString GetStringSelection() const { return m_stringSelection; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-06-25 21:28:25 +00:00
|
|
|
// obsolete function (NB: no need to make it return wxChar, it's untyped)
|
|
|
|
char *GetSelectionClientData() const { return (char *)m_clientData; }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-06-25 21:28:25 +00:00
|
|
|
// implementation from now on
|
1998-05-20 14:01:55 +00:00
|
|
|
void OnOK(wxCommandEvent& event);
|
1998-07-04 15:17:59 +00:00
|
|
|
void OnListBoxDClick(wxCommandEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int m_selection;
|
1999-08-11 11:53:40 +00:00
|
|
|
int m_dialogStyle;
|
1998-05-20 14:01:55 +00:00
|
|
|
wxString m_stringSelection;
|
1999-06-25 21:28:25 +00:00
|
|
|
wxListBox *m_listbox;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
|
1998-08-23 03:22:56 +00:00
|
|
|
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 15:17:59 +00:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
|
1999-04-12 22:20:19 +00:00
|
|
|
int n, wxChar *choices[], wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 15:17:59 +00:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Same as above but gets position in list of strings, instead of string,
|
|
|
|
// or -1 if no selection
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
1998-08-23 03:22:56 +00:00
|
|
|
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 15:17:59 +00:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
1999-04-12 22:20:19 +00:00
|
|
|
int n, wxChar *choices[], wxWindow *parent = (wxWindow *) NULL,
|
1998-07-04 15:17:59 +00:00
|
|
|
int x = -1, int y = -1, bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
// Return client data instead
|
1999-10-24 20:42:35 +00:00
|
|
|
WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
|
|
|
int n, const wxString *choices, void **client_data,
|
1998-08-23 03:22:56 +00:00
|
|
|
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
|
1998-07-04 15:17:59 +00:00
|
|
|
bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-10-24 20:42:35 +00:00
|
|
|
WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
|
|
|
int n, wxChar *choices[], void **client_data,
|
1998-08-23 03:22:56 +00:00
|
|
|
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
|
1998-07-04 15:17:59 +00:00
|
|
|
bool centre = TRUE,
|
|
|
|
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
/*
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT int wxGetMultipleChoice(const wxString& message, const wxString& caption,
|
1998-07-04 15:17:59 +00: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 14:01:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#endif
|