]> git.lyx.org Git - features.git/commitdiff
* LFUNs for math macros and menu integration
authorStefan Schimanski <sts@lyx.org>
Thu, 1 Nov 2007 11:08:04 +0000 (11:08 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 1 Nov 2007 11:08:04 +0000 (11:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21327 a592a061-630c-0410-9148-cb99ea01b6c8

lib/bind/math.bind
lib/ui/stdmenus.inc
src/LyXAction.cpp
src/lfuns.h

index aa1a08fca2da4b92153f87382126a439084960f9..5fcf3524170b9bb0e38a236683dea1fb2c9172f2 100644 (file)
 \bind "C-Tab"          "cell-split"
 \bind "M-m space"      "math-space"
 
+# math-macros
+\bind "C-plus"         "math-macro-unfold"
+\bind "C-minus"        "math-macro-fold"
+
 # This should be handled properly by some "get the next key" method
 
 \bind "M-m g a"      "math-insert \alpha"
index a3eebddb07081f628ffd203ccb381011d6b62d6d..9dea68e7325279447a509c93eac23026b0171707 100644 (file)
@@ -186,6 +186,7 @@ Menuset
                Item "Toggle Numbering|N" "math-number"
                Item "Toggle Numbering of Line|u" "math-nonumber"
                Submenu "Change Limits Type|L" "edit_math_limits"
+               Submenu "Macro Definition" "edit_math_macro_definition"
                Separator
                Submenu "Change Formula Type|F" "edit_math_mutate"
                Separator
@@ -206,6 +207,21 @@ Menuset
                Item "Delete Line to Right" "tabular-feature delete-vline-right"
        End
 
+       Menu "edit_math_macro_definition"
+               Item "Append Parameter" "math-macro-add-param"
+               Item "Remove Last Parameter" "math-macro-remove-param"
+                Separator
+               Item "Make First Non-Optional into Optional Parameter" "math-macro-make-optional"
+               Item "Make Last Optional into Non-Optional Parameter" "math-macro-make-nonoptional"
+                Item "Insert Optional Parameter" "math-macro-add-optional-param"
+                Item "Remove Optional Parameter" "math-macro-remove-optional-param"
+               Separator
+               Item "Append Parameter Eating From The Right" "math-macro-append-greedy-param"
+                Item "Append Optional Parameter Eating From The Right" "math-macro-add-greedy-optional-param"
+               Item "Remove Last Parameter Spitting Out To The Right" "math-macro-remove-greedy-param"
+               Separator
+       End
+
        Menu "edit_math_limits"
                 Item "Default|t"  "math-limits empty"
                 Item "Display|D"  "math-limits limits"
@@ -267,6 +283,9 @@ Menuset
                Item "Open All Insets|O" "all-insets-toggle open"
                Item "Close All Insets|C" "all-insets-toggle close"
                Separator
+               Item "Unfold Math Macro" "math-macro-unfold"
+               Item "Fold Math Macro" "math-macro-fold"
+               Separator
                Item "View Source|S" "dialog-toggle view-source"
                Submenu "Update|U" "view_update"
                ViewFormats
@@ -368,6 +387,7 @@ Menuset
                Separator
                Item "Delimiters|r" "dialog-show mathdelimiter"
                Item "Matrix|x" "dialog-show mathmatrix"
+               Item "Macro|o" "math-macro newmacroname newcommand"
                Separator
                Item "Toggle Math Panels" "toolbar-toggle math_panels"
        End
index f3b6f797a5230022ad0ade7aaaf34f68cd06a3fc..9551e8abe1ef2e16cce49a9cc6136ba7285a5c58 100644 (file)
@@ -241,6 +241,17 @@ void LyXAction::init()
                { LFUN_MATH_NUMBER, "math-number", Noop, Math },
                { LFUN_MATH_EXTERN, "math-extern", Noop, Math },
                { LFUN_MATH_SIZE, "math-size", Noop, Math },
+               { LFUN_MATH_MACRO_UNFOLD, "math-macro-unfold", ReadOnly | SingleParUpdate, Math },
+               { LFUN_MATH_MACRO_FOLD, "math-macro-fold", ReadOnly | SingleParUpdate, Math },
+               { LFUN_MATH_MACRO_ADD_PARAM, "math-macro-add-param", Noop, Math },
+               { LFUN_MATH_MACRO_REMOVE_PARAM, "math-macro-remove-param", Noop, Math },
+               { LFUN_MATH_MACRO_APPEND_GREEDY_PARAM, "math-macro-append-greedy-param", Noop, Math },
+               { LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM, "math-macro-remove-greedy-param", Noop, Math },
+               { LFUN_MATH_MACRO_MAKE_OPTIONAL, "math-macro-make-optional", Noop, Math },
+               { LFUN_MATH_MACRO_MAKE_NONOPTIONAL, "math-macro-make-nonoptional", Noop, Math },
+               { 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_MENU_OPEN, "menu-open", NoBuffer, Buffer },
                { LFUN_MENU_SEPARATOR_INSERT, "menu-separator-insert", Noop, Edit },
                { LFUN_META_PREFIX, "meta-prefix", NoBuffer, System },
index 56e9b94f21ee79efe55bfa658616c22cf6e22e2b..2ca33d7338d0a67255bf0fad278bd0d92d9a6b84 100644 (file)
@@ -419,6 +419,19 @@ enum kb_action {
        // 305
        LFUN_WORD_RIGHT,                                 // dov, 20071028
        LFUN_WORD_RIGHT_SELECT,                  // dov, 20071028
+       LFUN_MATH_MACRO_FOLD,
+       LFUN_MATH_MACRO_UNFOLD,
+       LFUN_MATH_MACRO_ADD_PARAM,
+       // 310
+       LFUN_MATH_MACRO_REMOVE_PARAM,
+       LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
+       LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
+       LFUN_MATH_MACRO_MAKE_OPTIONAL,
+       LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
+       // 315
+       LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
+       LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
+       LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
 
        LFUN_LASTACTION                  // end of the table
 };