Reworked dialogs sample in the direction of fully working in not fully specified setup.h. Dedicated mainly for all those hard working on various port. Be happy with always working dialogs sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// Name: dialogs.h
|
||||
// Purpose: Common dialogs demo
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Modified by: ABX (2004) - adjustementd for conditional building
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
@@ -12,6 +12,25 @@
|
||||
#ifndef __DIALOGSH__
|
||||
#define __DIALOGSH__
|
||||
|
||||
#define USE_COLOURDLG_GENERIC \
|
||||
( \
|
||||
wxUSE_COLOURDLG && \
|
||||
( defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK20__) ) && \
|
||||
!defined(__WXUNIVERSAL__) \
|
||||
)
|
||||
|
||||
|
||||
#define USE_FONTDLG_GENERIC \
|
||||
( \
|
||||
wxUSE_FONTDLG && \
|
||||
( defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXPM__) ) && \
|
||||
!defined(__WXUNIVERSAL__) \
|
||||
)
|
||||
|
||||
#define USE_DIRDLG_GENERIC 0
|
||||
|
||||
#define USE_MODAL_PRESENTATION 1
|
||||
|
||||
// Define a new application type
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
@@ -55,52 +74,93 @@ private:
|
||||
class MyFrame: public wxFrame
|
||||
{
|
||||
public:
|
||||
MyFrame(wxWindow *parent, const wxString& title,
|
||||
const wxPoint& pos, const wxSize& size);
|
||||
MyFrame(wxWindow *parent, const wxString& title);
|
||||
|
||||
void ChooseColour(wxCommandEvent& event);
|
||||
void ChooseFont(wxCommandEvent& event);
|
||||
void LogDialog(wxCommandEvent& event);
|
||||
void MessageBox(wxCommandEvent& event);
|
||||
|
||||
#if wxUSE_COLOURDLG
|
||||
void ChooseColour(wxCommandEvent& event);
|
||||
#endif // wxUSE_COLOURDLG
|
||||
|
||||
#if wxUSE_FONTDLG
|
||||
void ChooseFont(wxCommandEvent& event);
|
||||
#endif // wxUSE_FONTDLG
|
||||
|
||||
#if wxUSE_LOG_DIALOG
|
||||
void LogDialog(wxCommandEvent& event);
|
||||
#endif // wxUSE_LOG_DIALOG
|
||||
|
||||
#if wxUSE_CHOICEDLG
|
||||
void SingleChoice(wxCommandEvent& event);
|
||||
void MultiChoice(wxCommandEvent& event);
|
||||
#endif // wxUSE_CHOICEDLG
|
||||
|
||||
#if wxUSE_TEXTDLG
|
||||
void TextEntry(wxCommandEvent& event);
|
||||
void PasswordEntry(wxCommandEvent& event);
|
||||
#endif // wxUSE_TEXTDLG
|
||||
|
||||
#if wxUSE_NUMBERDLG
|
||||
void NumericEntry(wxCommandEvent& event);
|
||||
#endif // wxUSE_NUMBERDLG
|
||||
|
||||
#if wxUSE_FILEDLG
|
||||
void FileOpen(wxCommandEvent& event);
|
||||
void FileOpen2(wxCommandEvent& event);
|
||||
void FilesOpen(wxCommandEvent& event);
|
||||
void FileSave(wxCommandEvent& event);
|
||||
#endif // wxUSE_FILEDLG
|
||||
|
||||
#if wxUSE_DIRDLG
|
||||
void DirChoose(wxCommandEvent& event);
|
||||
void DirChooseNew(wxCommandEvent& event);
|
||||
#endif // wxUSE_DIRDLG
|
||||
|
||||
#if USE_DIRDLG_GENERIC
|
||||
void GenericDirChoose(wxCommandEvent& event);
|
||||
#endif // USE_DIRDLG_GENERIC
|
||||
|
||||
#if wxUSE_STARTUP_TIPS
|
||||
void ShowTip(wxCommandEvent& event);
|
||||
#endif // wxUSE_STARTUP_TIPS
|
||||
|
||||
#if USE_MODAL_PRESENTATION
|
||||
void ModalDlg(wxCommandEvent& event);
|
||||
void ModelessDlg(wxCommandEvent& event);
|
||||
#endif // USE_MODAL_PRESENTATION
|
||||
|
||||
#if wxUSE_PROGRESSDLG
|
||||
void ShowProgress(wxCommandEvent& event);
|
||||
#endif // wxUSE_PROGRESSDLG
|
||||
|
||||
#if wxUSE_BUSYINFO
|
||||
void ShowBusyInfo(wxCommandEvent& event);
|
||||
#endif // wxUSE_BUSYINFO
|
||||
|
||||
#if wxUSE_FINDREPLDLG
|
||||
void ShowFindDialog(wxCommandEvent& event);
|
||||
void ShowReplaceDialog(wxCommandEvent& event);
|
||||
|
||||
void OnFindDialog(wxFindDialogEvent& event);
|
||||
#endif // wxUSE_FINDREPLDLG
|
||||
|
||||
#if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
|
||||
#if USE_COLOURDLG_GENERIC
|
||||
void ChooseColourGeneric(wxCommandEvent& event);
|
||||
#endif // USE_COLOURDLG_GENERIC
|
||||
|
||||
#if USE_FONTDLG_GENERIC
|
||||
void ChooseFontGeneric(wxCommandEvent& event);
|
||||
#endif
|
||||
#endif // USE_FONTDLG_GENERIC
|
||||
|
||||
void OnExit(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
#if wxUSE_DIRDLG
|
||||
void DoDirChoose(int style);
|
||||
#endif // wxUSE_DIRDLG
|
||||
|
||||
#if USE_MODAL_PRESENTATION
|
||||
MyModelessDialog *m_dialog;
|
||||
#endif // USE_MODAL_PRESENTATION
|
||||
|
||||
#if wxUSE_FINDREPLDLG
|
||||
wxFindReplaceData m_findData;
|
||||
@@ -118,7 +178,7 @@ class MyCanvas: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
MyCanvas(wxWindow *parent) :
|
||||
wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxNO_FULL_REPAINT_ON_RESIZE) { }
|
||||
wxScrolledWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxNO_FULL_REPAINT_ON_RESIZE) { }
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
@@ -129,7 +189,7 @@ public:
|
||||
// Menu IDs
|
||||
enum
|
||||
{
|
||||
DIALOGS_CHOOSE_COLOUR = 1,
|
||||
DIALOGS_CHOOSE_COLOUR = wxID_HIGHEST,
|
||||
DIALOGS_CHOOSE_COLOUR_GENERIC,
|
||||
DIALOGS_CHOOSE_FONT,
|
||||
DIALOGS_CHOOSE_FONT_GENERIC,
|
||||
|
Reference in New Issue
Block a user