X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ddbfcced85b54ed15ff40605d29e55d73d0e6d03..259c43f679ca655362b5a439e11c87fc0666d663:/include/wx/dialog.h diff --git a/include/wx/dialog.h b/include/wx/dialog.h index 5324bc17bb..ac1e23f9cc 100644 --- a/include/wx/dialog.h +++ b/include/wx/dialog.h @@ -12,14 +12,23 @@ #ifndef _WX_DIALOG_H_BASE_ #define _WX_DIALOG_H_BASE_ -#if defined(__GNUG__) && !defined(__APPLE__) - #pragma interface "dialogbase.h" -#endif - #include "wx/defs.h" #include "wx/containr.h" #include "wx/toplevel.h" +class WXDLLEXPORT wxSizer; +class WXDLLEXPORT wxStdDialogButtonSizer; + +#define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window + +#ifdef __WXWINCE__ +#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER) +#else +#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX) +#endif + +extern WXDLLEXPORT_DATA(const wxChar*) wxDialogNameStr; + class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow { public: @@ -28,26 +37,48 @@ public: void Init(); - // the modal dialogs have a return code - usually the id of the last + // Modal dialogs have a return code - usually the id of the last // pressed button void SetReturnCode(int returnCode) { m_returnCode = returnCode; } int GetReturnCode() const { return m_returnCode; } -#if wxUSE_STATTEXT && wxUSE_TEXTCTRL + // The identifier for the affirmative button + void SetAffirmativeId(int affirmativeId) { m_affirmativeId = affirmativeId; } + int GetAffirmativeId() const { return m_affirmativeId; } + + // Identifier for Esc key translation +#if wxCHECK_VERSION(2, 7, 0) + #error "Uncomment SetEscapeId() implementation" + + // this is what we should do in 2.7: remove the "#else" part and add + // m_escapeId declaration and the docs for Set/GetEscapeId() + void SetEscapeId(int escapeId) { m_escapeId = escapeId; } + int GetEscapeId() const { return m_escapeId; } +#elif wxABI_VERSION > 20601 + // just a stub for 2.6 + int GetEscapeId() const { return wxID_ANY; } +#endif + +#if wxUSE_STATTEXT // && wxUSE_TEXTCTRL // splits text up at newlines and places the // lines into a vertical wxBoxSizer wxSizer *CreateTextSizer( const wxString &message ); -#endif // wxUSE_STATTEXT && wxUSE_TEXTCTRL +#endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL #if wxUSE_BUTTON // places buttons into a horizontal wxBoxSizer wxSizer *CreateButtonSizer( long flags ); + wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags ); #endif // wxUSE_BUTTON protected: - // the return code from modal dialog + // The return code from modal dialog int m_returnCode; + // The identifier for the affirmative button (usually wxID_OK) + int m_affirmativeId; + + DECLARE_NO_COPY_CLASS(wxDialogBase) DECLARE_EVENT_TABLE() WX_DECLARE_CONTROL_CONTAINER(); }; @@ -56,7 +87,9 @@ protected: #if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__) #include "wx/univ/dialog.h" #else - #if defined(__WXMSW__) + #if defined(__WXPALMOS__) + #include "wx/palmos/dialog.h" + #elif defined(__WXMSW__) #include "wx/msw/dialog.h" #elif defined(__WXMOTIF__) #include "wx/motif/dialog.h" @@ -64,6 +97,8 @@ protected: #include "wx/gtk/dialog.h" #elif defined(__WXMAC__) #include "wx/mac/dialog.h" + #elif defined(__WXCOCOA__) + #include "wx/cocoa/dialog.h" #elif defined(__WXPM__) #include "wx/os2/dialog.h" #endif