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