2006-10-07 21:02:04 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/generic/aboutdlgg.h
|
2006-10-08 10:12:59 -04:00
|
|
|
// Purpose: generic wxAboutBox() implementation
|
2006-10-07 21:02:04 -04:00
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Created: 2006-10-07
|
|
|
|
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GENERIC_ABOUTDLGG_H_
|
|
|
|
#define _WX_GENERIC_ABOUTDLGG_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_ABOUTDLG
|
|
|
|
|
|
|
|
#include "wx/dialog.h"
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_ADV wxAboutDialogInfo;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxSizer;
|
|
|
|
class WXDLLIMPEXP_FWD_CORE wxSizerFlags;
|
2006-10-07 21:02:04 -04:00
|
|
|
|
2012-01-20 17:11:32 -05:00
|
|
|
// Under GTK and OS X "About" dialogs are not supposed to be modal, unlike MSW
|
|
|
|
// and, presumably, all the other platforms.
|
|
|
|
#ifndef wxUSE_MODAL_ABOUT_DIALOG
|
|
|
|
#if defined(__WXGTK__) || defined(__WXMAC__)
|
|
|
|
#define wxUSE_MODAL_ABOUT_DIALOG 0
|
|
|
|
#else
|
|
|
|
#define wxUSE_MODAL_ABOUT_DIALOG 1
|
|
|
|
#endif
|
|
|
|
#endif // wxUSE_MODAL_ABOUT_DIALOG not defined
|
|
|
|
|
2006-10-07 21:02:04 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
2006-10-08 10:12:59 -04:00
|
|
|
// wxGenericAboutDialog: generic "About" dialog implementation
|
2006-10-07 21:02:04 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2006-10-09 12:56:18 -04:00
|
|
|
class WXDLLIMPEXP_ADV wxGenericAboutDialog : public wxDialog
|
2006-10-07 21:02:04 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructors and Create() method
|
|
|
|
// --------------------------------
|
|
|
|
|
|
|
|
// default ctor, you must use Create() to really initialize the dialog
|
2006-10-08 10:12:59 -04:00
|
|
|
wxGenericAboutDialog() { Init(); }
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
// ctor which fully initializes the object
|
2009-04-26 09:41:21 -04:00
|
|
|
wxGenericAboutDialog(const wxAboutDialogInfo& info, wxWindow* parent = NULL)
|
2006-10-07 21:02:04 -04:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
2009-04-26 09:41:21 -04:00
|
|
|
(void)Create(info, parent);
|
2006-10-07 21:02:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// this method must be called if and only if the default ctor was used
|
2009-04-26 09:41:21 -04:00
|
|
|
bool Create(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
protected:
|
2006-10-08 10:12:59 -04:00
|
|
|
// this virtual method may be overridden to add some more controls to the
|
|
|
|
// dialog
|
|
|
|
//
|
|
|
|
// notice that for this to work you must call Create() from the derived
|
|
|
|
// class ctor and not use the base class ctor directly as otherwise the
|
|
|
|
// virtual function of the derived class wouldn't be called
|
|
|
|
virtual void DoAddCustomControls() { }
|
|
|
|
|
|
|
|
// add arbitrary control to the text sizer contents with the specified
|
|
|
|
// flags
|
|
|
|
void AddControl(wxWindow *win, const wxSizerFlags& flags);
|
|
|
|
|
|
|
|
// add arbitrary control to the text sizer contents and center it
|
2006-10-07 21:02:04 -04:00
|
|
|
void AddControl(wxWindow *win);
|
|
|
|
|
|
|
|
// add the text, if it's not empty, to the text sizer contents
|
|
|
|
void AddText(const wxString& text);
|
|
|
|
|
2006-11-12 18:18:52 -05:00
|
|
|
#if wxUSE_COLLPANE
|
2006-11-12 16:43:27 -05:00
|
|
|
// add a wxCollapsiblePane containing the given text
|
|
|
|
void AddCollapsiblePane(const wxString& title, const wxString& text);
|
2006-11-12 18:18:52 -05:00
|
|
|
#endif // wxUSE_COLLPANE
|
2006-11-12 16:43:27 -05:00
|
|
|
|
2006-10-08 10:12:59 -04:00
|
|
|
private:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init() { m_sizerText = NULL; }
|
|
|
|
|
2012-01-20 17:11:32 -05:00
|
|
|
#if !wxUSE_MODAL_ABOUT_DIALOG
|
|
|
|
// An explicit handler for deleting the dialog when it's closed is needed
|
|
|
|
// when we show it non-modally.
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
#endif // !wxUSE_MODAL_ABOUT_DIALOG
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
wxSizer *m_sizerText;
|
|
|
|
};
|
|
|
|
|
|
|
|
// unlike wxAboutBox which can show either the native or generic about dialog,
|
|
|
|
// this function always shows the generic one
|
2009-04-26 09:41:21 -04:00
|
|
|
WXDLLIMPEXP_ADV void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
2006-10-07 21:02:04 -04:00
|
|
|
|
|
|
|
#endif // wxUSE_ABOUTDLG
|
|
|
|
|
|
|
|
#endif // _WX_GENERIC_ABOUTDLGG_H_
|
|
|
|
|