3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
16 #include "FormAboutlyx.h"
18 #include "ControlAboutlyx.h"
19 #include "forms/form_aboutlyx.h"
20 #include "xforms_helpers.h"
21 #include "support/std_sstream.h"
24 #include "lyx_forms.h"
26 using std::ostringstream;
31 #if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
32 bool const scalableTabfolders = false;
34 bool const scalableTabfolders = true;
40 typedef FormController<ControlAboutlyx, FormView<FD_aboutlyx> > base_class;
42 FormAboutlyx::FormAboutlyx(Dialog & parent)
43 : base_class(parent, _("About LyX"), scalableTabfolders)
47 void FormAboutlyx::build()
49 dialog_.reset(build_aboutlyx(this));
52 version_.reset(build_aboutlyx_version(this));
55 vs << controller().getVersion()
56 << '\n' << lyx_version_info;
58 fl_add_browser_line(version_->browser_version, vs.str().c_str());
61 credits_.reset(build_aboutlyx_credits(this));
64 controller().getCredits(crs);
66 fl_add_browser_line(credits_->browser_credits, crs.str().c_str());
69 license_.reset(build_aboutlyx_license(this));
70 int const width = license_->browser_license->w - 10;
73 cs << controller().getCopyright() << "\n\n"
74 << formatted(controller().getLicense(), width) << "\n\n"
75 << formatted(controller().getDisclaimer(), width);
77 fl_add_browser_line(license_->browser_license, cs.str().c_str());
79 // Enable the tabfolder to be rescaled correctly.
80 if (scalableTabfolders)
81 fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
84 fl_addto_tabfolder(dialog_->tabfolder, _("Version").c_str(),
86 fl_addto_tabfolder(dialog_->tabfolder, _("Credits").c_str(),
88 fl_addto_tabfolder(dialog_->tabfolder, _("License").c_str(),
91 // Manage the cancel/close button
92 bcview().setCancel(dialog_->button_close);