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)
|
1999-06-28 17:39:49 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __CHOICEDLGH_G__
|
|
|
|
#define __CHOICEDLGH_G__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-06-25 17:28:25 -04:00
|
|
|
#pragma interface "choicdgg.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/dialog.h"
|
1999-10-23 19:40:55 -04:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxListBox;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
#define wxCHOICE_HEIGHT 150
|
|
|
|
#define wxCHOICE_WIDTH 200
|
|
|
|
|
1999-08-17 08:31:34 -04:00
|
|
|
#define wxCHOICEDLG_STYLE (wxDEFAULT_DIALOG_STYLE|wxOK | wxCANCEL | wxCENTRE)
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxSingleChoiceDialog: public wxDialog
|
|
|
|
{
|
1999-06-25 17:28:25 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxSingleChoiceDialog)
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
public:
|
1999-06-25 17:28:25 -04: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 10:01:55 -04:00
|
|
|
|
1999-10-26 09:54:58 -04:00
|
|
|
void SetSelection(int sel);
|
1999-06-25 17:28:25 -04:00
|
|
|
int GetSelection() const { return m_selection; }
|
|
|
|
wxString GetStringSelection() const { return m_stringSelection; }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-06-25 17:28:25 -04:00
|
|
|
// obsolete function (NB: no need to make it return wxChar, it's untyped)
|
|
|
|
char *GetSelectionClientData() const { return (char *)m_clientData; }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-06-25 17:28:25 -04:00
|
|
|
// implementation from now on
|
1998-05-20 10:01:55 -04:00
|
|
|
void OnOK(wxCommandEvent& event);
|
1998-07-04 11:17:59 -04:00
|
|
|
void OnListBoxDClick(wxCommandEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int m_selection;
|
2000-01-05 10:35:04 -05:00
|
|
|
long m_dialogStyle;
|
1998-05-20 10:01:55 -04:00
|
|
|
wxString m_stringSelection;
|
1999-06-25 17:28:25 -04:00
|
|
|
wxListBox *m_listbox;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
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, 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,
|
1999-04-12 18:20:19 -04:00
|
|
|
int n, wxChar *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,
|
1999-04-12 18:20:19 -04:00
|
|
|
int n, wxChar *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
|
1999-10-24 16:42:35 -04:00
|
|
|
WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
|
|
|
int n, const wxString *choices, void **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
|
|
|
|
1999-10-24 16:42:35 -04:00
|
|
|
WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
|
|
|
int n, wxChar *choices[], void **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
|