]> git.saurik.com Git - wxWidgets.git/blob - include/wx/dialog.h
Warning fix.
[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 #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER)
30 #else
31 #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX)
32 #endif
33
34 extern WXDLLEXPORT_DATA(const wxChar*) wxDialogNameStr;
35
36 class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow
37 {
38 public:
39 wxDialogBase() { Init(); }
40 virtual ~wxDialogBase() { }
41
42 void Init();
43
44 // Modal dialogs have a return code - usually the id of the last
45 // pressed button
46 void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
47 int GetReturnCode() const { return m_returnCode; }
48
49 // The identifier for the affirmative button
50 void SetAffirmativeId(int affirmativeId) { m_affirmativeId = affirmativeId; }
51 int GetAffirmativeId() const { return m_affirmativeId; }
52
53 // Identifier for Esc key translation
54 #if wxCHECK_VERSION(2, 7, 0)
55 #error "Uncomment SetEscapeId() implementation"
56
57 // this is what we should do in 2.7: remove the "#else" part and add
58 // m_escapeId declaration and the docs for Set/GetEscapeId()
59 void SetEscapeId(int escapeId) { m_escapeId = escapeId; }
60 int GetEscapeId() const { return m_escapeId; }
61 #elif wxABI_VERSION > 20601
62 // just a stub for 2.6
63 int GetEscapeId() const { return wxID_ANY; }
64 #endif
65
66 #if wxUSE_STATTEXT // && wxUSE_TEXTCTRL
67 // splits text up at newlines and places the
68 // lines into a vertical wxBoxSizer
69 wxSizer *CreateTextSizer( const wxString &message );
70 #endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL
71
72 #if wxUSE_BUTTON
73 // places buttons into a horizontal wxBoxSizer
74 wxSizer *CreateButtonSizer( long flags );
75 wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags );
76 #endif // wxUSE_BUTTON
77
78 protected:
79 // The return code from modal dialog
80 int m_returnCode;
81
82 // The identifier for the affirmative button (usually wxID_OK)
83 int m_affirmativeId;
84
85 DECLARE_NO_COPY_CLASS(wxDialogBase)
86 DECLARE_EVENT_TABLE()
87 WX_DECLARE_CONTROL_CONTAINER();
88 };
89
90
91 #if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
92 #include "wx/univ/dialog.h"
93 #else
94 #if defined(__WXPALMOS__)
95 #include "wx/palmos/dialog.h"
96 #elif defined(__WXMSW__)
97 #include "wx/msw/dialog.h"
98 #elif defined(__WXMOTIF__)
99 #include "wx/motif/dialog.h"
100 #elif defined(__WXGTK__)
101 #include "wx/gtk/dialog.h"
102 #elif defined(__WXMAC__)
103 #include "wx/mac/dialog.h"
104 #elif defined(__WXCOCOA__)
105 #include "wx/cocoa/dialog.h"
106 #elif defined(__WXPM__)
107 #include "wx/os2/dialog.h"
108 #endif
109 #endif
110
111 #endif
112 // _WX_DIALOG_H_BASE_