X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/654e324628ea1efc6dff6e5b494129931115f773..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/dialog.h diff --git a/include/wx/dialog.h b/include/wx/dialog.h index d105144618..95e6b6f99e 100644 --- a/include/wx/dialog.h +++ b/include/wx/dialog.h @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 29.06.99 -// RCS-ID: $Id$ // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -12,8 +11,8 @@ #ifndef _WX_DIALOG_H_BASE_ #define _WX_DIALOG_H_BASE_ -#include "wx/defs.h" #include "wx/toplevel.h" +#include "wx/containr.h" class WXDLLIMPEXP_FWD_CORE wxSizer; class WXDLLIMPEXP_FWD_CORE wxStdDialogButtonSizer; @@ -22,10 +21,11 @@ class WXDLLIMPEXP_FWD_CORE wxDialogLayoutAdapter; class WXDLLIMPEXP_FWD_CORE wxDialog; class WXDLLIMPEXP_FWD_CORE wxButton; class WXDLLIMPEXP_FWD_CORE wxScrolledWindow; +class wxTextSizerWrapper; // Also see the bit summary table in wx/toplevel.h. -#define wxDIALOG_NO_PARENT 0x0100 // Don't make owned by apps top window +#define wxDIALOG_NO_PARENT 0x00000020 // Don't make owned by apps top window #ifdef __WXWINCE__ #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER) @@ -64,10 +64,10 @@ enum wxDialogModality extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr[]; -class WXDLLIMPEXP_CORE wxDialogBase : public wxTopLevelWindow +class WXDLLIMPEXP_CORE wxDialogBase : public wxNavigationEnabled { public: - wxDialogBase() { Init(); } + wxDialogBase(); virtual ~wxDialogBase() { } // define public wxDialog methods to be implemented by the derived classes @@ -115,9 +115,14 @@ public: } #if wxUSE_STATTEXT // && wxUSE_TEXTCTRL - // splits text up at newlines and places the - // lines into a vertical wxBoxSizer - wxSizer *CreateTextSizer( const wxString &message ); + // splits text up at newlines and places the lines into a vertical + // wxBoxSizer + wxSizer *CreateTextSizer( const wxString& message ); + + // same as above but uses a customized wxTextSizerWrapper to create + // non-standard controls for the lines + wxSizer *CreateTextSizer( const wxString& message, + wxTextSizerWrapper& wrapper ); #endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL // returns a horizontal wxBoxSizer containing the given buttons @@ -127,9 +132,16 @@ public: // platforms which have hardware buttons replacing OK/Cancel and such) wxSizer *CreateButtonSizer(long flags); + // returns a sizer containing the given one and a static line separating it + // from the preceding elements if it's appropriate for the current platform + wxSizer *CreateSeparatedSizer(wxSizer *sizer); + // returns the sizer containing CreateButtonSizer() below a separating // static line for the platforms which use static lines for items // separation (i.e. not Mac) + // + // this is just a combination of CreateButtonSizer() and + // CreateSeparatedSizer() wxSizer *CreateSeparatedButtonSizer(long flags); #if wxUSE_BUTTON @@ -229,13 +241,17 @@ protected: static bool sm_layoutAdaptation; private: - // common part of all ctors - void Init(); - // helper of GetParentForModalDialog(): returns the passed in window if it // can be used as our parent or NULL if it can't wxWindow *CheckIfCanBeUsedAsParent(wxWindow *parent) const; + // Helper of OnCharHook() and OnCloseWindow(): find the appropriate button + // for closing the dialog and send a click event for it. + // + // Return true if we found a button to close the dialog and "clicked" it or + // false otherwise. + bool SendCloseButtonClickEvent(); + // handle Esc key presses void OnCharHook(wxKeyEvent& event); @@ -297,6 +313,7 @@ public: // Create the scrolled window virtual wxScrolledWindow* CreateScrolledWindow(wxWindow* parent); +#if wxUSE_BUTTON // Find a standard or horizontal box sizer virtual wxSizer* FindButtonSizer(bool stdButtonSizer, wxDialog* dialog, wxSizer* sizer, int& retBorder, int accumlatedBorder = 0); @@ -308,6 +325,7 @@ public: // Find 'loose' main buttons in the existing layout and add them to the standard dialog sizer virtual bool FindLooseButtons(wxDialog* dialog, wxStdDialogButtonSizer* buttonSizer, wxSizer* sizer, int& count); +#endif // wxUSE_BUTTON // Reparent the controls to the scrolled window, except those in buttonSizer virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL); @@ -328,9 +346,7 @@ public: #if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__) #include "wx/univ/dialog.h" #else - #if defined(__WXPALMOS__) - #include "wx/palmos/dialog.h" - #elif defined(__WXMSW__) + #if defined(__WXMSW__) #include "wx/msw/dialog.h" #elif defined(__WXMOTIF__) #include "wx/motif/dialog.h" @@ -372,5 +388,8 @@ typedef void (wxEvtHandler::*wxWindowModalDialogEventFunction)(wxWindowModalDial #define wxWindowModalDialogEventHandler(func) \ wxEVENT_HANDLER_CAST(wxWindowModalDialogEventFunction, func) +#define EVT_WINDOW_MODAL_DIALOG_CLOSED(winid, func) \ + wx__DECLARE_EVT1(wxEVT_WINDOW_MODAL_DIALOG_CLOSED, winid, wxWindowModalDialogEventHandler(func)) + #endif // _WX_DIALOG_H_BASE_