From 078f2633158a10d904820789f58f2af43fa20041 Mon Sep 17 00:00:00 2001 From: Jacek Olszak Date: Sun, 24 Nov 2024 09:28:45 +0100 Subject: [PATCH] [refactor] Add message to text_output click callback Message from Picotron containing info about mouse position (mx and my fields). It will be needed later to write custom callbacks reacting in a different way based on the mouse position. For example, tree will use it to check whether user clicked the "node collapse" button. --- gui/gui.lua | 2 +- gui/text_output.lua | 2 +- gui/tree.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/gui.lua b/gui/gui.lua index 11768d3..fc5f722 100644 --- a/gui/gui.lua +++ b/gui/gui.lua @@ -81,7 +81,7 @@ local function start_test(item) local text = printed_lines:line(selected_test_id, line_no) return find_lua_file_in_text(text) != nil end, - link_click = function(line_no) + link_click = function(line_no, msg) local text = printed_lines:line(selected_test_id, line_no) local file = find_lua_file_in_text(text) diff --git a/gui/text_output.lua b/gui/text_output.lua index e25894a..2722156 100644 --- a/gui/text_output.lua +++ b/gui/text_output.lua @@ -36,7 +36,7 @@ function attach_text_output(parent, el) function text_output:click(msg) local line = line_at_mouse_position(msg) if is_link(line) and el.link_click != nil then - el.link_click(line) + el.link_click(line, msg) end end diff --git a/gui/tree.lua b/gui/tree.lua index ba8a233..4b7628f 100644 --- a/gui/tree.lua +++ b/gui/tree.lua @@ -43,7 +43,7 @@ function attach_tree(parent_el, el) is_link = function(line_no) return true end, - link_click = function(line_no) + link_click = function(line_no, msg) selected_line = line_no el.select(provider:get_node(line_no).id) end,