]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormAboutlyx.C
change some __GNUG_ to __GNUG__
[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 "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
32 void FormAboutlyx::build()
33 {
34         dialog_.reset(build_aboutlyx());
35
36         // create version tab
37         version_.reset(build_tab_version());
38         fl_set_object_label(version_->text_version,
39                             controller().getVersion().c_str());
40         fl_set_object_label(version_->text_copyright,
41                             controller().getCopyright().c_str());
42
43         // create license and warranty tab
44         license_.reset(build_tab_license());
45
46         string str = formatted(controller().getLicense(),
47                                license_->text_license->w-10);
48         fl_set_object_label(license_->text_license, str.c_str());
49
50         str = formatted(controller().getDisclaimer(),
51                         license_->text_warranty->w-10);
52         fl_set_object_label(license_->text_warranty, str.c_str());
53
54         // create credits
55         credits_.reset(build_tab_credits());
56         stringstream ss;
57         fl_add_browser_line(credits_->browser_credits,
58                             controller().getCredits(ss).str().c_str());
59
60         // stack tabs
61         fl_addto_tabfolder(dialog_->tabfolder,_("Copyright and Version"),
62                            version_->form);
63         fl_addto_tabfolder(dialog_->tabfolder,_("License and Warranty"),
64                            license_->form);
65         fl_addto_tabfolder(dialog_->tabfolder,_("Credits"),
66                            credits_->form);
67
68         // Manage the cancel/close button
69         bc().setCancel(dialog_->button_close);
70 }