summaryrefslogtreecommitdiff
path: root/apps/plugins/lua_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua_scripts')
-rw-r--r--apps/plugins/lua_scripts/file_browser.lua2
-rwxr-xr-xapps/plugins/lua_scripts/fileview.lua2
-rwxr-xr-xapps/plugins/lua_scripts/fileviewers.lua3
-rwxr-xr-xapps/plugins/lua_scripts/printmenu.lua83
-rwxr-xr-xapps/plugins/lua_scripts/rlimg.lua2
-rw-r--r--apps/plugins/lua_scripts/tagnav.lua2
6 files changed, 7 insertions, 87 deletions
diff --git a/apps/plugins/lua_scripts/file_browser.lua b/apps/plugins/lua_scripts/file_browser.lua
index 19f475acf3..ab246a2a7e 100644
--- a/apps/plugins/lua_scripts/file_browser.lua
+++ b/apps/plugins/lua_scripts/file_browser.lua
@@ -33,7 +33,7 @@ local scrpath = rb.current_path()--rb.PLUGIN_DIR .. "/demos/lua_scripts/"
33 33
34package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path 34package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path
35 35
36require("printmenu") --menu 36require("printmenus") --menu
37require("filebrowse") -- file browser 37require("filebrowse") -- file browser
38 38
39rb.actions = nil 39rb.actions = nil
diff --git a/apps/plugins/lua_scripts/fileview.lua b/apps/plugins/lua_scripts/fileview.lua
index 920281bbef..08eea0337c 100755
--- a/apps/plugins/lua_scripts/fileview.lua
+++ b/apps/plugins/lua_scripts/fileview.lua
@@ -33,7 +33,7 @@ local scrpath = rb.current_path()--rb.PLUGIN_DIR .. "/demos/lua_scripts/"
33 33
34package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path 34package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path
35 35
36require("printmenu") --menu 36require("printmenus") --menu
37require("filebrowse") -- file browser 37require("filebrowse") -- file browser
38require("fileviewers") -- fileviewer, hexviewer 38require("fileviewers") -- fileviewer, hexviewer
39 39
diff --git a/apps/plugins/lua_scripts/fileviewers.lua b/apps/plugins/lua_scripts/fileviewers.lua
index 5a9c417d36..c686f3eeda 100755
--- a/apps/plugins/lua_scripts/fileviewers.lua
+++ b/apps/plugins/lua_scripts/fileviewers.lua
@@ -205,6 +205,7 @@ function print_file(filename, maxlinelen, settings)
205 end 205 end
206 settings.hasheader = true 206 settings.hasheader = true
207 settings.co_routine = nil 207 settings.co_routine = nil
208 settings.ovfl = "manual"
208 209
209 local sel = 210 local sel =
210 print_table(ftable, #ftable, settings) 211 print_table(ftable, #ftable, settings)
@@ -309,6 +310,7 @@ function print_file_increment(filename, settings)
309 settings.hasheader = true 310 settings.hasheader = true
310 settings.co_routine = co 311 settings.co_routine = co
311 settings.msel = false 312 settings.msel = false
313 settings.ovfl = "manual"
312 314
313 table.insert(file_t, 1, hstr) --position 1 is header/title 315 table.insert(file_t, 1, hstr) --position 1 is header/title
314 local sel = 316 local sel =
@@ -437,6 +439,7 @@ function print_file_hex(filename, bytesperline, settings)
437 settings.co_routine = co 439 settings.co_routine = co
438 settings.start = start 440 settings.start = start
439 settings.curpos = vcur 441 settings.curpos = vcur
442 settings.ovfl = "manual"
440 443
441 while sel > 0 do 444 while sel > 0 do
442 settings.start = start 445 settings.start = start
diff --git a/apps/plugins/lua_scripts/printmenu.lua b/apps/plugins/lua_scripts/printmenu.lua
deleted file mode 100755
index 3cb17d8026..0000000000
--- a/apps/plugins/lua_scripts/printmenu.lua
+++ /dev/null
@@ -1,83 +0,0 @@
1--[[
2/***************************************************************************
3 * __________ __ ___.
4 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * \/ \/ \/ \/ \/
9 * $Id$
10 *
11 * Copyright (C) 2017 William Wilgus
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22]]
23if not rb.lcd_framebuffer then rb.splash(rb.HZ, "No Support!") return nil end
24
25require("printtable")
26local _clr = require("color")
27
28local _LCD = rb.lcd_framebuffer()
29--------------------------------------------------------------------------------
30-- displays text in menu_t calls function in same indice of func_t when selected
31function print_menu(menu_t, func_t, selected, settings, copy_screen)
32
33 local i, start, vcur, screen_img
34
35 if selected then vcur = selected + 1 end
36 if vcur and vcur <= 1 then vcur = 2 end
37
38 if not settings then
39 settings = {}
40 settings.justify = "center"
41 settings.wrap = true
42 settings.hfgc = _clr.set( 0, 000, 000, 000)
43 settings.hbgc = _clr.set(-1, 255, 255, 255)
44 settings.ifgc = _clr.set(-1, 000, 255, 060)
45 settings.ibgc = _clr.set( 0, 000, 000, 000)
46 settings.iselc = _clr.set( 1, 000, 200, 100)
47 settings.default = true
48 end
49
50 settings.hasheader = true
51 settings.co_routine = nil
52 settings.msel = false
53 settings.start = start
54 settings.curpos = vcur
55
56 while not i or i > 0 do
57 if copy_screen == true then
58 --make a copy of screen for restoration
59 screen_img = screen_img or rb.new_image()
60 screen_img:copy(_LCD)
61 else
62 screen_img = nil
63 end
64
65 _LCD:clear(settings.ibgc)
66
67 settings.start = start
68 settings.curpos = vcur
69
70 i, start, vcur = print_table(menu_t, #menu_t, settings)
71 --vcur = vcur + 1
72 collectgarbage("collect")
73 if copy_screen == true then _LCD:copy(screen_img) end
74
75 if func_t and func_t[i] then
76 if func_t[i](i, menu_t) == true then break end
77 else
78 break
79 end
80 end
81 if settings.default == true then settings = nil end
82 return screen_img
83end
diff --git a/apps/plugins/lua_scripts/rlimg.lua b/apps/plugins/lua_scripts/rlimg.lua
index 801d0c5fac..c9dde65ed4 100755
--- a/apps/plugins/lua_scripts/rlimg.lua
+++ b/apps/plugins/lua_scripts/rlimg.lua
@@ -36,7 +36,7 @@ local _draw_text = require("draw_text")
36 36
37--package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path 37--package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path
38 38
39require("printmenu") --menu 39require("printmenus") --menu
40 40
41--[[ RBIMAGE library functions 41--[[ RBIMAGE library functions
42NOTE!! on x, y coordinates + width & height 42NOTE!! on x, y coordinates + width & height
diff --git a/apps/plugins/lua_scripts/tagnav.lua b/apps/plugins/lua_scripts/tagnav.lua
index f62f27973b..9646f359e3 100644
--- a/apps/plugins/lua_scripts/tagnav.lua
+++ b/apps/plugins/lua_scripts/tagnav.lua
@@ -25,7 +25,7 @@
25--local scrpath = rb.current_path()" 25--local scrpath = rb.current_path()"
26 26
27--package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path 27--package.path = scrpath .. "/?.lua;" .. package.path --add lua_scripts directory to path
28require("printmenu") 28require("printmenus")
29require("printtable") 29require("printtable")
30require("dbgettags") 30require("dbgettags")
31 31