]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/aboutdlgg.h
Use SelectAll() instead of SetSelection(-1, -1).
[wxWidgets.git] / include / wx / generic / aboutdlgg.h
CommitLineData
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
b5dbe15d
VS
20class WXDLLIMPEXP_FWD_ADV wxAboutDialogInfo;
21class WXDLLIMPEXP_FWD_CORE wxSizer;
22class WXDLLIMPEXP_FWD_CORE wxSizerFlags;
ca7adbf8 23
04ca40fc
VZ
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
29 #else
30 #define wxUSE_MODAL_ABOUT_DIALOG 1
31 #endif
32#endif // wxUSE_MODAL_ABOUT_DIALOG not defined
33
ca7adbf8 34// ----------------------------------------------------------------------------
453c9e3b 35// wxGenericAboutDialog: generic "About" dialog implementation
ca7adbf8
VZ
36// ----------------------------------------------------------------------------
37
b85db900 38class WXDLLIMPEXP_ADV wxGenericAboutDialog : public wxDialog
ca7adbf8
VZ
39{
40public:
41 // constructors and Create() method
42 // --------------------------------
43
44 // default ctor, you must use Create() to really initialize the dialog
453c9e3b 45 wxGenericAboutDialog() { Init(); }
ca7adbf8
VZ
46
47 // ctor which fully initializes the object
c173e541 48 wxGenericAboutDialog(const wxAboutDialogInfo& info, wxWindow* parent = NULL)
ca7adbf8
VZ
49 {
50 Init();
51
c173e541 52 (void)Create(info, parent);
ca7adbf8
VZ
53 }
54
55 // this method must be called if and only if the default ctor was used
c173e541 56 bool Create(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
ca7adbf8
VZ
57
58protected:
453c9e3b
VZ
59 // this virtual method may be overridden to add some more controls to the
60 // dialog
61 //
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() { }
66
67 // add arbitrary control to the text sizer contents with the specified
68 // flags
69 void AddControl(wxWindow *win, const wxSizerFlags& flags);
70
71 // add arbitrary control to the text sizer contents and center it
ca7adbf8
VZ
72 void AddControl(wxWindow *win);
73
74 // add the text, if it's not empty, to the text sizer contents
75 void AddText(const wxString& text);
76
4b98d13d 77#if wxUSE_COLLPANE
b9993189
VZ
78 // add a wxCollapsiblePane containing the given text
79 void AddCollapsiblePane(const wxString& title, const wxString& text);
4b98d13d 80#endif // wxUSE_COLLPANE
b9993189 81
453c9e3b
VZ
82private:
83 // common part of all ctors
84 void Init() { m_sizerText = NULL; }
85
04ca40fc
VZ
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
ca7adbf8
VZ
92
93 wxSizer *m_sizerText;
94};
95
96// unlike wxAboutBox which can show either the native or generic about dialog,
97// this function always shows the generic one
c173e541 98WXDLLIMPEXP_ADV void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
ca7adbf8
VZ
99
100#endif // wxUSE_ABOUTDLG
101
102#endif // _WX_GENERIC_ABOUTDLGG_H_
103