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-07-04 11:17:59 -04:00
|
|
|
int n, const wxString *choices, char **clientData = 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,
|
|
|
|
const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent, const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, const wxString *choices, char **clientData = 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,
|
|
|
|
const wxStringList& choices, char **clientData = NULL, long style = wxOK|wxCANCEL|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, const wxString *choices, 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
|
|
|
|
|
|
|
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, char *choices[], 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
|
|
|
|
|
|
|
// Same as above but gets position in list of strings, instead of string,
|
|
|
|
// or -1 if no selection
|
|
|
|
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, const wxString *choices, 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
|
|
|
|
|
|
|
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, char *choices[], 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
|
|
|
|
|
|
|
// Return client data instead
|
|
|
|
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, const wxString *choices, char **client_data,
|
|
|
|
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
|
|
|
|
|
|
|
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
|
1998-07-04 11:17:59 -04:00
|
|
|
int n, char *choices[], char **client_data,
|
|
|
|
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
|
|
|
/*
|
|
|
|
int WXDLLEXPORT 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
|