+2003-04-09 Angus Leeming <leeming@lyx.org>
+
+ * FormAboutlyx.C:
+ * FormDocument.C:
+ * FormGraphics.C:
+ * FormPreferences.C:
+ * FormTabular.C:
+ * forms/form_preferences.fd: prepare the way for resizable
+ tabfolders if the xforms version is up to the task.
+
2003-04-09 John Levon <levon@movementarian.org>
* Toolbar_pimpl.C:
#include FORMS_H_LOCATION
+namespace {
+
+#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
+bool const scalableTabfolders = false;
+#else
+bool const scalableTabfolders = true;
+#endif
+
+} // namespace anon
+
typedef FormController<ControlAboutlyx, FormView<FD_aboutlyx> > base_class;
FormAboutlyx::FormAboutlyx(Dialog & parent)
- : base_class(parent, _("About LyX"), false)
+ : base_class(parent, _("About LyX"), scalableTabfolders)
{}
fl_add_browser_line(license_->browser_license, cs.str().c_str());
- // stack tabs
+ // 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"),
version_->form);
fl_addto_tabfolder(dialog_->tabfolder, _("Credits"),
fl_addto_tabfolder(dialog_->tabfolder, _("License"),
license_->form);
- // work-around xforms bug re update of folder->x, folder->y coords.
- setPrehandler(dialog_->tabfolder);
-
// Manage the cancel/close button
bcview().setCancel(dialog_->button_close);
}
using std::vector;
+namespace {
+
+#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
+bool const scalableTabfolders = false;
+#else
+bool const scalableTabfolders = true;
+#endif
+
+} // namespace anon
+
+
typedef FormCB<ControlDocument, FormDB<FD_document> > base_class;
FormDocument::FormDocument()
- : base_class(_("Document Layout"), false),
+ : base_class(_("Document Layout"), scalableTabfolders),
ActCell(0), Confirmed(0),
current_bullet_panel(0), current_bullet_depth(0), fbullet(0)
{}
fl_set_bmtable_pixmap_file(bullets_->bmtable_panel, 6, 6,
bmtablefile.c_str());
+ // Enable the tabfolder to be rescaled correctly.
+ if (scalableTabfolders)
+ fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
+
+ // Stack tabs
fl_addto_tabfolder(dialog_->tabfolder,_("Document"),
class_->form);
fl_addto_tabfolder(dialog_->tabfolder,_("Paper"),
fbullet = fl_addto_tabfolder(dialog_->tabfolder,_("Bullets"),
bullets_->form);
- // work-around xforms bug re update of folder->x, folder->y coords.
- setPrehandler(dialog_->tabfolder);
-
if ((XpmVersion < 4) || (XpmVersion == 4 && XpmRevision < 7)) {
lyxerr << _("Your version of libXpm is older than 4.7.\n"
"The `bullet' tab of the document dialog "
string defaultUnit("cm");
+#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
+bool const scalableTabfolders = false;
+#else
+bool const scalableTabfolders = true;
+#endif
+
} // namespace anon
typedef FormController<ControlGraphics, FormView<FD_graphics> > base_class;
FormGraphics::FormGraphics(Dialog & parent)
- : base_class(parent, _("Graphics"), false)
+ : base_class(parent, _("Graphics"), scalableTabfolders)
{}
"graphicx-package and not mentioned in the gui's tabfolders.");
tooltips().init(extra_->input_special, str);
- // add the different tabfolders
+ // Enable the tabfolder to be rescaled correctly.
+ if (scalableTabfolders)
+ fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
+
+ // Stack tabs
fl_addto_tabfolder(dialog_->tabfolder, _("File"), file_->form);
fl_addto_tabfolder(dialog_->tabfolder, _("Bounding Box"), bbox_->form);
fl_addto_tabfolder(dialog_->tabfolder, _("Extra"), extra_->form);
- // work-around xforms bug re update of folder->x, folder->y coords.
- setPrehandler(dialog_->tabfolder);
-
// set the right default unit
switch (lyxrc.default_papersize) {
case BufferParams::PAPER_DEFAULT: break;
return STRCONV(ostr.str());
}
+#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
+bool const scalableTabfolders = false;
+#else
+bool const scalableTabfolders = true;
+#endif
+
} // namespace anon
typedef FormCB<ControlPrefs, FormDB<FD_preferences> > base_class;
+
FormPreferences::FormPreferences()
- : base_class(_("Preferences"), false),
+ : base_class(_("Preferences"), scalableTabfolders),
colors_(*this), converters_(*this), inputs_misc_(*this),
formats_(*this), interface_(*this), language_(*this),
lnf_misc_(*this), identity_(*this), outputs_misc_(*this),
screen_fonts_.build();
spelloptions_.build();
+ // Enable the tabfolders to be rescaled correctly.
+ if (scalableTabfolders) {
+ FL_OBJECT * folder = dialog_->tabfolder_prefs;
+ fl_set_tabfolder_autofit(folder, FL_FIT);
+
+ folder = look_n_feel_tab_->tabfolder_inner;
+ fl_set_tabfolder_autofit(folder, FL_FIT);
+
+ folder = converters_tab_->tabfolder_inner;
+ fl_set_tabfolder_autofit(folder, FL_FIT);
+
+ folder = inputs_tab_->tabfolder_inner;
+ fl_set_tabfolder_autofit(folder, FL_FIT);
+
+ folder = outputs_tab_->tabfolder_inner;
+ fl_set_tabfolder_autofit(folder, FL_FIT);
+
+ folder = lang_opts_tab_->tabfolder_inner;
+ fl_set_tabfolder_autofit(folder, FL_FIT);
+ }
+
+ // Stack tabs
// Now add them to the tabfolder
fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Look & Feel"),
fl_addto_tabfolder(lang_opts_tab_->tabfolder_inner,
_("Language"),
language_.dialog()->form);
-
- // work-around xforms bug re update of folder->x, folder->y coords.
- setPrehandler(look_n_feel_tab_->tabfolder_inner);
- setPrehandler(converters_tab_->tabfolder_inner);
- setPrehandler(inputs_tab_->tabfolder_inner);
- setPrehandler(outputs_tab_->tabfolder_inner);
- setPrehandler(lang_opts_tab_->tabfolder_inner);
}
using std::bind2nd;
+namespace {
+
+#if FL_VERSION == 0 || (FL_REVISION == 0 && FL_FIXLEVEL < 2)
+bool const scalableTabfolders = false;
+#else
+bool const scalableTabfolders = true;
+#endif
+
+} // namespace anon
+
+
typedef FormController<ControlTabular, FormView<FD_tabular> > base_class;
FormTabular::FormTabular(Dialog & parent)
- : base_class(parent, _("Edit table settings")),
+ : base_class(parent, _("Edit table settings"), scalableTabfolders),
closing_(false), actCell_(-1)
{
}
longtable_options_.reset(build_tabular_longtable(this));
+ // Enable the tabfolder to be rescaled correctly.
+ if (scalableTabfolders)
+ fl_set_tabfolder_autofit(dialog_->tabfolder, FL_FIT);
+
+ // Stack tabs
fl_addto_tabfolder(dialog_->tabfolder, _("Tabular"),
tabular_options_->form);
fl_addto_tabfolder(dialog_->tabfolder, _("Column/Row"),
fl_addto_tabfolder(dialog_->tabfolder, _("LongTable"),
longtable_options_->form);
- // work-around xforms bug re update of folder->x, folder->y coords.
- setPrehandler(dialog_->tabfolder);
-
// FIXME: addReadOnly everything
}
lcol: FL_BLACK
label:
shortcut:
-resize: FL_RESIZE_NONE
+resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: tabfolder_prefs
callback:
lcol: FL_BLACK
label:
shortcut:
-resize: FL_RESIZE_NONE
+resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: tabfolder_inner
callback:
using std::vector;
using std::make_pair;
+
bool isActive(FL_OBJECT * ob)
{
return ob && ob->active > 0;
}
+
std::pair<string, string> parse_shortcut(string const & str)
{
string::size_type i = str.find_first_of("&");