summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/include_lua/printtable.lua
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-04-05 00:38:35 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2024-04-18 13:11:51 -0400
commita6570b7d378b6236c40d2e2bd983f7d53ad479e3 (patch)
tree6e1562a78c07a1fe0e05b36cf10542aff5ca7482 /apps/plugins/lua/include_lua/printtable.lua
parent7f1b49693cd84b6e03e05d8a980fb99f26a781b1 (diff)
downloadrockbox-a6570b7d378b6236c40d2e2bd983f7d53ad479e3.tar.gz
rockbox-a6570b7d378b6236c40d2e2bd983f7d53ad479e3.zip
lua use lcd_drawline to draw lines inside rliimages
rewrite draw_text to use new viewport buffer set_viewport now accepts rliimage to allowe interfacing with rb. functions fix long standing 2-bit bug with text drawing in lua fix 2-bit img saving bug (i'm guessing just a one off, just enabled clipping) fix font_getstringsize bug fix shape of numbers draw_num.lua also add auto centering add page scrolling to printtable add a new demo script 'stars' Change-Id: I866905cee82ee89ebc0eb020a56a7ecdb101bf5e
Diffstat (limited to 'apps/plugins/lua/include_lua/printtable.lua')
-rw-r--r--apps/plugins/lua/include_lua/printtable.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/plugins/lua/include_lua/printtable.lua b/apps/plugins/lua/include_lua/printtable.lua
index c70fc1343f..02f3935ae6 100644
--- a/apps/plugins/lua/include_lua/printtable.lua
+++ b/apps/plugins/lua/include_lua/printtable.lua
@@ -145,13 +145,14 @@ function print_table(t, t_count, settings)
145 145
146 local wrap, justify, start, curpos, co_routine, hasheader, m_sel 146 local wrap, justify, start, curpos, co_routine, hasheader, m_sel
147 local header_fgc, header_bgc, item_fgc, item_bgc, item_selc 147 local header_fgc, header_bgc, item_fgc, item_bgc, item_selc
148 local table_linedesc, drawsep, overflow, dpad_fn 148 local table_linedesc, drawsep, overflow, dpad_fn, pagescroll
149 do 149 do
150 local s = settings or _print.get_settings() 150 local s = settings or _print.get_settings()
151 wrap, justify = s.wrap, s.justify 151 wrap, justify = s.wrap, s.justify
152 start, curpos = s.start, s.curpos 152 start, curpos = s.start, s.curpos
153 co_routine = s.co_routine 153 co_routine = s.co_routine
154 hasheader = s.hasheader 154 hasheader = s.hasheader
155 pagescroll = s.pagescroll
155 drawsep = s.drawsep 156 drawsep = s.drawsep
156 sb_width = s.sb_width or sb_width 157 sb_width = s.sb_width or sb_width
157 m_sel = false 158 m_sel = false
@@ -234,8 +235,13 @@ function print_table(t, t_count, settings)
234 dpad_fn(t_p.col, -1, -t_p.col_scrl, t_p.row, -1, -t_p.row_scrl, 235 dpad_fn(t_p.col, -1, -t_p.col_scrl, t_p.row, -1, -t_p.row_scrl,
235 nil, overflow, (t_p.row + t_p.vcursor - 1)) 236 nil, overflow, (t_p.row + t_p.vcursor - 1))
236 237
238
239 if pagescroll == true then
240 t_p.row = t_p.row + y_chg * maxline - 1
241 end
237 t_p.vcursor = t_p.vcursor + y_chg 242 t_p.vcursor = t_p.vcursor + y_chg
238 243
244
239 if t_p.vcursor > maxline or t_p.vcursor < t_p.vcursor_min then 245 if t_p.vcursor > maxline or t_p.vcursor < t_p.vcursor_min then
240 t_p.row = yi 246 t_p.row = yi
241 end 247 end
@@ -268,6 +274,7 @@ function print_table(t, t_count, settings)
268 elseif y_chg ~= 0 then 274 elseif y_chg ~= 0 then
269 --t_p.col = 0 -- reset column to the beginning 275 --t_p.col = 0 -- reset column to the beginning
270 _print.clear() 276 _print.clear()
277
271 _print.opt.sel_line(t_p.vcursor) 278 _print.opt.sel_line(t_p.vcursor)
272 279
273 t_p.row_scrl = set_accel(timeb, t_p.row_scrl, t_p) 280 t_p.row_scrl = set_accel(timeb, t_p.row_scrl, t_p)