test and App helper for mouse clicks
[?]
May 25, 2022, 8:38 PM
6E3HVYWFP3JLJ3DJ5BH4WGJUXQV5MDCBCE5GH3SXRHRQZOG4VJLQCDependencies
- [2]
AD34IX2Zcouple more tests - [3]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [4]
DLQMM265scroll past first page - [5]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [6]
DXT4QTAHa few more integer coordinates - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
YTSPVDZHfirst successful pagedown test, first bug found by test - [*]
3QNOKBFMbeginnings of a test harness - [*]
AVTNUQYRbasic test-enabled framework
Change contents
- edit in text.lua at line 143
function test_move_cursor_using_mouse()io.write('\ntest_move_cursor_using_mouse')App.screen.init{width=50, height=60}Lines = load_array{'abc', 'def', 'xyz'}Line_width = App.screen.widthCursor1 = {line=1, pos=1}Screen_top1 = {line=1, pos=1}Screen_bottom1 = {}Zoom = 1App.draw() -- populate line.y for each line in Lineslocal screen_top_margin = 15 -- pixelslocal screen_left_margin = 25 -- pixelsApp.run_after_mousepress(screen_left_margin+8,screen_top_margin+5, '1')check_eq(Cursor1.line, 1, 'F - test_move_cursor_using_mouse/cursor:line')check_eq(Cursor1.pos, 2, 'F - test_move_cursor_using_mouse/cursor:pos')end - replacement in text.lua at line 1000
if x < 16 then return false endif x < 25 then return false end - edit in app.lua at line 185[9.3047][11.7039]
App.screen.contents = {}App.draw()endfunction App.run_after_mousepress(x,y, button)App.mousepressed(x,y, button)