\bind "C-F4" "buffer-close"
\bind "M-F4" "lyx-quit"
\bind "F5" "screen-recenter"
+\bind "C-M-Up" "scroll line up"
+\bind "C-M-Down" "scroll line down"
+\bind "C-M-Prior" "scroll page up"
+\bind "C-M-Next" "scroll page down"
\bind "C-F6" "buffer-next"
\bind "C-S-F6" "buffer-previous"
\bind "F7" "dialog-show spellchecker"
case LFUN_SCREEN_UP:
case LFUN_SCREEN_DOWN:
+ case LFUN_SCROLL:
flag.enabled(true);
break;
break;
}
+ case LFUN_SCROLL:
+ lfunScroll(cmd);
+ break;
+
case LFUN_SCREEN_UP_SELECT:
case LFUN_SCREEN_DOWN_SELECT: {
// Those two are not ready yet for consumption.
}
+void BufferView::lfunScroll(FuncRequest const & cmd)
+{
+ string const scroll_type = cmd.getArg(0);
+ int const scroll_step =
+ (scroll_type == "line")? d->scrollbarParameters_.lineScrollHeight
+ : (scroll_type == "page")? height_ : 0;
+ if (scroll_step == 0)
+ return;
+ string const scroll_quantity = cmd.getArg(1);
+ if (scroll_quantity == "up")
+ scrollUp(scroll_step);
+ else if (scroll_quantity == "down")
+ scrollDown(scroll_step);
+ else {
+ int const scroll_value = convert<int>(scroll_quantity);
+ if (scroll_value)
+ scroll(scroll_step * scroll_value);
+ }
+}
+
+
void BufferView::scroll(int y)
{
if (y > 0)
/// This method will automatically scroll and update the BufferView and updated
/// if needed.
void showCursor();
+ /// LFUN_SCROLL Helper.
+ void lfunScroll(FuncRequest const & cmd);
/// scroll down document by the given number of pixels.
void scrollDown(int pixels);
/// scroll up document by the given number of pixels.
{ LFUN_SCREEN_DOWN, "screen-down", ReadOnly, Edit },
{ LFUN_SCREEN_DOWN_SELECT, "screen-down-select", ReadOnly, Edit },
{ LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer, Layout },
+ { LFUN_SCROLL, "scroll", ReadOnly, Edit },
{ LFUN_SCREEN_RECENTER, "screen-recenter", ReadOnly, Edit },
{ LFUN_SCREEN_UP, "screen-up", ReadOnly, Edit },
{ LFUN_SCREEN_UP_SELECT, "screen-up-select", ReadOnly, Edit },
// 315
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
LFUN_IN_MATHMACROTEMPLATE,
+/** LFUN_SCROLL
+ * \li Action: scroll the buffer view.
+ * \li Notion: Only about scrolling up or down; do not modify the cursor.
+ * \li Syntax: scroll [TYPE] [QUANTITY]
+ * \li Params: TYPE: line|page\n
+ QUANTITY: up|down|<number>\n
+ * \li Origin: Abdelrazak Younes, Dec 27 2007
+*/
+ LFUN_SCROLL,
LFUN_LASTACTION // end of the table
};