]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dialog.h
fixed wxComboBox::Clear to clear stored value
[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
9f3a38fc 15#include "wx/defs.h"
7d9f12f3
VS
16#include "wx/containr.h"
17#include "wx/toplevel.h"
9f3a38fc 18
acf2ac37
RR
19class WXDLLEXPORT wxSizer;
20class WXDLLEXPORT wxStdDialogButtonSizer;
21
8b5ef6cf
VZ
22#define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window
23
568883a4 24#ifdef __WXWINCE__
30dfe2ff 25#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER)
9ceeecb9
JS
26#else
27#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX)
568883a4 28#endif
8b5ef6cf 29
16cba29d 30extern WXDLLEXPORT_DATA(const wxChar*) wxDialogNameStr;
0cc1d4ff 31
7d9f12f3 32class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow
c50f1fb9 33{
dfe1eee3 34public:
6463b9f5 35 wxDialogBase() { Init(); }
82c9f85c
VZ
36 virtual ~wxDialogBase() { }
37
7d9f12f3 38 void Init();
82c9f85c 39
9ceeecb9 40 // Modal dialogs have a return code - usually the id of the last
dfe1eee3
VZ
41 // pressed button
42 void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
43 int GetReturnCode() const { return m_returnCode; }
44
9ceeecb9
JS
45 // The identifier for the affirmative button
46 void SetAffirmativeId(int affirmativeId) { m_affirmativeId = affirmativeId; }
47 int GetAffirmativeId() const { return m_affirmativeId; }
48
2b4f7fbc 49 // Identifier for Esc key translation
2b4f7fbc
VZ
50 void SetEscapeId(int escapeId) { m_escapeId = escapeId; }
51 int GetEscapeId() const { return m_escapeId; }
2b4f7fbc 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 65protected:
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
c6ece595
VZ
72 // The identifier for cancel button (usually wxID_CANCEL)
73 int m_escapeId;
74
fc7a2a60 75 DECLARE_NO_COPY_CLASS(wxDialogBase)
7d9f12f3
VS
76 DECLARE_EVENT_TABLE()
77 WX_DECLARE_CONTROL_CONTAINER();
c50f1fb9
VZ
78};
79
7d9f12f3 80
c67d6888 81#if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
0e0de6b8
VS
82 #include "wx/univ/dialog.h"
83#else
4055ed82 84 #if defined(__WXPALMOS__)
ffecfa5a
JS
85 #include "wx/palmos/dialog.h"
86 #elif defined(__WXMSW__)
0e0de6b8
VS
87 #include "wx/msw/dialog.h"
88 #elif defined(__WXMOTIF__)
89 #include "wx/motif/dialog.h"
90 #elif defined(__WXGTK__)
91 #include "wx/gtk/dialog.h"
92 #elif defined(__WXMAC__)
93 #include "wx/mac/dialog.h"
e64df9bc
DE
94 #elif defined(__WXCOCOA__)
95 #include "wx/cocoa/dialog.h"
0e0de6b8
VS
96 #elif defined(__WXPM__)
97 #include "wx/os2/dialog.h"
0e0de6b8 98 #endif
c801d85f
KB
99#endif
100
101#endif
34138703 102 // _WX_DIALOG_H_BASE_