]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormAboutlyx.C
964217dcaef234956bf18c2bcc0eb6d3b4d4eb9c
[lyx.git] / src / frontends / xforms / FormAboutlyx.C
1 /**
2  * \file FormAboutlyx.C
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Edwin Leuven, leuven@fee.uva.nl
7  * \author Angus Leeming, a.leeming@ic.ac.uk
8  */
9
10 #include <config.h>
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include "FormAboutlyx.h"
17 #include "xformsBC.h"
18 #include "ControlAboutlyx.h"
19 #include "forms/form_aboutlyx.h"
20 #include "xforms_helpers.h"
21 #include FORMS_H_LOCATION
22 #include "Lsstream.h"
23
24 using std::getline;
25
26 typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
27
28 FormAboutlyx::FormAboutlyx()
29         : base_class(_("About LyX"), false)
30 {}
31
32
33 void FormAboutlyx::build()
34 {
35         dialog_.reset(build_aboutlyx(this));
36
37         // create version tab
38         version_.reset(build_aboutlyx_version(this));
39         fl_set_object_label(version_->text_version,
40                             controller().getVersion().c_str());
41         fl_set_object_label(version_->text_copyright,
42                             controller().getCopyright().c_str());
43
44         // create license and warranty tab
45         license_.reset(build_aboutlyx_license(this));
46
47         string str = formatted(controller().getLicense(),
48                                license_->text_license->w-10);
49         fl_set_object_label(license_->text_license, str.c_str());
50
51         str = formatted(controller().getDisclaimer(),
52                         license_->text_warranty->w-10);
53         fl_set_object_label(license_->text_warranty, str.c_str());
54
55         // create credits
56         credits_.reset(build_aboutlyx_credits(this));
57         stringstream ss;
58         fl_add_browser_line(credits_->browser_credits,
59                             controller().getCredits(ss).str().c_str());
60
61         // stack tabs
62         fl_addto_tabfolder(dialog_->tabfolder,_("Copyright and Version"),
63                            version_->form);
64         fl_addto_tabfolder(dialog_->tabfolder,_("License and Warranty"),
65                            license_->form);
66         fl_addto_tabfolder(dialog_->tabfolder,_("Credits"),
67                            credits_->form);
68
69         // Manage the cancel/close button
70         bc().setCancel(dialog_->button_close);
71 }