]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormAboutlyx.C
Work around xforms "tooltips and tabfolders" bug.
[lyx.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  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "FormAboutlyx.h"
19 #include "xformsBC.h"
20 #include "ControlAboutlyx.h"
21 #include "forms/form_aboutlyx.h"
22 #include "xforms_helpers.h"
23 #include FORMS_H_LOCATION
24 #include "Lsstream.h"
25
26 using std::getline;
27
28 typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
29
30 FormAboutlyx::FormAboutlyx()
31         : base_class(_("About LyX"), false)
32 {}
33
34
35 void FormAboutlyx::build()
36 {
37         dialog_.reset(build_aboutlyx(this));
38
39         // create version tab
40         version_.reset(build_aboutlyx_version(this));
41         fl_set_object_label(version_->text_version,
42                             controller().getVersion().c_str());
43         fl_set_object_label(version_->text_copyright,
44                             controller().getCopyright().c_str());
45
46         // create license and warranty tab
47         license_.reset(build_aboutlyx_license(this));
48
49         string str = formatted(controller().getLicense(),
50                                license_->text_license->w - 10);
51         fl_set_object_label(license_->text_license, str.c_str());
52
53         str = formatted(controller().getDisclaimer(),
54                         license_->text_warranty->w - 10);
55         fl_set_object_label(license_->text_warranty, str.c_str());
56
57         // create credits
58         credits_.reset(build_aboutlyx_credits(this));
59         stringstream ss;
60         fl_add_browser_line(credits_->browser_credits,
61                             controller().getCredits(ss).str().c_str());
62
63         // stack tabs
64         fl_addto_tabfolder(dialog_->tabfolder,_("Copyright and Version"),
65                            version_->form);
66         fl_addto_tabfolder(dialog_->tabfolder,_("License and Warranty"),
67                            license_->form);
68         fl_addto_tabfolder(dialog_->tabfolder,_("Credits"),
69                            credits_->form);
70
71         // work-around xforms bug re update of folder->x, folder->y coords.
72         setPrehandler(dialog_->tabfolder);
73
74         // Manage the cancel/close button
75         bc().setCancel(dialog_->button_close);
76 }