mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
CLuaInstCCText::CCTextScroll: Add Parameter 'pages'
- By pages parameter the number of pages can be specified
to be scrolled
- Set Lua api version to 1.30
Example:
ct = ctext.new{...}
...
ct:scroll{dir="down", pages=2};
Origin commit data
------------------
Branch: ni/coolstream
Commit: e3fdcaec99
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2015-12-14 (Mon, 14 Dec 2015)
Origin message was:
------------------
CLuaInstCCText::CCTextScroll: Add Parameter 'pages'
- By pages parameter the number of pages can be specified
to be scrolled
- Set Lua api version to 1.30
Example:
ct = ctext.new{...}
...
ct:scroll{dir="down", pages=2};
------------------
This commit was generated by Migit
This commit is contained in:
@@ -215,15 +215,19 @@ int CLuaInstCCText::CCTextScroll(lua_State *L)
|
||||
std::string tmp = "true";
|
||||
tableLookup(L, "dir", tmp);
|
||||
bool scrollDown = (tmp == "down" || tmp == "1");
|
||||
lua_Integer pages = 1;
|
||||
tableLookup(L, "pages", pages);
|
||||
|
||||
//get the textbox instance from lua object and use CTexBbox scroll methods
|
||||
CTextBox* ctb = m->ct->getCTextBoxObject();
|
||||
if (ctb) {
|
||||
if (pages == -1)
|
||||
pages = ctb->getPages();
|
||||
ctb->enableBackgroundPaint(true);
|
||||
if (scrollDown)
|
||||
ctb->scrollPageDown(1);
|
||||
ctb->scrollPageDown(pages);
|
||||
else
|
||||
ctb->scrollPageUp(1);
|
||||
ctb->scrollPageUp(pages);
|
||||
ctb->enableBackgroundPaint(false);
|
||||
}
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user