]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormAboutlyx.C
Bugfixes: checkboxes to radiobuttons (from J�rgen S) and remove a little
[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@.ac.uk
8  */
9
10 #ifdef __GNUG__
11 #pragma implementation
12 #endif
13
14 #include <config.h>
15
16 #include "xformsBC.h"
17 #include "ControlAboutlyx.h"
18 #include "FormAboutlyx.h"
19 #include "form_aboutlyx.h"
20 #include "xforms_helpers.h"
21 #include "Lsstream.h"
22
23 using std::getline;
24
25 typedef FormCB<ControlAboutlyx, FormDB<FD_form_aboutlyx> > base_class;
26
27 FormAboutlyx::FormAboutlyx(ControlAboutlyx & c)
28         : base_class(c, _("About LyX"), false)
29 {}
30
31 FL_FORM * FormAboutlyx::form() const
32 {
33     if (dialog_.get()) return dialog_->form;
34     return 0;
35 }
36
37 void FormAboutlyx::build()
38 {
39         dialog_.reset(build_aboutlyx());
40
41         // create version tab
42         version_.reset(build_tab_version());
43         fl_set_object_label(version_->text_version, 
44                             controller().getVersion().c_str());
45         fl_set_object_label(version_->text_copyright, 
46                             controller().getCopyright().c_str());
47
48         // create license and warranty tab
49         license_.reset(build_tab_license());
50         
51         string str = formatted(controller().getLicense(),
52                                license_->text_license->w-10);
53         fl_set_object_label(license_->text_license, str.c_str());
54
55         str = formatted(controller().getDisclaimer(),
56                         license_->text_warranty->w-10);
57         fl_set_object_label(license_->text_warranty, str.c_str());
58
59         // create credits
60         credits_.reset(build_tab_credits());
61         stringstream ss;
62         fl_add_browser_line(credits_->browser_credits, 
63                             controller().getCredits(ss).str().c_str());
64
65         // stack tabs
66         fl_addto_tabfolder(dialog_->tabbed_folder,_("Copyright and Version"),
67                        version_->form);
68         fl_addto_tabfolder(dialog_->tabbed_folder,_("License and Warranty"),
69                        license_->form);
70         fl_addto_tabfolder(dialog_->tabbed_folder,_("Credits"),
71                        credits_->form);
72
73         // Manage the cancel/close button
74         bc().setCancel(dialog_->close);
75 }
76
77
78
79
80