X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9482c64466359ec7cfd201bebc3399ac4a56b4e6..8d2c70414cc0c6b93147d0c0cc963f217fcb2023:/include/wx/osx/dialog.h diff --git a/include/wx/osx/dialog.h b/include/wx/osx/dialog.h index 2544d290bb..9442b94373 100644 --- a/include/wx/osx/dialog.h +++ b/include/wx/osx/dialog.h @@ -17,6 +17,7 @@ WXDLLIMPEXP_DATA_CORE(extern const char) wxDialogNameStr[]; class WXDLLIMPEXP_FWD_CORE wxMacToolTip ; +class WXDLLIMPEXP_FWD_CORE wxModalEventLoop ; // Dialog boxes class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase @@ -50,34 +51,47 @@ public: // virtual bool Destroy(); virtual bool Show(bool show = true); - void SetModal(bool flag); + // return true if we're showing the dialog modally virtual bool IsModal() const; - // For now, same as Show(TRUE) but returns return code + // show the dialog modally and return the value passed to EndModal() virtual int ShowModal(); virtual void ShowWindowModal(); // may be called to terminate the dialog with the given return code virtual void EndModal(int retCode); + + static bool OSXHasModalDialogsOpen(); + static void OSXBeginModalDialog(); + static void OSXEndModalDialog(); // implementation // -------------- - // show modal dialog and enter modal loop - void DoShowModal(); + wxDialogModality GetModality() const; + +#if wxOSX_USE_COCOA + virtual void ModalFinishedCallback(void* WXUNUSED(panel), int WXUNUSED(returnCode)) {} +#endif protected: + // show window modal dialog + void DoShowWindowModal(); + + // end window modal dialog. + void EndWindowModal(); + // mac also takes command-period as cancel virtual bool IsEscapeKey(const wxKeyEvent& event); - // needed for cleanup on the Cocoa side. - void EndWindowModal(); + + wxDialogModality m_modality; + + wxModalEventLoop* m_eventLoop; private: void Init(); - - bool m_isModalStyle; }; #endif