]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormAboutlyx.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / FormAboutlyx.C
index dedf4b58b397d1e0d1811cfe8fc96ba83db4ae0d..2d39c6a0b58e75f6dce77901086f239f3bdca16e 100644 (file)
@@ -7,32 +7,42 @@
  * \author Angus Leeming
  * \author Rob Lahaye
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "FormAboutlyx.h"
 #include "xformsBC.h"
 #include "ControlAboutlyx.h"
 #include "forms/form_aboutlyx.h"
 #include "xforms_helpers.h"
-#include "Lsstream.h"
 #include "version.h"
 
-#include FORMS_H_LOCATION
+#include "lyx_forms.h"
+
+#include <sstream>
 
-using std::string;
+using std::ostringstream;
 
+namespace lyx {
+namespace frontend {
+
+namespace {
+
+#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
+bool const scalableTabfolders = false;
+#else
+bool const scalableTabfolders = true;
+#endif
 
-typedef FormCB<ControlAboutlyx, FormDB<FD_aboutlyx> > base_class;
+} // namespace anon
 
-FormAboutlyx::FormAboutlyx()
-       : base_class(_("About LyX"), false)
+
+typedef FormController<ControlAboutlyx, FormView<FD_aboutlyx> > base_class;
+
+FormAboutlyx::FormAboutlyx(Dialog & parent)
+       : base_class(parent, _("About LyX"), scalableTabfolders)
 {}
 
 
@@ -50,7 +60,7 @@ void FormAboutlyx::build()
        fl_add_browser_line(version_->browser_version, vs.str().c_str());
 
        // create credits tab
-       credits_.reset(build_aboutlyx_credits(this));
+       credits_.reset(build_aboutlyx_credits(this));
 
        ostringstream crs;
        controller().getCredits(crs);
@@ -68,17 +78,21 @@ void FormAboutlyx::build()
 
        fl_add_browser_line(license_->browser_license, cs.str().c_str());
 
-       // stack tabs
-       fl_addto_tabfolder(dialog_->tabfolder, _("Version"),
+       // Enable the tabfolder to be rescaled correctly.
+       if (scalableTabfolders)
+               fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
+
+       // Stack tabs
+       fl_addto_tabfolder(dialog_->tabfolder, _("Version").c_str(),
                           version_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("Credits"),
+       fl_addto_tabfolder(dialog_->tabfolder, _("Credits").c_str(),
                           credits_->form);
-       fl_addto_tabfolder(dialog_->tabfolder, _("License")
+       fl_addto_tabfolder(dialog_->tabfolder, _("License").c_str(),
                           license_->form);
 
-       // work-around xforms bug re update of folder->x, folder->y coords.
-       setPrehandler(dialog_->tabfolder);
-
        // Manage the cancel/close button
-       bc().setCancel(dialog_->button_close);
+       bcview().setCancel(dialog_->button_close);
 }
+
+} // namespace frontend
+} // namespace lyx