* FormMinipage.C: return SMI_VALID on other form changes
2002-02-10 Rob Lahaye <lahaye@users.sourceforge.net>
+2002-02-11 Juergen Spitzmueller <j.spitzmueller@gmx.de>
+
+ * FormParagraph.C (update): [VSpace:] Delete the special method
+ for gluelengths...
+ * xforms_helpers.C: ...and move it here.
+ Activate JMarcs new (shorter) code for updateWidgetsFromLengthString
+ and updateWidgetsFromLength.
+
* forms/form_external.fd:
* form_external.C: change color2 of a few buttons into the
bool const metric = lyxrc.default_papersize > 3;
string const default_unit = metric ? "cm" : "in";
string const length = par_->params().spaceTop().length().asString();
- //check if there's a stretch or shrink factor
- if (!isValidLength(length) && !isStrDbl(length))
- fl_set_input(dialog_->input_space_above, length.c_str());
- else {
- updateWidgetsFromLengthString(dialog_->input_space_above,
+ updateWidgetsFromLengthString(dialog_->input_space_above,
dialog_->choice_value_space_above,
length, default_unit);
- }
break;
}
}
string const default_unit = metric ? "cm" : "in";
string const length =
par_->params().spaceBottom().length().asString();
- //check if there's a stretch or shrink factor
- if (!isValidLength(length) && !isStrDbl(length))
- fl_set_input(dialog_->input_space_below, length.c_str());
- else {
- updateWidgetsFromLengthString(dialog_->input_space_below,
+ updateWidgetsFromLengthString(dialog_->input_space_below,
dialog_->choice_value_space_below,
length, default_unit);
- }
break;
}
}
}
-#if 1
+#if 0
+// old code which can be deleted if the new one, now enabled,
+// works satisfyingly (JSpitzm, 11/02/2002)
// this should definitely be the other way around!!!
void updateWidgetsFromLength(FL_OBJECT * input, FL_OBJECT * choice,
LyXLength const & len,
if (len.zero())
updateWidgetsFromLengthString(input, choice,
string(), default_unit);
+ // use input field only for gluelengths
+ else if (!isValidLength(len) && !isStrDbl(len)) {
+ fl_set_input(input, len.c_str());
+ fl_set_choice_text(choice, default_unit.c_str());
+ }
else
updateWidgetsFromLengthString(input, choice,
len.asString(), default_unit);
string const & str,
string const & default_unit)
{
- updateWidgetsFromLength(input, choice,
+ // use input field only for gluelengths
+ if (!isValidLength(str) && !isStrDbl(str)) {
+ fl_set_input(input, str.c_str());
+ fl_set_choice_text(choice, default_unit.c_str());
+ } else {
+ updateWidgetsFromLength(input, choice,
LyXLength(str), default_unit);
+ }
}