]> git.lyx.org Git - lyx.git/commitdiff
Prepare the way for resizable tabfolders if the xforms version is
authorAngus Leeming <leeming@lyx.org>
Wed, 9 Apr 2003 21:34:50 +0000 (21:34 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 9 Apr 2003 21:34:50 +0000 (21:34 +0000)
up to the task.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6749 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormAboutlyx.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/forms/form_preferences.fd
src/frontends/xforms/xforms_helpers.C

index 14404a76554bee67fd19d3d00325a74a558fb275..bd8c681613cdd21e4a4300f53a713b4bfe01100d 100644 (file)
@@ -1,3 +1,13 @@
+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:
index 4b6e6227c9437b2447298ce4b7d72031d30eb084..87a277b154ac3d8b489379947a9bdf3247187a5a 100644 (file)
 
 #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)
 {}
 
 
@@ -63,7 +73,11 @@ void FormAboutlyx::build()
 
        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"),
@@ -71,9 +85,6 @@ void FormAboutlyx::build()
        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);
 }
index 48cabdb7f5e2bb75de076b2643ee8ed05406e6df..a71314f4c45ed678425dda36632df5459abfbda9 100644 (file)
@@ -48,10 +48,21 @@ using std::bind2nd;
 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)
 {}
@@ -322,6 +333,11 @@ void FormDocument::build()
        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"),
@@ -333,9 +349,6 @@ void FormDocument::build()
        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 "
index 32bd0e2011ec351a246e8f6c4c957d67505fd23e..8cbdc638a2e315f832f2ee085b53faa348cab746 100644 (file)
@@ -52,13 +52,19 @@ int const FILENAME_MAXCHARS = 1024;
 
 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)
 {}
 
 
@@ -257,14 +263,15 @@ void FormGraphics::build()
                "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;
index 967d2acd6017ceda3fae028c89db0ba5dda0e163..6630f8c81308e08e9a51f2ec62a317961fc73be6 100644 (file)
@@ -101,13 +101,20 @@ string const X11hexname(RGBColor const & col)
        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),
@@ -196,6 +203,28 @@ void FormPreferences::build()
        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"),
@@ -263,13 +292,6 @@ void FormPreferences::build()
        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);
 }
 
 
index f241089ca378060797a11911c93cf53da377c6dd..58bceb7aa7169b1e4c9b500ae7e27a658c52bd97 100644 (file)
@@ -35,10 +35,21 @@ using std::vector;
 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)
 {
 }
@@ -111,6 +122,11 @@ void FormTabular::build()
 
        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"),
@@ -120,9 +136,6 @@ void FormTabular::build()
        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
 }
 
index acde64cdd04e90551816cb138d4ef517e1e3a992..fb30e666321575e278da84394204e064ae266f25 100644 (file)
@@ -43,7 +43,7 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: 
 shortcut: 
-resize: FL_RESIZE_NONE
+resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: tabfolder_prefs
 callback: 
@@ -193,7 +193,7 @@ size: FL_DEFAULT_SIZE
 lcol: FL_BLACK
 label: 
 shortcut: 
-resize: FL_RESIZE_NONE
+resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
 name: tabfolder_inner
 callback: 
index 1fe3d7bac36af3c6fae890f01bf066bd2de2bac7..f3f7c4b9bcb5be4ea7e19a38a0e0445aff4c5bce 100644 (file)
@@ -33,11 +33,13 @@ using std::pair;
 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("&");