+ switch (cmd.action) {
+
+ case LFUN_BREAKLINE:
+ if (type_ == "simple" || type_ == "equation") {
+ mutate("eqnarray");
+ idx = 1;
+ pos = 0;
+ return DISPATCHED_POP;
+ }
+ return MathGridInset::dispatch(cmd, idx, pos);
+
+ case LFUN_MATH_NUMBER:
+ //lyxerr << "toggling all numbers\n";
+ if (display()) {
+ //bv->lockedInsetStoreUndo(Undo::INSERT);
+ bool old = numberedType();
+ for (row_type row = 0; row < nrows(); ++row)
+ numbered(row, !old);
+ //bv->owner()->message(old ? _("No number") : _("Number"));
+ //updateLocal(bv, true);
+ }
+ return DISPATCHED;
+
+ case LFUN_MATH_NONUMBER:
+ if (display()) {
+ //bv->lockedInsetStoreUndo(Undo::INSERT);
+ bool old = numbered(row(idx));
+ //bv->owner()->message(old ? _("No number") : _("Number"));
+ numbered(row(idx), !old);
+ //updateLocal(bv, true);
+ }
+ return DISPATCHED;
+
+ case LFUN_INSERT_LABEL: {
+ row_type r = row(idx);
+ string old_label = label(r);
+ string new_label = cmd.argument;
+
+ if (new_label.empty()) {
+ string const default_label =
+ (lyxrc.label_init_length >= 0) ? "eq:" : "";
+ pair<bool, string> const res = old_label.empty()
+ ? Alert::askForText(_("Enter new label to insert:"), default_label)
+ : Alert::askForText(_("Enter label:"), old_label);
+ if (!res.first)
+ break;
+ new_label = trim(res.second);
+ }