# on: the toolbar is visible
# off: the toolbar is not visible
# math: the toolbar is visible only when in math
+# mathmacrotemplate: the toolbar is visible only when in a macro definition
# table: the toolbar is visible only when in a table
# top: the toolbar should be at the top of the window
# bottom: the toolbar should be at the bottom of the window
"table" "table,bottom"
"math_panels" "math,bottom"
"math" "math,bottom"
- "math_macros" "off,bottom"
+ "mathmacrotemplate" "auto,mathmacrotemplate,bottom"
"minibuffer" "off,bottom"
End
Item "Toggle Math Panels" "toolbar-toggle math_panels"
End
- Toolbar "math_macros" "Math Macros"
+ Toolbar "mathmacrotemplate" "Math Macros"
Item "Remove Last Parameter" "math-macro-remove-param"
Item "Append Parameter" "math-macro-add-param"
Separator
{ LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM, "math-macro-add-optional-param", Noop, Math },
{ LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM, "math-macro-remove-optional-param", Noop, Math },
{ LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM, "math-macro-add-greedy-optional-param", Noop, Math },
+ { LFUN_IN_MATHMACROTEMPLATE, "in-mathmacrotemplate", Noop, Math },
{ LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
{ LFUN_META_PREFIX, "meta-prefix", NoBuffer, System },
{ LFUN_NEW_LINE, "new-line", Noop, Edit },
flag = ToolbarInfo::MATH;
else if (!compare_ascii_no_case(*cit, "table"))
flag = ToolbarInfo::TABLE;
+ else if (!compare_ascii_no_case(*cit, "mathmacrotemplate"))
+ flag = ToolbarInfo::MATHMACROTEMPLATE;
else if (!compare_ascii_no_case(*cit, "review"))
flag = ToolbarInfo::REVIEW;
else if (!compare_ascii_no_case(*cit, "top"))
flag = ToolbarInfo::LEFT;
else if (!compare_ascii_no_case(*cit, "right"))
flag = ToolbarInfo::RIGHT;
+ else if (!compare_ascii_no_case(*cit, "auto"))
+ flag = ToolbarInfo::AUTO;
else {
LYXERR(Debug::ANY,
"ToolbarBackend::readToolbarSettings: unrecognised token:`"
LEFT = 64, //< show at left
RIGHT = 128, //< show at right
REVIEW = 256, //< show when change tracking is enabled
- AUTO = 512 //< only if AUTO is set, when MATH, TABLE and REVIEW is used
+ AUTO = 512, //< only if AUTO is set, when MATH, TABLE and REVIEW is used
+ MATHMACROTEMPLATE = 1024 //< show in math macro
};
/// the toolbar items
typedef std::vector<ToolbarItem> Items;
} else if (allowauto
&& ((flags & ToolbarInfo::MATH)
|| (flags & ToolbarInfo::TABLE)
- || (flags & ToolbarInfo::REVIEW))) {
+ || (flags & ToolbarInfo::REVIEW)
+ || (flags & ToolbarInfo::MATHMACROTEMPLATE))) {
// for math etc, toggle from on -> auto
TurnOffFlag(ON);
TurnOnFlag(AUTO);
#undef TurnOffFlag
-void GuiToolbars::update(bool in_math, bool in_table, bool review)
+void GuiToolbars::update(bool in_math, bool in_table, bool review,
+ bool in_mathmacrotemplate)
{
updateIcons();
else if ((cit->flags & ToolbarInfo::AUTO) && (cit->flags & ToolbarInfo::TABLE))
displayToolbar(*cit, in_table);
else if ((cit->flags & ToolbarInfo::AUTO) && (cit->flags & ToolbarInfo::REVIEW))
- displayToolbar(*cit, review);
+ displayToolbar(*cit, review);
+ else if ((cit->flags & ToolbarInfo::AUTO) && (cit->flags & ToolbarInfo::MATHMACROTEMPLATE))
+ displayToolbar(*cit, in_mathmacrotemplate);
}
}
void toggleToolbarState(std::string const & name, bool allowauto);
/// Update the state of the toolbars.
- void update(bool in_math, bool in_table, bool review);
+ void update(bool in_math, bool in_table, bool review,
+ bool in_mathmacrotemplate);
/// Is the Toolbar currently visible?
bool visible(std::string const & name) const;
bool const review =
lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
-
- d.toolbars_->update(math, table, review);
+ bool const mathmacrotemplate =
+ lyx::getStatus(FuncRequest(LFUN_IN_MATHMACROTEMPLATE)).enabled();
+
+ d.toolbars_->update(math, table, review, mathmacrotemplate);
} else
- d.toolbars_->update(false, false, false);
+ d.toolbars_->update(false, false, false, false);
// update read-only status of open dialogs.
checkStatus();
// 315
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
+ LFUN_IN_MATHMACROTEMPLATE,
LFUN_LASTACTION // end of the table
};
flag.enabled(numargs_ == 0
&& type_ != MacroTypeDef);
break;
+
+ case LFUN_IN_MATHMACROTEMPLATE:
+ flag.enabled();
+ break;
default:
ret = false;