1998-05-22 19:57:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dialogs.h
|
|
|
|
// Purpose: Common dialogs demo
|
|
|
|
// Author: Julian Smart
|
2004-06-11 20:43:45 +00:00
|
|
|
// Modified by: ABX (2004) - adjustementd for conditional building
|
1998-05-22 19:57:05 +00:00
|
|
|
// Created: 04/01/98
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 11:55:54 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
1999-07-22 23:39:47 +00:00
|
|
|
// Licence: wxWindows license
|
1998-05-22 19:57:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __DIALOGSH__
|
|
|
|
#define __DIALOGSH__
|
|
|
|
|
2004-06-11 20:43:45 +00:00
|
|
|
#define USE_COLOURDLG_GENERIC \
|
|
|
|
( \
|
|
|
|
wxUSE_COLOURDLG && \
|
2004-06-15 14:39:38 +00:00
|
|
|
( defined(__WXMSW__) || defined(__WXMAC__) ) && \
|
2004-06-11 20:43:45 +00:00
|
|
|
!defined(__WXUNIVERSAL__) \
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2004-06-16 15:03:44 +00:00
|
|
|
#define USE_DIRDLG_GENERIC \
|
2004-06-11 20:43:45 +00:00
|
|
|
( \
|
2004-06-16 15:03:44 +00:00
|
|
|
wxUSE_DIRDLG && \
|
|
|
|
( defined(__WXMSW__) || defined(__WXMAC__) ) && \
|
2004-06-15 14:39:38 +00:00
|
|
|
!defined(__WXUNIVERSAL__) \
|
|
|
|
)
|
|
|
|
|
2004-06-16 15:03:44 +00:00
|
|
|
#define USE_FILEDLG_GENERIC \
|
2004-06-15 14:39:38 +00:00
|
|
|
( \
|
2004-06-16 15:03:44 +00:00
|
|
|
wxUSE_FILEDLG && \
|
|
|
|
( defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXPM__) ) && \
|
|
|
|
!defined(__WXUNIVERSAL__) \
|
|
|
|
)
|
|
|
|
|
|
|
|
#define USE_FONTDLG_GENERIC \
|
|
|
|
( \
|
|
|
|
wxUSE_FONTDLG && \
|
|
|
|
( defined(__WXMSW__) || defined(__WXPM__) ) && \
|
2004-06-11 20:43:45 +00:00
|
|
|
!defined(__WXUNIVERSAL__) \
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
#define USE_MODAL_PRESENTATION 1
|
|
|
|
|
1998-05-22 19:57:05 +00:00
|
|
|
// Define a new application type
|
|
|
|
class MyApp: public wxApp
|
1999-07-22 23:39:47 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool OnInit();
|
1998-05-22 19:57:05 +00:00
|
|
|
|
|
|
|
wxFont m_canvasFont;
|
|
|
|
wxColour m_canvasTextColour;
|
|
|
|
};
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// A custom modeless dialog
|
2000-01-30 01:33:02 +00:00
|
|
|
class MyModelessDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyModelessDialog(wxWindow *parent);
|
2000-02-25 02:20:44 +00:00
|
|
|
|
2001-08-20 23:01:17 +00:00
|
|
|
void OnButton(wxCommandEvent& event);
|
2000-02-25 02:20:44 +00:00
|
|
|
void OnClose(wxCloseEvent& event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
2000-01-30 01:33:02 +00:00
|
|
|
};
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// A custom modal dialog
|
|
|
|
class MyModalDialog : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyModalDialog(wxWindow *parent);
|
|
|
|
|
|
|
|
void OnButton(wxCommandEvent& event);
|
|
|
|
|
|
|
|
private:
|
2003-02-25 12:33:35 +00:00
|
|
|
wxButton *m_btnModal,
|
|
|
|
*m_btnModeless,
|
|
|
|
*m_btnDelete;
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
1998-05-22 19:57:05 +00:00
|
|
|
// Define a new frame type
|
|
|
|
class MyFrame: public wxFrame
|
1999-07-22 23:39:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2004-06-11 20:43:45 +00:00
|
|
|
MyFrame(wxWindow *parent, const wxString& title);
|
|
|
|
|
|
|
|
void MessageBox(wxCommandEvent& event);
|
1998-05-22 19:57:05 +00:00
|
|
|
|
2004-06-11 20:43:45 +00:00
|
|
|
#if wxUSE_COLOURDLG
|
1999-07-03 16:40:54 +00:00
|
|
|
void ChooseColour(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_COLOURDLG
|
|
|
|
|
|
|
|
#if wxUSE_FONTDLG
|
1999-07-03 16:40:54 +00:00
|
|
|
void ChooseFont(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_FONTDLG
|
|
|
|
|
|
|
|
#if wxUSE_LOG_DIALOG
|
2000-01-21 02:31:49 +00:00
|
|
|
void LogDialog(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_LOG_DIALOG
|
|
|
|
|
|
|
|
#if wxUSE_CHOICEDLG
|
1998-05-22 19:57:05 +00:00
|
|
|
void SingleChoice(wxCommandEvent& event);
|
2000-11-03 20:52:17 +00:00
|
|
|
void MultiChoice(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_CHOICEDLG
|
|
|
|
|
|
|
|
#if wxUSE_TEXTDLG
|
1998-05-22 19:57:05 +00:00
|
|
|
void TextEntry(wxCommandEvent& event);
|
2000-01-24 18:26:54 +00:00
|
|
|
void PasswordEntry(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_TEXTDLG
|
|
|
|
|
|
|
|
#if wxUSE_NUMBERDLG
|
1999-07-22 23:39:47 +00:00
|
|
|
void NumericEntry(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_NUMBERDLG
|
|
|
|
|
|
|
|
#if wxUSE_FILEDLG
|
1998-05-22 19:57:05 +00:00
|
|
|
void FileOpen(wxCommandEvent& event);
|
2000-08-23 22:47:33 +00:00
|
|
|
void FileOpen2(wxCommandEvent& event);
|
1999-12-07 00:48:45 +00:00
|
|
|
void FilesOpen(wxCommandEvent& event);
|
1998-05-22 19:57:05 +00:00
|
|
|
void FileSave(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_FILEDLG
|
|
|
|
|
2004-06-16 15:03:44 +00:00
|
|
|
#if USE_FILEDLG_GENERIC
|
|
|
|
void FileOpenGeneric(wxCommandEvent& event);
|
|
|
|
void FilesOpenGeneric(wxCommandEvent& event);
|
|
|
|
void FileSaveGeneric(wxCommandEvent& event);
|
|
|
|
#endif // USE_FILEDLG_GENERIC
|
|
|
|
|
2004-06-11 20:43:45 +00:00
|
|
|
#if wxUSE_DIRDLG
|
1998-05-22 19:57:05 +00:00
|
|
|
void DirChoose(wxCommandEvent& event);
|
2003-02-01 22:51:07 +00:00
|
|
|
void DirChooseNew(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_DIRDLG
|
|
|
|
|
|
|
|
#if USE_DIRDLG_GENERIC
|
2000-07-23 19:10:27 +00:00
|
|
|
void GenericDirChoose(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // USE_DIRDLG_GENERIC
|
|
|
|
|
|
|
|
#if wxUSE_STARTUP_TIPS
|
1999-06-28 21:39:49 +00:00
|
|
|
void ShowTip(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_STARTUP_TIPS
|
|
|
|
|
|
|
|
#if USE_MODAL_PRESENTATION
|
2000-07-15 19:51:35 +00:00
|
|
|
void ModalDlg(wxCommandEvent& event);
|
2000-01-30 01:33:02 +00:00
|
|
|
void ModelessDlg(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // USE_MODAL_PRESENTATION
|
|
|
|
|
2001-08-01 02:29:35 +00:00
|
|
|
#if wxUSE_PROGRESSDLG
|
2000-02-25 02:20:44 +00:00
|
|
|
void ShowProgress(wxCommandEvent& event);
|
2001-08-01 02:29:35 +00:00
|
|
|
#endif // wxUSE_PROGRESSDLG
|
2004-06-11 20:43:45 +00:00
|
|
|
|
2001-10-29 13:21:29 +00:00
|
|
|
#if wxUSE_BUSYINFO
|
|
|
|
void ShowBusyInfo(wxCommandEvent& event);
|
|
|
|
#endif // wxUSE_BUSYINFO
|
2004-06-11 20:43:45 +00:00
|
|
|
|
2001-08-01 02:29:35 +00:00
|
|
|
#if wxUSE_FINDREPLDLG
|
|
|
|
void ShowFindDialog(wxCommandEvent& event);
|
|
|
|
void ShowReplaceDialog(wxCommandEvent& event);
|
|
|
|
void OnFindDialog(wxFindDialogEvent& event);
|
|
|
|
#endif // wxUSE_FINDREPLDLG
|
1998-05-22 19:57:05 +00:00
|
|
|
|
2004-06-11 20:43:45 +00:00
|
|
|
#if USE_COLOURDLG_GENERIC
|
1999-07-03 16:40:54 +00:00
|
|
|
void ChooseColourGeneric(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // USE_COLOURDLG_GENERIC
|
|
|
|
|
|
|
|
#if USE_FONTDLG_GENERIC
|
1999-07-03 16:40:54 +00:00
|
|
|
void ChooseFontGeneric(wxCommandEvent& event);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // USE_FONTDLG_GENERIC
|
1999-07-22 23:39:47 +00:00
|
|
|
|
1999-07-03 16:40:54 +00:00
|
|
|
void OnExit(wxCommandEvent& event);
|
1999-07-22 23:39:47 +00:00
|
|
|
|
2000-01-30 01:33:02 +00:00
|
|
|
private:
|
2004-06-11 20:43:45 +00:00
|
|
|
#if wxUSE_DIRDLG
|
2003-02-01 22:51:07 +00:00
|
|
|
void DoDirChoose(int style);
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // wxUSE_DIRDLG
|
2003-02-01 22:51:07 +00:00
|
|
|
|
2004-06-11 20:43:45 +00:00
|
|
|
#if USE_MODAL_PRESENTATION
|
2000-01-30 01:33:02 +00:00
|
|
|
MyModelessDialog *m_dialog;
|
2004-06-11 20:43:45 +00:00
|
|
|
#endif // USE_MODAL_PRESENTATION
|
2000-01-30 01:33:02 +00:00
|
|
|
|
2001-08-01 02:29:35 +00:00
|
|
|
#if wxUSE_FINDREPLDLG
|
|
|
|
wxFindReplaceData m_findData;
|
2001-11-18 23:06:43 +00:00
|
|
|
|
|
|
|
wxFindReplaceDialog *m_dlgFind,
|
|
|
|
*m_dlgReplace;
|
2001-08-01 02:29:35 +00:00
|
|
|
#endif // wxUSE_FINDREPLDLG
|
|
|
|
|
2004-06-04 15:57:12 +00:00
|
|
|
wxColourData m_clrData;
|
|
|
|
|
2000-01-30 01:33:02 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-22 19:57:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class MyCanvas: public wxScrolledWindow
|
|
|
|
{
|
1999-07-22 23:39:47 +00:00
|
|
|
public:
|
2002-03-28 18:57:50 +00:00
|
|
|
MyCanvas(wxWindow *parent) :
|
2004-06-11 20:43:45 +00:00
|
|
|
wxScrolledWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxNO_FULL_REPAINT_ON_RESIZE) { }
|
1999-07-22 23:39:47 +00:00
|
|
|
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-22 19:57:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Menu IDs
|
2000-01-24 18:26:54 +00:00
|
|
|
enum
|
|
|
|
{
|
2004-06-11 20:43:45 +00:00
|
|
|
DIALOGS_CHOOSE_COLOUR = wxID_HIGHEST,
|
2000-01-24 18:26:54 +00:00
|
|
|
DIALOGS_CHOOSE_COLOUR_GENERIC,
|
|
|
|
DIALOGS_CHOOSE_FONT,
|
|
|
|
DIALOGS_CHOOSE_FONT_GENERIC,
|
|
|
|
DIALOGS_MESSAGE_BOX,
|
|
|
|
DIALOGS_SINGLE_CHOICE,
|
2000-11-03 20:52:17 +00:00
|
|
|
DIALOGS_MULTI_CHOICE,
|
2000-01-24 18:26:54 +00:00
|
|
|
DIALOGS_TEXT_ENTRY,
|
|
|
|
DIALOGS_PASSWORD_ENTRY,
|
|
|
|
DIALOGS_FILE_OPEN,
|
2000-08-23 22:47:33 +00:00
|
|
|
DIALOGS_FILE_OPEN2,
|
2000-01-24 18:26:54 +00:00
|
|
|
DIALOGS_FILES_OPEN,
|
|
|
|
DIALOGS_FILE_SAVE,
|
2004-06-16 15:03:44 +00:00
|
|
|
DIALOGS_FILE_OPEN_GENERIC,
|
|
|
|
DIALOGS_FILES_OPEN_GENERIC,
|
|
|
|
DIALOGS_FILE_SAVE_GENERIC,
|
2000-01-24 18:26:54 +00:00
|
|
|
DIALOGS_DIR_CHOOSE,
|
2003-02-01 22:51:07 +00:00
|
|
|
DIALOGS_DIRNEW_CHOOSE,
|
2000-07-23 19:10:27 +00:00
|
|
|
DIALOGS_GENERIC_DIR_CHOOSE,
|
2000-01-24 18:26:54 +00:00
|
|
|
DIALOGS_TIP,
|
|
|
|
DIALOGS_NUM_ENTRY,
|
2000-01-30 01:33:02 +00:00
|
|
|
DIALOGS_LOG_DIALOG,
|
2000-07-15 19:51:35 +00:00
|
|
|
DIALOGS_MODAL,
|
2000-01-30 01:33:02 +00:00
|
|
|
DIALOGS_MODELESS,
|
2000-02-25 02:20:44 +00:00
|
|
|
DIALOGS_MODELESS_BTN,
|
2001-08-01 02:29:35 +00:00
|
|
|
DIALOGS_PROGRESS,
|
2001-10-29 13:21:29 +00:00
|
|
|
DIALOGS_BUSYINFO,
|
2001-08-01 02:29:35 +00:00
|
|
|
DIALOGS_FIND,
|
|
|
|
DIALOGS_REPLACE
|
2000-01-24 18:26:54 +00:00
|
|
|
};
|
1998-05-22 19:57:05 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|