]> git.saurik.com Git - wxWidgets.git/blob - include/wx/dialog.h
switched to using wxPopupWindow
[wxWidgets.git] / include / wx / dialog.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dialog.h
3 // Purpose: wxDialogBase class
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 29.06.99
7 // RCS-ID: $Id$
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DIALOG_H_BASE_
13 #define _WX_DIALOG_H_BASE_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "dialogbase.h"
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/containr.h"
21 #include "wx/toplevel.h"
22
23 class WXDLLEXPORT wxSizer;
24 class WXDLLEXPORT wxStdDialogButtonSizer;
25
26 #define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window
27
28 #ifdef __WXWINCE__
29 # ifdef __SMARTPHONE__
30 # define wxDEFAULT_DIALOG_STYLE (wxMAXIMIZE | wxCAPTION)
31 # else
32 # define wxDEFAULT_DIALOG_STYLE (0)
33 # endif
34 #else // !__WXWINCE__
35 # define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX)
36 #endif
37
38 WXDLLEXPORT_DATA(extern const wxChar*) wxDialogNameStr;
39
40 class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow
41 {
42 public:
43 wxDialogBase() { Init(); }
44 virtual ~wxDialogBase() { }
45
46 void Init();
47
48 // the modal dialogs have a return code - usually the id of the last
49 // pressed button
50 void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
51 int GetReturnCode() const { return m_returnCode; }
52
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
58
59 #if wxUSE_BUTTON
60 // places buttons into a horizontal wxBoxSizer
61 wxSizer *CreateButtonSizer( long flags );
62 wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags );
63 #endif // wxUSE_BUTTON
64
65 protected:
66 // the return code from modal dialog
67 int m_returnCode;
68
69 DECLARE_NO_COPY_CLASS(wxDialogBase)
70 DECLARE_EVENT_TABLE()
71 WX_DECLARE_CONTROL_CONTAINER();
72 };
73
74
75 #if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
76 #include "wx/univ/dialog.h"
77 #else
78 #if defined(__WXPALMOS__)
79 #include "wx/palmos/dialog.h"
80 #elif defined(__WXMSW__)
81 #include "wx/msw/dialog.h"
82 #elif defined(__WXMOTIF__)
83 #include "wx/motif/dialog.h"
84 #elif defined(__WXGTK__)
85 #include "wx/gtk/dialog.h"
86 #elif defined(__WXMAC__)
87 #include "wx/mac/dialog.h"
88 #elif defined(__WXCOCOA__)
89 #include "wx/cocoa/dialog.h"
90 #elif defined(__WXPM__)
91 #include "wx/os2/dialog.h"
92 #endif
93 #endif
94
95 #endif
96 // _WX_DIALOG_H_BASE_