1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/aboutdlgg.h
3 // Purpose: generic wxAboutBox() implementation
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GENERIC_ABOUTDLGG_H_
11 #define _WX_GENERIC_ABOUTDLGG_H_
17 #include "wx/dialog.h"
19 class WXDLLIMPEXP_FWD_ADV wxAboutDialogInfo
;
20 class WXDLLIMPEXP_FWD_CORE wxSizer
;
21 class WXDLLIMPEXP_FWD_CORE wxSizerFlags
;
23 // Under GTK and OS X "About" dialogs are not supposed to be modal, unlike MSW
24 // and, presumably, all the other platforms.
25 #ifndef wxUSE_MODAL_ABOUT_DIALOG
26 #if defined(__WXGTK__) || defined(__WXMAC__)
27 #define wxUSE_MODAL_ABOUT_DIALOG 0
29 #define wxUSE_MODAL_ABOUT_DIALOG 1
31 #endif // wxUSE_MODAL_ABOUT_DIALOG not defined
33 // ----------------------------------------------------------------------------
34 // wxGenericAboutDialog: generic "About" dialog implementation
35 // ----------------------------------------------------------------------------
37 class WXDLLIMPEXP_ADV wxGenericAboutDialog
: public wxDialog
40 // constructors and Create() method
41 // --------------------------------
43 // default ctor, you must use Create() to really initialize the dialog
44 wxGenericAboutDialog() { Init(); }
46 // ctor which fully initializes the object
47 wxGenericAboutDialog(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
)
51 (void)Create(info
, parent
);
54 // this method must be called if and only if the default ctor was used
55 bool Create(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);
58 // this virtual method may be overridden to add some more controls to the
61 // notice that for this to work you must call Create() from the derived
62 // class ctor and not use the base class ctor directly as otherwise the
63 // virtual function of the derived class wouldn't be called
64 virtual void DoAddCustomControls() { }
66 // add arbitrary control to the text sizer contents with the specified
68 void AddControl(wxWindow
*win
, const wxSizerFlags
& flags
);
70 // add arbitrary control to the text sizer contents and center it
71 void AddControl(wxWindow
*win
);
73 // add the text, if it's not empty, to the text sizer contents
74 void AddText(const wxString
& text
);
77 // add a wxCollapsiblePane containing the given text
78 void AddCollapsiblePane(const wxString
& title
, const wxString
& text
);
79 #endif // wxUSE_COLLPANE
82 // common part of all ctors
83 void Init() { m_sizerText
= NULL
; }
85 #if !wxUSE_MODAL_ABOUT_DIALOG
86 // An explicit handler for deleting the dialog when it's closed is needed
87 // when we show it non-modally.
88 void OnCloseWindow(wxCloseEvent
& event
);
89 void OnOK(wxCommandEvent
& event
);
90 #endif // !wxUSE_MODAL_ABOUT_DIALOG
95 // unlike wxAboutBox which can show either the native or generic about dialog,
96 // this function always shows the generic one
97 WXDLLIMPEXP_ADV
void wxGenericAboutBox(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);
99 #endif // wxUSE_ABOUTDLG
101 #endif // _WX_GENERIC_ABOUTDLGG_H_