]>
Commit | Line | Data |
---|---|---|
dfe1eee3 VZ |
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 | |
65571936 | 9 | // Licence: wxWindows licence |
dfe1eee3 VZ |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_DIALOG_H_BASE_ |
13 | #define _WX_DIALOG_H_BASE_ | |
c801d85f | 14 | |
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
1b68e0b5 RR |
16 | #pragma interface "dialogbase.h" |
17 | #endif | |
18 | ||
9f3a38fc | 19 | #include "wx/defs.h" |
7d9f12f3 VS |
20 | #include "wx/containr.h" |
21 | #include "wx/toplevel.h" | |
9f3a38fc | 22 | |
acf2ac37 RR |
23 | class WXDLLEXPORT wxSizer; |
24 | class WXDLLEXPORT wxStdDialogButtonSizer; | |
25 | ||
8b5ef6cf VZ |
26 | #define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window |
27 | ||
568883a4 | 28 | #ifdef __WXWINCE__ |
30dfe2ff | 29 | #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER) |
9ceeecb9 JS |
30 | #else |
31 | #define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX) | |
568883a4 | 32 | #endif |
8b5ef6cf | 33 | |
16cba29d | 34 | extern WXDLLEXPORT_DATA(const wxChar*) wxDialogNameStr; |
0cc1d4ff | 35 | |
7d9f12f3 | 36 | class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow |
c50f1fb9 | 37 | { |
dfe1eee3 | 38 | public: |
6463b9f5 | 39 | wxDialogBase() { Init(); } |
82c9f85c VZ |
40 | virtual ~wxDialogBase() { } |
41 | ||
7d9f12f3 | 42 | void Init(); |
82c9f85c | 43 | |
9ceeecb9 | 44 | // Modal dialogs have a return code - usually the id of the last |
dfe1eee3 VZ |
45 | // pressed button |
46 | void SetReturnCode(int returnCode) { m_returnCode = returnCode; } | |
47 | int GetReturnCode() const { return m_returnCode; } | |
48 | ||
9ceeecb9 JS |
49 | // The identifier for the affirmative button |
50 | void SetAffirmativeId(int affirmativeId) { m_affirmativeId = affirmativeId; } | |
51 | int GetAffirmativeId() const { return m_affirmativeId; } | |
52 | ||
d7260478 | 53 | #if wxUSE_STATTEXT // && wxUSE_TEXTCTRL |
92afa2b1 RR |
54 | // splits text up at newlines and places the |
55 | // lines into a vertical wxBoxSizer | |
56 | wxSizer *CreateTextSizer( const wxString &message ); | |
d7260478 | 57 | #endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL |
82c9f85c | 58 | |
1e6feb95 | 59 | #if wxUSE_BUTTON |
92afa2b1 RR |
60 | // places buttons into a horizontal wxBoxSizer |
61 | wxSizer *CreateButtonSizer( long flags ); | |
acf2ac37 | 62 | wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags ); |
1e6feb95 | 63 | #endif // wxUSE_BUTTON |
dfe1eee3 | 64 | |
f6bcfd97 | 65 | protected: |
9ceeecb9 | 66 | // The return code from modal dialog |
dfe1eee3 | 67 | int m_returnCode; |
7d9f12f3 | 68 | |
9ceeecb9 JS |
69 | // The identifier for the affirmative button (usually wxID_OK) |
70 | int m_affirmativeId; | |
71 | ||
fc7a2a60 | 72 | DECLARE_NO_COPY_CLASS(wxDialogBase) |
7d9f12f3 VS |
73 | DECLARE_EVENT_TABLE() |
74 | WX_DECLARE_CONTROL_CONTAINER(); | |
c50f1fb9 VZ |
75 | }; |
76 | ||
7d9f12f3 | 77 | |
c67d6888 | 78 | #if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__) |
0e0de6b8 VS |
79 | #include "wx/univ/dialog.h" |
80 | #else | |
4055ed82 | 81 | #if defined(__WXPALMOS__) |
ffecfa5a JS |
82 | #include "wx/palmos/dialog.h" |
83 | #elif defined(__WXMSW__) | |
0e0de6b8 VS |
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" | |
e64df9bc DE |
91 | #elif defined(__WXCOCOA__) |
92 | #include "wx/cocoa/dialog.h" | |
0e0de6b8 VS |
93 | #elif defined(__WXPM__) |
94 | #include "wx/os2/dialog.h" | |
0e0de6b8 | 95 | #endif |
c801d85f KB |
96 | #endif |
97 | ||
98 | #endif | |
34138703 | 99 | // _WX_DIALOG_H_BASE_ |