1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialogBase class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DIALOG_H_BASE_
13 #define _WX_DIALOG_H_BASE_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "dialogbase.h"
20 #include "wx/containr.h"
21 #include "wx/toplevel.h"
23 class WXDLLEXPORT wxSizer
;
24 class WXDLLEXPORT wxStdDialogButtonSizer
;
26 #define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window
29 #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER)
31 #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX)
34 extern WXDLLEXPORT_DATA(const wxChar
*) wxDialogNameStr
;
36 class WXDLLEXPORT wxDialogBase
: public wxTopLevelWindow
39 wxDialogBase() { Init(); }
40 virtual ~wxDialogBase() { }
44 // Modal dialogs have a return code - usually the id of the last
46 void SetReturnCode(int returnCode
) { m_returnCode
= returnCode
; }
47 int GetReturnCode() const { return m_returnCode
; }
49 // The identifier for the affirmative button
50 void SetAffirmativeId(int affirmativeId
) { m_affirmativeId
= affirmativeId
; }
51 int GetAffirmativeId() const { return m_affirmativeId
; }
53 #if wxUSE_STATTEXT // && wxUSE_TEXTCTRL
54 // splits text up at newlines and places the
55 // lines into a vertical wxBoxSizer
56 wxSizer
*CreateTextSizer( const wxString
&message
);
57 #endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL
60 // places buttons into a horizontal wxBoxSizer
61 wxSizer
*CreateButtonSizer( long flags
);
62 wxStdDialogButtonSizer
*CreateStdDialogButtonSizer( long flags
);
63 #endif // wxUSE_BUTTON
66 // The return code from modal dialog
69 // The identifier for the affirmative button (usually wxID_OK)
72 DECLARE_NO_COPY_CLASS(wxDialogBase
)
74 WX_DECLARE_CONTROL_CONTAINER();
78 #if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
79 #include "wx/univ/dialog.h"
81 #if defined(__WXPALMOS__)
82 #include "wx/palmos/dialog.h"
83 #elif defined(__WXMSW__)
84 #include "wx/msw/dialog.h"
85 #elif defined(__WXMOTIF__)
86 #include "wx/motif/dialog.h"
87 #elif defined(__WXGTK__)
88 #include "wx/gtk/dialog.h"
89 #elif defined(__WXMAC__)
90 #include "wx/mac/dialog.h"
91 #elif defined(__WXCOCOA__)
92 #include "wx/cocoa/dialog.h"
93 #elif defined(__WXPM__)
94 #include "wx/os2/dialog.h"