Michael Schmitt wrote:
> - Graphics dialog: "Get LyX/LaTeX size" does not switch between
> "default", "scale", and "custom" automatically.

Done. Furthermore:
- Fix a typo where the value for height (lyxview) was taken from width (size).
- Remove bogus *%-values from lyxview (t% may be readded later if it is 
supported).
- Add an Alert Message when using "Get Latex size" and Latex size  contains 
*%-values.
- FormTabular.C: Remove obsolete comment (of mine).

Regards,
Juergen

---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/
Index: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.311
diff -u -r1.311 ChangeLog
--- src/frontends/xforms/ChangeLog	2002/03/07 09:59:17	1.311
+++ src/frontends/xforms/ChangeLog	2002/03/07 11:32:48
@@ -1,3 +1,15 @@
+2002-03-07  Juergen Spitzmueller  <[EMAIL PROTECTED]>
+
+	* 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  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* xformsGImage.C (statusCB, errorCB): close the file streams once the
Index: src/frontends/xforms/FormGraphics.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormGraphics.C,v
retrieving revision 1.51
diff -u -r1.51 FormGraphics.C
--- src/frontends/xforms/FormGraphics.C	2002/02/26 10:50:47	1.51
+++ src/frontends/xforms/FormGraphics.C	2002/03/07 11:32:50
@@ -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 @@
 	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 @@
 	    	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 @@
 		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: src/frontends/xforms/FormTabular.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormTabular.C,v
retrieving revision 1.38
diff -u -r1.38 FormTabular.C
--- src/frontends/xforms/FormTabular.C	2002/02/20 14:48:59	1.38
+++ src/frontends/xforms/FormTabular.C	2002/03/07 11:32:52
@@ -138,14 +138,6 @@
 	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();

Reply via email to