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_
16 #include "wx/containr.h"
17 #include "wx/toplevel.h"
19 class WXDLLEXPORT wxSizer
;
20 class WXDLLEXPORT wxStdDialogButtonSizer
;
22 #define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window
25 #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER)
27 #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX)
30 extern WXDLLEXPORT_DATA(const wxChar
*) wxDialogNameStr
;
32 class WXDLLEXPORT wxDialogBase
: public wxTopLevelWindow
35 wxDialogBase() { Init(); }
36 virtual ~wxDialogBase() { }
40 // Modal dialogs have a return code - usually the id of the last
42 void SetReturnCode(int returnCode
) { m_returnCode
= returnCode
; }
43 int GetReturnCode() const { return m_returnCode
; }
45 // The identifier for the affirmative button
46 void SetAffirmativeId(int affirmativeId
) { m_affirmativeId
= affirmativeId
; }
47 int GetAffirmativeId() const { return m_affirmativeId
; }
49 // Identifier for Esc key translation
50 #if wxCHECK_VERSION(2, 7, 0)
51 #error "Uncomment SetEscapeId() implementation"
53 // this is what we should do in 2.7: remove the "#else" part and add
54 // m_escapeId declaration and the docs for Set/GetEscapeId()
55 void SetEscapeId(int escapeId
) { m_escapeId
= escapeId
; }
56 int GetEscapeId() const { return m_escapeId
; }
57 #elif wxABI_VERSION > 20601
58 // just a stub for 2.6
59 int GetEscapeId() const { return wxID_ANY
; }
62 #if wxUSE_STATTEXT // && wxUSE_TEXTCTRL
63 // splits text up at newlines and places the
64 // lines into a vertical wxBoxSizer
65 wxSizer
*CreateTextSizer( const wxString
&message
);
66 #endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL
69 // places buttons into a horizontal wxBoxSizer
70 wxSizer
*CreateButtonSizer( long flags
);
71 wxStdDialogButtonSizer
*CreateStdDialogButtonSizer( long flags
);
72 #endif // wxUSE_BUTTON
75 // The return code from modal dialog
78 // The identifier for the affirmative button (usually wxID_OK)
81 DECLARE_NO_COPY_CLASS(wxDialogBase
)
83 WX_DECLARE_CONTROL_CONTAINER();
87 #if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
88 #include "wx/univ/dialog.h"
90 #if defined(__WXPALMOS__)
91 #include "wx/palmos/dialog.h"
92 #elif defined(__WXMSW__)
93 #include "wx/msw/dialog.h"
94 #elif defined(__WXMOTIF__)
95 #include "wx/motif/dialog.h"
96 #elif defined(__WXGTK__)
97 #include "wx/gtk/dialog.h"
98 #elif defined(__WXMAC__)
99 #include "wx/mac/dialog.h"
100 #elif defined(__WXCOCOA__)
101 #include "wx/cocoa/dialog.h"
102 #elif defined(__WXPM__)
103 #include "wx/os2/dialog.h"
108 // _WX_DIALOG_H_BASE_