1999-06-29 08:34:18 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/dialog.h
|
|
|
|
// Purpose: wxDialogBase class
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 29.06.99
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Vadim Zeitlin
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-06-29 08:34:18 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_DIALOG_H_BASE_
|
|
|
|
#define _WX_DIALOG_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1999-10-12 17:52:17 -04:00
|
|
|
#pragma interface "dialogbase.h"
|
|
|
|
#endif
|
|
|
|
|
1999-06-28 18:04:40 -04:00
|
|
|
#include "wx/defs.h"
|
2001-09-15 18:13:08 -04:00
|
|
|
#include "wx/containr.h"
|
|
|
|
#include "wx/toplevel.h"
|
1999-06-28 18:04:40 -04:00
|
|
|
|
2004-12-31 13:57:25 -05:00
|
|
|
class WXDLLEXPORT wxSizer;
|
|
|
|
class WXDLLEXPORT wxStdDialogButtonSizer;
|
|
|
|
|
2004-04-13 08:22:34 -04:00
|
|
|
#define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window
|
|
|
|
|
2004-04-18 06:32:20 -04:00
|
|
|
#ifdef __WXWINCE__
|
2005-04-02 16:40:59 -05:00
|
|
|
#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER)
|
2005-03-14 12:15:06 -05:00
|
|
|
#else
|
|
|
|
#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX)
|
2004-04-18 06:32:20 -04:00
|
|
|
#endif
|
2004-04-13 08:22:34 -04:00
|
|
|
|
2005-01-21 13:48:22 -05:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar*) wxDialogNameStr;
|
2003-05-12 15:52:43 -04:00
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow
|
1999-06-28 17:39:49 -04:00
|
|
|
{
|
1999-06-29 08:34:18 -04:00
|
|
|
public:
|
2004-01-15 08:49:22 -05:00
|
|
|
wxDialogBase() { Init(); }
|
2001-09-23 20:34:14 -04:00
|
|
|
virtual ~wxDialogBase() { }
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
void Init();
|
2001-09-23 20:34:14 -04:00
|
|
|
|
2005-03-14 12:15:06 -05:00
|
|
|
// Modal dialogs have a return code - usually the id of the last
|
1999-06-29 08:34:18 -04:00
|
|
|
// pressed button
|
|
|
|
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
|
|
|
int GetReturnCode() const { return m_returnCode; }
|
|
|
|
|
2005-03-14 12:15:06 -05:00
|
|
|
// The identifier for the affirmative button
|
|
|
|
void SetAffirmativeId(int affirmativeId) { m_affirmativeId = affirmativeId; }
|
|
|
|
int GetAffirmativeId() const { return m_affirmativeId; }
|
|
|
|
|
2005-07-14 19:07:10 -04:00
|
|
|
// Identifier for Esc key translation
|
|
|
|
#if wxCHECK_VERSION(2, 7, 0)
|
|
|
|
#error "Uncomment SetEscapeId() implementation"
|
|
|
|
|
|
|
|
// this is what we should do in 2.7: remove the "#else" part and add
|
|
|
|
// m_escapeId declaration and the docs for Set/GetEscapeId()
|
|
|
|
void SetEscapeId(int escapeId) { m_escapeId = escapeId; }
|
|
|
|
int GetEscapeId() const { return m_escapeId; }
|
2005-07-16 18:52:34 -04:00
|
|
|
#elif wxABI_VERSION > 20601
|
2005-07-14 19:07:10 -04:00
|
|
|
// just a stub for 2.6
|
|
|
|
int GetEscapeId() const { return wxID_ANY; }
|
|
|
|
#endif
|
|
|
|
|
2003-05-23 14:59:07 -04:00
|
|
|
#if wxUSE_STATTEXT // && wxUSE_TEXTCTRL
|
1999-08-11 07:53:40 -04:00
|
|
|
// splits text up at newlines and places the
|
|
|
|
// lines into a vertical wxBoxSizer
|
|
|
|
wxSizer *CreateTextSizer( const wxString &message );
|
2003-05-23 14:59:07 -04:00
|
|
|
#endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL
|
2001-09-23 20:34:14 -04:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if wxUSE_BUTTON
|
1999-08-11 07:53:40 -04:00
|
|
|
// places buttons into a horizontal wxBoxSizer
|
|
|
|
wxSizer *CreateButtonSizer( long flags );
|
2004-12-31 13:57:25 -05:00
|
|
|
wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags );
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_BUTTON
|
1999-06-29 08:34:18 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
protected:
|
2005-03-14 12:15:06 -05:00
|
|
|
// The return code from modal dialog
|
1999-06-29 08:34:18 -04:00
|
|
|
int m_returnCode;
|
2001-09-15 18:13:08 -04:00
|
|
|
|
2005-03-14 12:15:06 -05:00
|
|
|
// The identifier for the affirmative button (usually wxID_OK)
|
|
|
|
int m_affirmativeId;
|
|
|
|
|
2003-07-21 20:24:07 -04:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDialogBase)
|
2001-09-15 18:13:08 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
WX_DECLARE_CONTROL_CONTAINER();
|
1999-06-28 17:39:49 -04:00
|
|
|
};
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
|
2001-11-28 13:22:16 -05:00
|
|
|
#if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__)
|
2001-09-18 18:33:38 -04:00
|
|
|
#include "wx/univ/dialog.h"
|
|
|
|
#else
|
2004-12-20 07:44:22 -05:00
|
|
|
#if defined(__WXPALMOS__)
|
2004-10-19 09:40:30 -04:00
|
|
|
#include "wx/palmos/dialog.h"
|
|
|
|
#elif defined(__WXMSW__)
|
2001-09-18 18:33:38 -04:00
|
|
|
#include "wx/msw/dialog.h"
|
|
|
|
#elif defined(__WXMOTIF__)
|
|
|
|
#include "wx/motif/dialog.h"
|
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk/dialog.h"
|
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/dialog.h"
|
2003-03-22 01:18:36 -05:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/dialog.h"
|
2001-09-18 18:33:38 -04:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/dialog.h"
|
|
|
|
#endif
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_DIALOG_H_BASE_
|