]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/generic/aboutdlgg.h
7de706b46932cd08120cbfbb69fa54838aa82782
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/aboutdlgg.h
3 // Purpose: generic wxAboutBox() implementation
7 // Copyright: (c) 2012 wxWidgets development team
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
12 @class wxGenericAboutDialog
14 This class defines a customizable @e About dialog.
16 Note that if you don't need customization, you should use the global
17 wxAboutBox() function that is both easier to use and shows the native
20 To use this class, you need to derive your own class from it and override
21 the virtual method DoAddCustomControls().
23 To instantiate an object from your wxGenericAboutDialog-based class, you
24 can use either the default constructor followed by a call to Create(), or
25 directly using the alternate constructor. In either case, you have to
26 prepare a wxAboutDialogInfo containing standard informations to display in
29 Example of usage, MyAboutDlg being a class derived from wxGenericAboutDialog:
31 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
33 wxAboutDialogInfo aboutInfo;
35 aboutInfo.SetName("MyApp");
36 aboutInfo.SetVersion(MY_APP_VERSION_STRING);
37 aboutInfo.SetDescription(_("My wxWidgets-based application!"));
38 aboutInfo.SetCopyright("(C) 1992-2012");
39 aboutInfo.SetWebSite("http://myapp.org");
40 aboutInfo.AddDeveloper("My Self");
42 MyAboutDlg dlgAbout(aboutInfo, this);
50 @see wxAboutDialogInfo
52 class wxGenericAboutDialog
56 Default constructor, Create() must be called later.
58 wxGenericAboutDialog();
61 Creates the dialog and initializes it with the given information.
63 wxGenericAboutDialog(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);
66 Initializes the dialog created using the default constructor.
68 bool Create(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);
72 This virtual method may be overridden to add more controls to the
75 Use the protected AddControl(), AddText() and AddCollapsiblePane()
76 methods to add custom controls.
78 This method is called during the dialog creation and you don't need to
79 call it, only to override it.
81 virtual void DoAddCustomControls() { }
84 Add arbitrary control to the sizer content with the specified flags.
86 For example, here is how to add an expandable line with a border of 3
87 pixels, then a line of text:
89 AddControl(new wxStaticLine(this), wxSizerFlags().Expand().Border(wxALL, 3));
91 AddText(_("This line is just an example of custom text."));
94 void AddControl(wxWindow
*win
, const wxSizerFlags
& flags
);
97 Add arbitrary control to the sizer content and centre it.
99 void AddControl(wxWindow
*win
);
102 Add the given (not empty) text to the sizer content.
104 void AddText(const wxString
& text
);
107 Add a wxCollapsiblePane containing the given text.
109 void AddCollapsiblePane(const wxString
& title
, const wxString
& text
);
113 Show generic about dialog.
115 This function does the same thing as wxAboutBox() except that it always
116 uses the generic wxWidgets version of the dialog instead of the native one.
118 void wxGenericAboutBox(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);