switch (cmd.action) {
case LFUN_UNDO:
- flag.enabled(buffer_.undo().hasUndoStack());
+ flag.setEnabled(buffer_.undo().hasUndoStack());
break;
case LFUN_REDO:
- flag.enabled(buffer_.undo().hasRedoStack());
+ flag.setEnabled(buffer_.undo().hasRedoStack());
break;
case LFUN_FILE_INSERT:
case LFUN_FILE_INSERT_PLAINTEXT_PARA:
case LFUN_FILE_INSERT_PLAINTEXT:
case LFUN_BOOKMARK_SAVE:
// FIXME: Actually, these LFUNS should be moved to Text
- flag.enabled(cur.inTexted());
+ flag.setEnabled(cur.inTexted());
break;
case LFUN_FONT_STATE:
case LFUN_LABEL_INSERT:
case LFUN_BIBTEX_DATABASE_ADD:
case LFUN_BIBTEX_DATABASE_DEL:
case LFUN_STATISTICS:
- flag.enabled(true);
+ flag.setEnabled(true);
break;
case LFUN_NEXT_INSET_TOGGLE:
}
case LFUN_LABEL_GOTO: {
- flag.enabled(!cmd.argument().empty()
+ flag.setEnabled(!cmd.argument().empty()
|| getInsetByCode<InsetRef>(cur, REF_CODE));
break;
}
case LFUN_CHANGES_TRACK:
- flag.enabled(true);
+ flag.setEnabled(true);
flag.setOnOff(buffer_.params().trackChanges);
break;
case LFUN_CHANGES_OUTPUT:
- flag.enabled(true);
+ flag.setEnabled(true);
flag.setOnOff(buffer_.params().outputChanges);
break;
// In principle, these command should only be enabled if there
// is a change in the document. However, without proper
// optimizations, this will inevitably result in poor performance.
- flag.enabled(true);
+ flag.setEnabled(true);
break;
case LFUN_BUFFER_TOGGLE_COMPRESSION: {
case LFUN_SCROLL:
case LFUN_SCREEN_UP_SELECT:
case LFUN_SCREEN_DOWN_SELECT:
- flag.enabled(true);
+ flag.setEnabled(true);
break;
case LFUN_LAYOUT_TABULAR:
- flag.enabled(cur.innerInsetOfType(TABULAR_CODE));
+ flag.setEnabled(cur.innerInsetOfType(TABULAR_CODE));
break;
case LFUN_LAYOUT:
- flag.enabled(!cur.inset().forceEmptyLayout(cur.idx()));
+ flag.setEnabled(!cur.inset().forceEmptyLayout(cur.idx()));
break;
case LFUN_LAYOUT_PARAGRAPH:
- flag.enabled(cur.inset().allowParagraphCustomization(cur.idx()));
+ flag.setEnabled(cur.inset().allowParagraphCustomization(cur.idx()));
break;
case LFUN_INSET_SETTINGS: {
InsetCode code = cur.inset().lyxCode();
if (cmd.getArg(0) == insetName(code)) {
- flag.enabled(true);
+ flag.setEnabled(true);
break;
}
bool enable = false;
default:
break;
}
- flag.enabled(enable);
+ flag.setEnabled(enable);
break;
}
case LFUN_DIALOG_SHOW_NEW_INSET:
- flag.enabled(cur.inset().lyxCode() != ERT_CODE &&
+ flag.setEnabled(cur.inset().lyxCode() != ERT_CODE &&
cur.inset().lyxCode() != LISTINGS_CODE);
if (cur.inset().lyxCode() == CAPTION_CODE) {
FuncStatus flag;
docstring const branchName = cmd.argument();
if (!branchName.empty())
enable = buffer_.params().branchlist().find(branchName);
- flag.enabled(enable);
+ flag.setEnabled(enable);
break;
}
default:
- flag.enabled(false);
+ flag.setEnabled(false);
}
return flag;
}
-void FuncStatus::enabled(bool b)
+void FuncStatus::setEnabled(bool b)
{
if (b)
v_ &= ~DISABLED;
bool unknown() const;
///
- void enabled(bool b);
+ void setEnabled(bool b);
/// tells whether it can be invoked (otherwise it will be grayed-out).
bool enabled() const;
if (cmd.action == LFUN_NOACTION) {
flag.message(from_utf8(N_("Nothing to do")));
- flag.enabled(false);
+ flag.setEnabled(false);
return flag;
}
case LFUN_THESAURUS_ENTRY:
#endif
flag.unknown(true);
- flag.enabled(false);
+ flag.setEnabled(false);
break;
default:
// no, exit directly
flag.message(from_utf8(N_("Command not allowed with"
"out any document open")));
- flag.enabled(false);
+ flag.setEnabled(false);
return flag;
}
}
if (!enable)
- flag.enabled(false);
+ flag.setEnabled(false);
// Can we use a readonly buffer?
if (buf && buf->isReadonly()
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::ReadOnly)
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)) {
flag.message(from_utf8(N_("Document is read-only")));
- flag.enabled(false);
+ flag.setEnabled(false);
}
// Are we in a DELETED change-tracking region?
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::ReadOnly)
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)) {
flag.message(from_utf8(N_("This portion of the document is deleted.")));
- flag.enabled(false);
+ flag.setEnabled(false);
}
// the default error message if we disable the command
&& (cur.empty() || !cur.inset().insetAllowed(code)))
enable = false;
- flag.enabled(enable);
+ flag.setEnabled(enable);
return true;
}
}
if (!enable)
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
}
}
if (!enable)
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
}
}
if (enabled || !i.optional()) {
items_.push_back(i);
- items_.back().status().enabled(enabled);
+ items_.back().status().setEnabled(enabled);
}
}
else
// Allow modification of our data.
// This needs to be handled in the doDispatch method of our
// instantiatable children.
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
case LFUN_INSET_INSERT:
// Don't allow insertion of new insets.
// Every inset that wants to allow new insets from open
// dialogs needs to override this.
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
case LFUN_INSET_TOGGLE:
// remove this if we dissociate toggle from edit.
- flag.enabled(editable() == IS_EDITABLE);
+ flag.setEnabled(editable() == IS_EDITABLE);
return true;
default:
{
switch (cmd.action) {
case LFUN_INSET_EDIT:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype")
flag.setOnOff(cmd.getArg(1) == params_.type);
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
case LFUN_INSET_DIALOG_UPDATE:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
case LFUN_BREAK_PARAGRAPH:
if (params_.inner_box || params_.type == "Framed")
return InsetCollapsable::getStatus(cur, cmd, flag);
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
default:
switch (cmd.action) {
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
- flag.enabled(true);
+ flag.setEnabled(true);
break;
case LFUN_INSET_TOGGLE:
if (cmd.argument() == "open" || cmd.argument() == "close" ||
cmd.argument() == "toggle")
- flag.enabled(true);
+ flag.setEnabled(true);
else if (cmd.argument() == "assign" || cmd.argument().empty()) {
if (isBranchSelected())
- flag.enabled(status() != Open);
+ flag.setEnabled(status() != Open);
else
- flag.enabled(status() != Collapsed);
+ flag.setEnabled(status() != Collapsed);
} else
- flag.enabled(true);
+ flag.setEnabled(true);
break;
default:
case LFUN_BREAK_PARAGRAPH:
case LFUN_BREAK_PARAGRAPH_SKIP:
- status.enabled(false);
+ status.setEnabled(false);
return true;
case LFUN_OPTIONAL_INSERT:
- status.enabled(cur.paragraph().insetList().find(OPTARG_CODE) == -1);
+ status.setEnabled(cur.paragraph().insetList().find(OPTARG_CODE) == -1);
return true;
case LFUN_INSET_TOGGLE:
case LFUN_TOC_INSERT:
case LFUN_WRAP_INSERT:
if (layout_->isPassThru()) {
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
}
return InsetText::getStatus(cur, cmd, flag);
case LFUN_INSET_TOGGLE:
if (cmd.argument() == "open")
- flag.enabled(status_ != Open);
+ flag.setEnabled(status_ != Open);
else if (cmd.argument() == "close")
- flag.enabled(status_ == Open);
+ flag.setEnabled(status_ == Open);
else if (cmd.argument() == "toggle" || cmd.argument().empty()) {
- flag.enabled(true);
+ flag.setEnabled(true);
flag.setOnOff(status_ == Open);
} else
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
case LFUN_LANGUAGE:
- flag.enabled(!layout_->isForceLtr());
+ flag.setEnabled(!layout_->isForceLtr());
return InsetText::getStatus(cur, cmd, flag);
case LFUN_BREAK_PARAGRAPH:
case LFUN_BREAK_PARAGRAPH_SKIP:
- flag.enabled(layout_->isMultiPar());
+ flag.setEnabled(layout_->isMultiPar());
return true;
default:
switch (cmd.action) {
// suppress these
case LFUN_ERT_INSERT:
- status.enabled(false);
+ status.setEnabled(false);
return true;
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
string const newtype = cmd.getArg(1);
- status.enabled(p_.isCompatibleCommand(p_.code(), newtype));
+ status.setEnabled(p_.isCompatibleCommand(p_.code(), newtype));
status.setOnOff(newtype == p_.getCmdName());
}
- status.enabled(true);
+ status.setEnabled(true);
return true;
case LFUN_INSET_DIALOG_UPDATE:
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
return Inset::getStatus(cur, cmd, status);
case LFUN_PASTE:
case LFUN_PRIMARY_SELECTION_PASTE:
case LFUN_QUOTE_INSERT:
- status.enabled(true);
+ status.setEnabled(true);
return true;
// this one is difficult to get right. As a half-baked
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
switch (cmd.action) {
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
- status.enabled(true);
+ status.setEnabled(true);
return true;
case LFUN_CAPTION_INSERT:
- status.enabled(!params().isInline());
+ status.setEnabled(!params().isInline());
return true;
default:
return InsetCollapsable::getStatus(cur, cmd, status);
string2params(to_utf8(cmd.argument()), params);
status.setOnOff(params_.kind == params.kind);
}
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
return Inset::getStatus(cur, cmd, status);
string2params(to_utf8(cmd.argument()), params);
status.setOnOff(params_.kind == params.kind);
}
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
return Inset::getStatus(cur, cmd, status);
case LFUN_INSET_MODIFY:
// disallow comment and greyed out in commands
- flag.enabled(!cur.paragraph().layout().isCommand() ||
+ flag.setEnabled(!cur.paragraph().layout().isCommand() ||
cmd.getArg(2) == "Note");
if (cmd.getArg(0) == "note") {
InsetNoteParams params;
return true;
case LFUN_INSET_DIALOG_UPDATE:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
string2params(to_utf8(cmd.argument()), params);
status.setOnOff(params_.kind == params.kind);
}
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
return Inset::getStatus(cur, cmd, status);
default:
return InsetText::getStatus(cur, cmd, status);
}
- status.enabled(enabled);
+ status.setEnabled(enabled);
return true;
}
return true;
case Tabular::MULTICOLUMN:
- status.enabled(sel_row_start == sel_row_end);
+ status.setEnabled(sel_row_start == sel_row_end);
status.setOnOff(tabular.isMultiColumn(cur.idx()));
break;
case Tabular::SET_ALL_LINES:
case Tabular::UNSET_ALL_LINES:
case Tabular::SET_BORDER_LINES:
- status.enabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
break;
case Tabular::TOGGLE_LINE_TOP:
- status.enabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
status.setOnOff(tabular.topLine(cur.idx()));
break;
case Tabular::TOGGLE_LINE_BOTTOM:
- status.enabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
status.setOnOff(tabular.bottomLine(cur.idx()));
break;
case Tabular::TOGGLE_LINE_LEFT:
- status.enabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
status.setOnOff(tabular.leftLine(cur.idx()));
break;
case Tabular::TOGGLE_LINE_RIGHT:
- status.enabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
+ status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
status.setOnOff(tabular.rightLine(cur.idx()));
break;
break;
case Tabular::ALIGN_BLOCK:
- status.enabled(!tabular.getPWidth(cur.idx()).zero());
+ status.setEnabled(!tabular.getPWidth(cur.idx()).zero());
status.setOnOff(tabular.getAlignment(cur.idx(), flag) == LYX_ALIGN_BLOCK);
break;
break;
case Tabular::TOGGLE_LTCAPTION:
- status.enabled(sel_row_start == sel_row_end);
+ status.setEnabled(sel_row_start == sel_row_end);
status.setOnOff(tabular.ltCaption(sel_row_start));
break;
default:
status.clear();
- status.enabled(false);
+ status.setEnabled(false);
break;
}
return true;
// These are only enabled inside tabular
case LFUN_CELL_BACKWARD:
case LFUN_CELL_FORWARD:
- status.enabled(true);
+ status.setEnabled(true);
return true;
// disable these with multiple cells selected
case LFUN_WRAP_INSERT:
case LFUN_ERT_INSERT: {
if (tablemode(cur)) {
- status.enabled(false);
+ status.setEnabled(false);
return true;
} else
return cell(cur.idx())->getStatus(cur, cmd, status);
case LFUN_BREAK_PARAGRAPH:
case LFUN_BREAK_PARAGRAPH_SKIP: {
if (tabular.getPWidth(cur.idx()).zero()) {
- status.enabled(false);
+ status.setEnabled(false);
return true;
} else
return cell(cur.idx())->getStatus(cur, cmd, status);
case LFUN_PASTE:
if (tabularStackDirty() && theClipboard().isInternal()) {
- status.enabled(true);
+ status.setEnabled(true);
return true;
} else
return cell(cur.idx())->getStatus(cur, cmd, status);
case LFUN_INSET_MODIFY:
if (insetCode(cmd.getArg(0)) == TABULAR_CODE) {
- status.enabled(true);
+ status.setEnabled(true);
return true;
}
// Fall through
InsetVSpace::string2params(to_utf8(cmd.argument()), vspace);
status.setOnOff(vspace == space_);
}
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
return Inset::getStatus(cur, cmd, status);
switch (cmd.action) {
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
- flag.enabled(true);
+ flag.setEnabled(true);
return true;
default:
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")), name_));
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
}
return InsetMathGrid::getStatus(cur, cmd, flag);
case LFUN_TABULAR_FEATURE: {
docstring const & s = cmd.argument();
if (s == "add-vline-left" || s == "add-vline-right") {
- flag.enabled(false);
+ flag.setEnabled(false);
flag.message(bformat(
from_utf8(N_("No vertical grid lines in 'cases': feature %1$s")),
s));
case LFUN_TABULAR_FEATURE: {
string const s = to_utf8(cmd.argument());
if (nrows() <= 1 && (s == "delete-row" || s == "swap-row")) {
- status.enabled(false);
+ status.setEnabled(false);
status.message(from_utf8(N_("Only one row")));
return true;
}
if (ncols() <= 1 &&
(s == "delete-column" || s == "swap-column")) {
- status.enabled(false);
+ status.setEnabled(false);
status.message(from_utf8(N_("Only one column")));
return true;
}
s == "delete-hline-above") ||
(rowinfo_[cur.row() + 1].lines_ == 0 &&
s == "delete-hline-below")) {
- status.enabled(false);
+ status.setEnabled(false);
status.message(from_utf8(N_("No hline to delete")));
return true;
}
s == "delete-vline-left") ||
(colinfo_[cur.col() + 1].lines_ == 0 &&
s == "delete-vline-right")) {
- status.enabled(false);
+ status.setEnabled(false);
status.message(from_utf8(N_("No vline to delete")));
return true;
}
s == "copy-column" || s == "swap-column" ||
s == "add-vline-left" || s == "add-vline-right" ||
s == "delete-vline-left" || s == "delete-vline-right")
- status.enabled(true);
+ status.setEnabled(true);
else {
- status.enabled(false);
+ status.setEnabled(false);
status.message(bformat(
from_utf8(N_("Unknown tabular feature '%1$s'")), lyx::from_ascii(s)));
}
break;
}
status.setOnOff(cmd.argument()[0] == v_align_);
- status.enabled(true);
+ status.setEnabled(true);
#endif
return true;
}
case LFUN_CELL_SPLIT:
- status.enabled(true);
+ status.setEnabled(true);
return true;
case LFUN_CELL_BACKWARD:
case LFUN_CELL_FORWARD:
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
case LFUN_MATH_MUTATE:
case LFUN_MATH_DISPLAY:
// we handle these
- status.enabled(true);
+ status.setEnabled(true);
return true;
case LFUN_MATH_NUMBER_TOGGLE:
// FIXME: what is the right test, this or the one of
// LABEL_INSERT?
- status.enabled(display());
+ status.setEnabled(display());
status.setOnOff(numberedType());
return true;
case LFUN_MATH_NUMBER_LINE_TOGGLE: {
bool const enable = (type_ == hullMultline) ?
(nrows() - 1 == cur.row()) : display();
row_type const r = (type_ == hullMultline) ? nrows() - 1 : cur.row();
- status.enabled(enable);
+ status.setEnabled(enable);
status.setOnOff(numbered(r));
return true;
}
case LFUN_LABEL_INSERT:
- status.enabled(type_ != hullSimple);
+ status.setEnabled(type_ != hullSimple);
return true;
case LFUN_INSET_INSERT:
if (cmd.getArg(0) == "label") {
- status.enabled(type_ != hullSimple);
+ status.setEnabled(type_ != hullSimple);
return true;
}
return InsetMathGrid::getStatus(cur, cmd, status);
status.message(bformat(
from_utf8(N_("Can't change number of rows in '%1$s'")),
hullName(type_)));
- status.enabled(false);
+ status.setEnabled(false);
return true;
}
if (!colChangeOK()
status.message(bformat(
from_utf8(N_("Can't change number of columns in '%1$s'")),
hullName(type_)));
- status.enabled(false);
+ status.setEnabled(false);
return true;
}
if ((type_ == hullSimple
status.message(bformat(
from_utf8(N_("Can't add horizontal grid lines in '%1$s'")),
hullName(type_)));
- status.enabled(false);
+ status.setEnabled(false);
return true;
}
if (s == "add-vline-left" || s == "add-vline-right") {
status.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
hullName(type_)));
- status.enabled(false);
+ status.setEnabled(false);
return true;
}
if (s == "valign-top" || s == "valign-middle"
|| s == "valign-bottom" || s == "align-left"
|| s == "align-center" || s == "align-right") {
- status.enabled(false);
+ status.setEnabled(false);
return true;
}
return InsetMathGrid::getStatus(cur, cmd, status);
string const arg = to_utf8(cmd.argument());
switch (cmd.action) {
case LFUN_TABULAR_FEATURE:
- flag.enabled(false);
+ flag.setEnabled(false);
break;
#if 0
case LFUN_TABULAR_FEATURE:
case LFUN_FONT_NOUN:
case LFUN_FONT_ROMAN:
case LFUN_FONT_DEFAULT:
- flag.enabled(true);
+ flag.setEnabled(true);
break;
case LFUN_MATH_MUTATE:
//flag.setOnOff(mathcursor::formula()->hullType() == to_utf8(cmd.argument()));
case LFUN_MATH_SPACE:
case LFUN_MATH_LIMITS:
case LFUN_MATH_EXTERN:
- flag.enabled(true);
+ flag.setEnabled(true);
break;
case LFUN_FONT_FRAK:
- flag.enabled(currentMode() != TEXT_MODE);
+ flag.setEnabled(currentMode() != TEXT_MODE);
break;
case LFUN_MATH_INSERT: {
arg == "\\textsl" || arg == "\\textup" ||
arg == "\\texttt" || arg == "\\textbb" ||
arg == "\\textnormal";
- flag.enabled(currentMode() != TEXT_MODE || textarg);
+ flag.setEnabled(currentMode() != TEXT_MODE || textarg);
break;
}
case LFUN_MATH_MATRIX:
- flag.enabled(currentMode() == MATH_MODE);
+ flag.setEnabled(currentMode() == MATH_MODE);
break;
case LFUN_INSET_INSERT: {
// getStatus is not called with a valid reference and the
// dialog would not be applyable.
string const name = cmd.getArg(0);
- flag.enabled(name == "ref");
+ flag.setEnabled(name == "ref");
break;
}
case LFUN_MATH_DELIM:
case LFUN_MATH_BIGDELIM:
// Don't do this with multi-cell selections
- flag.enabled(cur.selBegin().idx() == cur.selEnd().idx());
+ flag.setEnabled(cur.selBegin().idx() == cur.selEnd().idx());
break;
case LFUN_MATH_MACRO_FOLD:
case LFUN_MATH_MACRO_UNFOLD: {
Cursor it = cur;
bool found = findMacroToFoldUnfold(it, cmd.action == LFUN_MATH_MACRO_FOLD);
- flag.enabled(found);
+ flag.setEnabled(found);
break;
}
case LFUN_SPECIALCHAR_INSERT:
// FIXME: These would probably make sense in math-text mode
- flag.enabled(false);
+ flag.setEnabled(false);
break;
case LFUN_INSET_DISSOLVE:
- flag.enabled(!asHullInset());
+ flag.setEnabled(!asHullInset());
break;
default:
case LFUN_MOUSE_RELEASE:
case LFUN_MOUSE_PRESS:
case LFUN_MOUSE_MOTION:
- status.enabled(true);
+ status.setEnabled(true);
return true;
default:
return CommandInset::getStatus(cur, cmd, status);
if (s == "add-vline-left" || s == "add-vline-right") {
flag.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")), name_));
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
}
return InsetMathGrid::getStatus(cur, cmd, flag);
flag.message(bformat(
from_utf8(N_("Can't add vertical grid lines in '%1$s'")),
from_utf8(name)));
- flag.enabled(false);
+ flag.setEnabled(false);
return true;
}
return InsetMathGrid::getStatus(cur, cmd, flag);
num = convert<int>(arg);
bool on = (num >= optionals_
&& numargs_ < 9 && num <= numargs_ + 1);
- flag.enabled(on);
+ flag.setEnabled(on);
break;
}
case LFUN_MATH_MACRO_APPEND_GREEDY_PARAM:
- flag.enabled(numargs_ < 9);
+ flag.setEnabled(numargs_ < 9);
break;
case LFUN_MATH_MACRO_REMOVE_PARAM: {
int num = numargs_;
if (arg.size() != 0)
num = convert<int>(arg);
- flag.enabled(num >= 1 && num <= numargs_);
+ flag.setEnabled(num >= 1 && num <= numargs_);
break;
}
case LFUN_MATH_MACRO_MAKE_OPTIONAL:
- flag.enabled(numargs_ > 0
+ flag.setEnabled(numargs_ > 0
&& optionals_ < numargs_
&& type_ != MacroTypeDef);
break;
case LFUN_MATH_MACRO_MAKE_NONOPTIONAL:
- flag.enabled(optionals_ > 0
+ flag.setEnabled(optionals_ > 0
&& type_ != MacroTypeDef);
break;
case LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM:
- flag.enabled(numargs_ < 9);
+ flag.setEnabled(numargs_ < 9);
break;
case LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM:
- flag.enabled(optionals_ > 0);
+ flag.setEnabled(optionals_ > 0);
break;
case LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM:
- flag.enabled(numargs_ == 0
+ flag.setEnabled(numargs_ == 0
&& type_ != MacroTypeDef);
break;
case LFUN_IN_MATHMACROTEMPLATE:
- flag.enabled(true);
+ flag.setEnabled(true);
break;
default: