]>
Commit | Line | Data |
---|---|---|
ca7adbf8 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/generic/aboutdlgg.h | |
453c9e3b | 3 | // Purpose: generic wxAboutBox() implementation |
ca7adbf8 VZ |
4 | // Author: Vadim Zeitlin |
5 | // Created: 2006-10-07 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> | |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_GENERIC_ABOUTDLGG_H_ | |
12 | #define _WX_GENERIC_ABOUTDLGG_H_ | |
13 | ||
14 | #include "wx/defs.h" | |
15 | ||
16 | #if wxUSE_ABOUTDLG | |
17 | ||
18 | #include "wx/dialog.h" | |
19 | ||
b85db900 | 20 | class WXDLLIMPEXP_ADV wxAboutDialogInfo; |
ca7adbf8 | 21 | class WXDLLIMPEXP_CORE wxSizer; |
453c9e3b | 22 | class WXDLLIMPEXP_CORE wxSizerFlags; |
ca7adbf8 VZ |
23 | |
24 | // ---------------------------------------------------------------------------- | |
453c9e3b | 25 | // wxGenericAboutDialog: generic "About" dialog implementation |
ca7adbf8 VZ |
26 | // ---------------------------------------------------------------------------- |
27 | ||
b85db900 | 28 | class WXDLLIMPEXP_ADV wxGenericAboutDialog : public wxDialog |
ca7adbf8 VZ |
29 | { |
30 | public: | |
31 | // constructors and Create() method | |
32 | // -------------------------------- | |
33 | ||
34 | // default ctor, you must use Create() to really initialize the dialog | |
453c9e3b | 35 | wxGenericAboutDialog() { Init(); } |
ca7adbf8 VZ |
36 | |
37 | // ctor which fully initializes the object | |
453c9e3b | 38 | wxGenericAboutDialog(const wxAboutDialogInfo& info) |
ca7adbf8 VZ |
39 | { |
40 | Init(); | |
41 | ||
42 | (void)Create(info); | |
43 | } | |
44 | ||
45 | // this method must be called if and only if the default ctor was used | |
46 | bool Create(const wxAboutDialogInfo& info); | |
47 | ||
48 | protected: | |
453c9e3b VZ |
49 | // this virtual method may be overridden to add some more controls to the |
50 | // dialog | |
51 | // | |
52 | // notice that for this to work you must call Create() from the derived | |
53 | // class ctor and not use the base class ctor directly as otherwise the | |
54 | // virtual function of the derived class wouldn't be called | |
55 | virtual void DoAddCustomControls() { } | |
56 | ||
57 | // add arbitrary control to the text sizer contents with the specified | |
58 | // flags | |
59 | void AddControl(wxWindow *win, const wxSizerFlags& flags); | |
60 | ||
61 | // add arbitrary control to the text sizer contents and center it | |
ca7adbf8 VZ |
62 | void AddControl(wxWindow *win); |
63 | ||
64 | // add the text, if it's not empty, to the text sizer contents | |
65 | void AddText(const wxString& text); | |
66 | ||
453c9e3b VZ |
67 | private: |
68 | // common part of all ctors | |
69 | void Init() { m_sizerText = NULL; } | |
70 | ||
ca7adbf8 VZ |
71 | |
72 | wxSizer *m_sizerText; | |
73 | }; | |
74 | ||
75 | // unlike wxAboutBox which can show either the native or generic about dialog, | |
76 | // this function always shows the generic one | |
b85db900 | 77 | WXDLLIMPEXP_ADV void wxGenericAboutBox(const wxAboutDialogInfo& info); |
ca7adbf8 VZ |
78 | |
79 | #endif // wxUSE_ABOUTDLG | |
80 | ||
81 | #endif // _WX_GENERIC_ABOUTDLGG_H_ | |
82 |