]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dialog.h
define wxUSE_LINE_IN_LISTBOOK to avoid -Wundef warnings (but define it as 0 so thje...
[wxWidgets.git] / include / wx / dialog.h
CommitLineData
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
23class WXDLLEXPORT wxSizer;
24class 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 34extern WXDLLEXPORT_DATA(const wxChar*) wxDialogNameStr;
0cc1d4ff 35
7d9f12f3 36class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow
c50f1fb9 37{
dfe1eee3 38public:
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
2b4f7fbc
VZ
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; }
7ae74029 61#elif wxABI_VERSION > 20601
2b4f7fbc
VZ
62 // just a stub for 2.6
63 int GetEscapeId() const { return wxID_ANY; }
64#endif
65
d7260478 66#if wxUSE_STATTEXT // && wxUSE_TEXTCTRL
92afa2b1
RR
67 // splits text up at newlines and places the
68 // lines into a vertical wxBoxSizer
69 wxSizer *CreateTextSizer( const wxString &message );
d7260478 70#endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL
82c9f85c 71
1e6feb95 72#if wxUSE_BUTTON
92afa2b1
RR
73 // places buttons into a horizontal wxBoxSizer
74 wxSizer *CreateButtonSizer( long flags );
acf2ac37 75 wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags );
1e6feb95 76#endif // wxUSE_BUTTON
dfe1eee3 77
f6bcfd97 78protected:
9ceeecb9 79 // The return code from modal dialog
dfe1eee3 80 int m_returnCode;
7d9f12f3 81
9ceeecb9
JS
82 // The identifier for the affirmative button (usually wxID_OK)
83 int m_affirmativeId;
84
fc7a2a60 85 DECLARE_NO_COPY_CLASS(wxDialogBase)
7d9f12f3
VS
86 DECLARE_EVENT_TABLE()
87 WX_DECLARE_CONTROL_CONTAINER();
c50f1fb9
VZ
88};
89
7d9f12f3 90
c67d6888 91#if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
0e0de6b8
VS
92 #include "wx/univ/dialog.h"
93#else
4055ed82 94 #if defined(__WXPALMOS__)
ffecfa5a
JS
95 #include "wx/palmos/dialog.h"
96 #elif defined(__WXMSW__)
0e0de6b8
VS
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"
e64df9bc
DE
104 #elif defined(__WXCOCOA__)
105 #include "wx/cocoa/dialog.h"
0e0de6b8
VS
106 #elif defined(__WXPM__)
107 #include "wx/os2/dialog.h"
0e0de6b8 108 #endif
c801d85f
KB
109#endif
110
111#endif
34138703 112 // _WX_DIALOG_H_BASE_