From 454ffc0479af063802244a433cb748ed3be157a4 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sun, 9 Dec 2012 01:45:25 +0800 Subject: [PATCH] add change view mode feature for crereader Conflicts: crereader.lua defaults.lua --- cre.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cre.cpp b/cre.cpp index 8df2584e7..e3412fdd6 100644 --- a/cre.cpp +++ b/cre.cpp @@ -46,9 +46,9 @@ static int initCache(lua_State *L) { static int openDocument(lua_State *L) { const char *file_name = luaL_checkstring(L, 1); const char *style_sheet = luaL_checkstring(L, 2); - int width = luaL_checkint(L, 3); int height = luaL_checkint(L, 4); + LVDocViewMode view_mode = (LVDocViewMode)luaL_checkint(L, 5); lString8 css; CreDocument *doc = (CreDocument*) lua_newuserdata(L, sizeof(CreDocument)); @@ -63,7 +63,7 @@ static int openDocument(lua_State *L) { doc->text_view->setStyleSheet(css); } } - doc->text_view->setViewMode(DVM_SCROLL, -1); + doc->text_view->setViewMode(view_mode, -1); doc->text_view->Resize(width, height); doc->text_view->LoadDocument(file_name); doc->dom_doc = doc->text_view->getDocument();