* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
+ * \author Abdelrazak Younes
* \author Uwe Stöhr
*
* Full author contact details are available in file CREDITS.
WidthLE->setValidator(unsignedGlueLengthValidator(WidthLE));
HeightLE->setValidator(unsignedGlueLengthValidator(HeightLE));
- OffsetLE->setText("0");
+ OffsetLE->setText("0.5");
+ OffsetUnitCO->setCurrentItem(Length::EX);
WidthLE->setText("100");
- HeightLE->setText("0.5");
+ WidthUnitCO->setCurrentItem(Length::PCW);
+ HeightLE->setText("1");
+ HeightUnitCO->setCurrentItem(Length::PT);
setFocusProxy(WidthLE);
}
docstring GuiLine::dialogToParams() const
{
InsetCommandParams params(insetCode());
- params["offset"] = from_utf8(widgetsToLength(OffsetLE, OffsetUnitCO));;
+ params["offset"] = from_utf8(widgetsToLength(OffsetLE, OffsetUnitCO));
params["width"] = from_utf8(widgetsToLength(WidthLE, WidthUnitCO));
params["height"] = from_utf8(widgetsToLength(HeightLE, HeightUnitCO));
params.setCmdName("rule");
- return from_ascii(InsetLine::params2string("line", params));
+ return from_ascii(InsetLine::params2string(params));
}
}
-bool GuiLine::checkWidgets() const
+bool GuiLine::checkWidgets(bool readonly) const
{
+ WidthLE->setReadOnly(readonly);
+ HeightLE->setReadOnly(readonly);
+ OffsetLE->setReadOnly(readonly);
+ OffsetUnitCO->setEnabled(!readonly);
+ HeightUnitCO->setEnabled(!readonly);
+ WidthUnitCO->setEnabled(!readonly);
if (!InsetParamsWidget::checkWidgets())
return false;
// FIXME: this should be handled in unsignedGlueLengthValidator!
// FIXME: this should be handled in unsignedGlueLengthValidator!
if (HeightLE->text().startsWith('-'))
return false;
- // FIXME: Is there something else to check?
return true;
}