Implement checkWidgets in the remaining InsetParamsWidget derived dialogs.

This commit is contained in:
Juergen Spitzmueller 2015-04-02 17:03:08 +02:00
parent 5aee9e6d63
commit b309fa5d2b
12 changed files with 106 additions and 0 deletions

View File

@ -251,6 +251,18 @@ void FloatPlacement::checkAllowed()
}
}
bool FloatPlacement::checkWidgets(bool readonly) const
{
floatTypeCO->setEnabled(!readonly);
defaultsCB->setEnabled(!readonly);
options->setEnabled(!readonly);
spanCB->setEnabled(!readonly);
sidewaysCB->setEnabled(!readonly);
return InsetParamsWidget::checkWidgets();
}
} // namespace frontend
} // namespace lyx

View File

@ -37,6 +37,7 @@ public:
FuncCode creationCode() const { return LFUN_FLOAT_INSERT; }
void paramsToDialog(Inset const *);
docstring dialogToParams() const;
bool checkWidgets(bool readonly) const;
//@}
///
void useWide();

View File

@ -411,6 +411,27 @@ docstring GuiBox::dialogToParams() const
}
bool GuiBox::checkWidgets(bool readonly) const
{
pagebreakCB->setEnabled(!readonly);
typeCO->setEnabled(!readonly);
innerBoxCO->setEnabled(!readonly);
valignCO->setEnabled(!readonly);
ialignCO->setEnabled(!readonly);
halignCO->setEnabled(!readonly);
valignCO->setEnabled(!readonly);
ialignCO->setEnabled(!readonly);
widthCB->setEnabled(!readonly);
widthED->setReadOnly(readonly);
widthUnitsLC->setEnabled(!readonly);
heightED->setReadOnly(readonly);
heightUnitsLC->setEnabled(!readonly);
heightCB->setEnabled(!readonly);
return InsetParamsWidget::checkWidgets();
}
void GuiBox::setSpecial(bool ibox)
{
QString const last_item =

View File

@ -42,6 +42,7 @@ private:
FuncCode creationCode() const { return LFUN_BOX_INSERT; }
void paramsToDialog(Inset const *);
docstring dialogToParams() const;
bool checkWidgets(bool readonly) const;
//@}
/// add and remove special lengths

View File

@ -64,6 +64,14 @@ docstring GuiBranch::dialogToParams() const
return from_utf8(InsetBranch::params2string(params));
}
bool GuiBranch::checkWidgets(bool readonly) const
{
branchCO->setEnabled(!readonly);
return InsetParamsWidget::checkWidgets();
}
} // namespace frontend
} // namespace lyx

View File

@ -34,6 +34,7 @@ private:
FuncCode creationCode() const { return LFUN_BRANCH_INSERT; }
void paramsToDialog(Inset const *);
docstring dialogToParams() const;
bool checkWidgets(bool readonly) const;
//@}
};

View File

@ -58,6 +58,14 @@ void GuiERT::paramsToDialog(Inset const * inset)
}
}
bool GuiERT::checkWidgets(bool readonly) const
{
ertBG->setEnabled(!readonly);
return InsetParamsWidget::checkWidgets();
}
} // namespace frontend
} // namespace lyx

View File

@ -32,6 +32,7 @@ private:
FuncCode creationCode() const { return LFUN_INSET_INSERT; }
void paramsToDialog(Inset const *);
docstring dialogToParams() const;
bool checkWidgets(bool readonly) const;
//@}
};

View File

@ -1012,6 +1012,46 @@ void GuiTabular::paramsToDialog(Inset const * inset)
}
bool GuiTabular::checkWidgets(bool readonly) const
{
tabularRowED->setReadOnly(readonly);
tabularColumnED->setReadOnly(readonly);
multicolumnCB->setEnabled(!readonly);
multirowCB->setEnabled(!readonly);
specialAlignmentED->setReadOnly(readonly);
rotateCellCB->setEnabled(!readonly);
rotateCellAngleSB->setEnabled(!readonly);
rotateTabularCB->setEnabled(!readonly);
rotateTabularAngleSB->setEnabled(!readonly);
longTabularCB->setEnabled(!readonly);
borders->setEnabled(!readonly);
tabularWidthED->setReadOnly(readonly);
tabularWidthUnitLC->setEnabled(!readonly);
columnWidthED->setReadOnly(readonly);
columnWidthUnitLC->setEnabled(!readonly);
multirowOffsetED->setReadOnly(readonly);
multirowOffsetUnitLC->setEnabled(!readonly);
setBordersGB->setEnabled(!readonly);
allBordersGB->setEnabled(!readonly);
borderStyleGB->setEnabled(!readonly);
booktabsRB->setEnabled(!readonly);
topspaceCO->setEnabled(!readonly);
topspaceUnitLC->setEnabled(!readonly);
bottomspaceCO->setEnabled(!readonly);
bottomspaceUnitLC->setEnabled(!readonly);
interlinespaceCO->setEnabled(!readonly);
interlinespaceUnitLC->setEnabled(!readonly);
hAlignCO->setEnabled(!readonly);
decimalPointED->setReadOnly(readonly);
vAlignCO->setEnabled(!readonly);
TableAlignCO->setEnabled(!readonly);
longtableGB->setEnabled(!readonly);
alignmentGB->setEnabled(!readonly);
return InsetParamsWidget::checkWidgets();
}
bool GuiTabular::funcEnabled(Tabular::Feature f) const
{
string cmd = "tabular " + featureAsString(f);

View File

@ -44,6 +44,7 @@ private:
FuncCode creationCode() const { return LFUN_TABULAR_INSERT; }
void paramsToDialog(Inset const *);
docstring dialogToParams() const;
bool checkWidgets(bool readonly) const;
//@}
///

View File

@ -146,6 +146,17 @@ void GuiVSpace::paramsToDialog(Inset const * inset)
enableCustom(spacingCO->currentIndex());
}
bool GuiVSpace::checkWidgets(bool readonly) const
{
valueLE->setReadOnly(readonly);
spacingCO->setEnabled(!readonly);
unitCO->setEnabled(!readonly);
keepCB->setEnabled(!readonly);
return InsetParamsWidget::checkWidgets();
}
} // namespace frontend
} // namespace lyx

View File

@ -39,6 +39,7 @@ private:
FuncCode creationCode() const { return LFUN_INSET_INSERT; }
void paramsToDialog(Inset const *);
docstring dialogToParams() const;
bool checkWidgets(bool readonly) const;
//@}
};