]> git.lyx.org Git - features.git/blob - src/frontends/xforms/FormAboutlyx.C
Rob's about LyX dialog, tweaked a little.
[features.git] / src / frontends / xforms / FormAboutlyx.C
1 /**
2  * \file FormAboutlyx.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  * \author Angus Leeming
8  * \author Rob Lahaye
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #include <config.h>
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include "FormAboutlyx.h"
20 #include "xformsBC.h"
21 #include "ControlAboutlyx.h"
22 #include "forms/form_aboutlyx.h"
23 #include "xforms_helpers.h"
24 #include "Lsstream.h"
25 #include "version.h"
26
27 #include FORMS_H_LOCATION
28
29 using std::string;
30
31
32 typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
33
34 FormAboutlyx::FormAboutlyx()
35         : base_class(_("About LyX"), false)
36 {}
37
38
39 void FormAboutlyx::build()
40 {
41         dialog_.reset(build_aboutlyx(this));
42
43         // create version tab
44         version_.reset(build_aboutlyx_version(this));
45
46         ostringstream vs;
47         vs << controller().getVersion()
48            << '\n' << lyx_version_info;
49
50         fl_add_browser_line(version_->browser_version, vs.str().c_str());
51
52         // create credits tab
53         credits_.reset(build_aboutlyx_credits(this));
54
55         ostringstream crs;
56         controller().getCredits(crs);
57
58         fl_add_browser_line(credits_->browser_credits, crs.str().c_str());
59
60         // create license tab
61         license_.reset(build_aboutlyx_license(this));
62         int const width = license_->browser_license->w - 10;
63
64         ostringstream cs;
65         cs << controller().getCopyright() << "\n\n"
66            << formatted(controller().getLicense(), width) << "\n\n"
67            << formatted(controller().getDisclaimer(), width);
68
69         fl_add_browser_line(license_->browser_license, cs.str().c_str());
70
71         // stack tabs
72         fl_addto_tabfolder(dialog_->tabfolder, _("Version"),
73                            version_->form);
74         fl_addto_tabfolder(dialog_->tabfolder, _("Credits"),
75                            credits_->form);
76         fl_addto_tabfolder(dialog_->tabfolder, _("License"), 
77                            license_->form);
78
79         // work-around xforms bug re update of folder->x, folder->y coords.
80         setPrehandler(dialog_->tabfolder);
81
82         // Manage the cancel/close button
83         bc().setCancel(dialog_->button_close);
84 }