]> git.lyx.org Git - features.git/commitdiff
frontends fixes from Juergen S
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 8 Mar 2002 11:05:48 +0000 (11:05 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 8 Mar 2002 11:05:48 +0000 (11:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3700 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormTabular.C

index faade6a9c30421706866e6da57f44390e8715f0f..eb109cc72349345ef656726f679865f11979a284 100644 (file)
@@ -1,3 +1,15 @@
+2002-03-07  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+
+       * FormGraphics.C:
+               - Make radiobuttons change too when using Latex size in
+                 lyxview and vice versa.
+               - Fix a typo where the value for height (lyxview) was
+                 taken from width (size).
+               - Remove *%-values from lyxview.
+               - Add an Alert when using "Get Latex size" and that contains
+                 *%-values.
+       * FormTabular.C: Remove obsolete comment.
+
 2002-03-07  Martin Vermeer <martin.vermeer@hut.fi>
 
        * FormMathsDeco.C: add leftrightarrows to the bitmap.
index 419d44052ac1c3b08ec3ae7e849401e2a7b1786f..2bdb9ed09d47aa204660527cf6b13a4ac032d310 100644 (file)
@@ -22,6 +22,7 @@
 #include "ControlGraphics.h"
 #include "FormGraphics.h"
 #include "form_graphics.h"
+#include "Alert.h"
 
 #include "xforms_helpers.h"
 #include "input_validators.h"
@@ -106,8 +107,8 @@ void FormGraphics::build()
        fl_set_input_return (lyxview_->input_lyxheight, FL_RETURN_CHANGED);
        fl_set_input_return (lyxview_->input_lyxscale, FL_RETURN_CHANGED);
 
-       fl_addto_choice(lyxview_->choice_width_lyxwidth, choice_Length_All.c_str());
-       fl_addto_choice(lyxview_->choice_width_lyxheight, choice_Length_All.c_str());
+       fl_addto_choice(lyxview_->choice_width_lyxwidth, choice_Length_WithUnit.c_str());
+       fl_addto_choice(lyxview_->choice_width_lyxheight, choice_Length_WithUnit.c_str());
 
        bc().addReadOnly(lyxview_->radio_pref);
        bc().addReadOnly(lyxview_->radio_mono);
@@ -482,16 +483,47 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
                setEnabled(lyxview_->choice_width_lyxheight, 0);
                setEnabled(lyxview_->input_lyxscale, 1);
        } else if (ob == lyxview_->button_latex_values) {
-           LyXLength dummy = LyXLength(getLengthFromWidgets(size_->input_width,
-               size_->choice_width_units));
-           updateWidgetsFromLength(lyxview_->input_lyxwidth,
-               lyxview_->choice_width_lyxwidth, dummy, defaultUnit);
-           dummy = LyXLength(getLengthFromWidgets(size_->input_height,
-               size_->choice_width_units));
-           updateWidgetsFromLength(lyxview_->input_lyxheight,
-               lyxview_->choice_width_lyxheight, dummy, defaultUnit);
-           string const scale = getStringFromInput(size_->input_scale);
-           fl_set_input(lyxview_->input_lyxscale, scale.c_str());
+               if (fl_get_choice(size_->choice_width_units) > 3
+                       && fl_get_choice(size_->choice_width_units) < 8
+                       || fl_get_choice(size_->choice_height_units) > 3
+                       && fl_get_choice(size_->choice_height_units) < 8)
+                               Alert::alert(_("Warning!"),
+                               _("The values %t, %p, %c and %l are not allowed here."),
+                               _("Cannot take the values from LaTeX size!."));
+               else {
+                       LyXLength dummy = LyXLength(getLengthFromWidgets(size_->input_width,
+                               size_->choice_width_units));
+                       updateWidgetsFromLength(lyxview_->input_lyxwidth,
+                               lyxview_->choice_width_lyxwidth, dummy, defaultUnit);
+                       dummy = LyXLength(getLengthFromWidgets(size_->input_height,
+                               size_->choice_height_units));
+                       updateWidgetsFromLength(lyxview_->input_lyxheight,
+                               lyxview_->choice_width_lyxheight, dummy, defaultUnit);
+                       string const scale = getStringFromInput(size_->input_scale);
+                       fl_set_input(lyxview_->input_lyxscale, scale.c_str());
+                       if (fl_get_button (size_->button_asis) == 1) {
+                               fl_set_button (lyxview_->button_lyxasis, 1);
+                               setEnabled(lyxview_->input_lyxwidth, 0);
+                               setEnabled(lyxview_->choice_width_lyxwidth, 0);
+                               setEnabled(lyxview_->input_lyxheight, 0);
+                               setEnabled(lyxview_->choice_width_lyxheight, 0);
+                               setEnabled(lyxview_->input_lyxscale, 0);
+                       } else if (fl_get_button (size_->button_wh) == 1) {
+                               fl_set_button (lyxview_->button_lyxwh, 1);
+                               setEnabled(lyxview_->input_lyxwidth, 1);
+                               setEnabled(lyxview_->choice_width_lyxwidth, 1);
+                               setEnabled(lyxview_->input_lyxheight, 1);
+                               setEnabled(lyxview_->choice_width_lyxheight, 1);
+                               setEnabled(lyxview_->input_lyxscale, 0);
+                       } else if (fl_get_button (size_->button_scale) ==1) {
+                               fl_set_button (lyxview_->button_lyxscale, 1);
+                               setEnabled(lyxview_->input_lyxwidth, 0);
+                               setEnabled(lyxview_->choice_width_lyxwidth, 0);
+                               setEnabled(lyxview_->input_lyxheight, 0);
+                               setEnabled(lyxview_->choice_width_lyxheight, 0);
+                               setEnabled(lyxview_->input_lyxscale, 1);
+                       }
+               }
 
        // the bb section
        } else if (!controller().bbChanged && 
@@ -554,6 +586,31 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
                size_->choice_height_units, dummy, defaultUnit);
            string const scale = getStringFromInput(lyxview_->input_lyxscale);
            fl_set_input(size_->input_scale, scale.c_str());
+           if (fl_get_button (lyxview_->button_lyxasis) == 1) {
+               fl_set_button (size_->button_asis, 1);
+               setEnabled(size_->input_width, 0);
+               setEnabled(size_->choice_width_units, 0);
+               setEnabled(size_->input_height, 0);
+               setEnabled(size_->choice_height_units, 0);
+               setEnabled(size_->check_aspectratio, 0);
+               setEnabled(size_->input_scale, 0);
+           } else if (fl_get_button (lyxview_->button_lyxwh) == 1) {
+               fl_set_button (size_->button_wh, 1);
+               setEnabled(size_->input_width, 1);
+               setEnabled(size_->choice_width_units, 1);
+               setEnabled(size_->input_height, 1);
+               setEnabled(size_->choice_height_units, 1);
+               setEnabled(size_->check_aspectratio, 1);
+               setEnabled(size_->input_scale, 0);
+           } else if (fl_get_button (lyxview_->button_lyxscale) ==1) {
+               fl_set_button (size_->button_scale, 1);
+               setEnabled(size_->input_width, 0);
+               setEnabled(size_->choice_width_units, 0);
+               setEnabled(size_->input_height, 0);
+               setEnabled(size_->choice_height_units, 0);
+               setEnabled(size_->check_aspectratio, 0);
+               setEnabled(size_->input_scale, 1);
+           }
        }
 
        // check if the input is valid
index 3535a6d32d5b0b9f4b005158cf98d1dcea16ff4c..8d95f31c51c43c4eb428f18d22781f896cc13ffb 100644 (file)
@@ -138,14 +138,6 @@ void FormTabular::build()
        fl_addto_tabfolder(dialog_->tabFolder, _("LongTable"),
                           longtable_options_->form);
 
-       // We should set these input filters on width fields to make them accept
-       // only unsigned numbers.
-       // But this leeds to trouble with the current apply behaviour (JSpitzm).
-       // fl_set_input_filter(column_options_->input_column_width,
-       //                  fl_unsigned_float_filter);
-       // fl_set_input_filter(cell_options_->input_mcolumn_width,
-       //                  fl_unsigned_float_filter);
-
        // Create the contents of the unit choices
        // Don't include the "%" terms...
        vector<string> units_vec = getLatexUnits();