|
|
@@ -32,7 +32,7 @@ package body ui is |
|
|
|
text_left, text_middle, text_right, |
|
|
|
text_lower_left, text_lower, text_lower_right, |
|
|
|
-- |
|
|
|
cursor, icon, overicon, |
|
|
|
cursor, icon, overicon, icon_selected, |
|
|
|
-- |
|
|
|
fill_bar_left, fill_bar_horizontal, fill_bar_right, fill_horizontal, |
|
|
|
-- |
|
|
@@ -54,10 +54,22 @@ package body ui is |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure select_text_box (text : in string; x, y, width, height : in integer) is |
|
|
|
function cursor_inside (x, y, width, height : in integer) return boolean is |
|
|
|
begin |
|
|
|
--~return (core.cursor.x > x and core.cursor.x < x + width and core.cursor.y > y and core.cursor.y < y + height); |
|
|
|
if core.cursor.x > x and core.cursor.x < x + width |
|
|
|
and core.cursor.y > y and core.cursor.y < y + height then |
|
|
|
return true; |
|
|
|
else |
|
|
|
return false; |
|
|
|
end if; |
|
|
|
end cursor_inside; |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
procedure select_text_box (text : in string; x, y, width, height : in integer) is |
|
|
|
begin |
|
|
|
if cursor_inside (x, y, width, height) then |
|
|
|
core.write_text_box (text); |
|
|
|
end if; |
|
|
|
end select_text_box; |
|
|
@@ -228,11 +240,12 @@ package body ui is |
|
|
|
core.draw (data, x, y); |
|
|
|
core.zoom := save_zoom; |
|
|
|
-- |
|
|
|
if core.cursor.x > x and core.cursor.x < x + core.icon |
|
|
|
and core.cursor.y > y and core.cursor.y < y + core.icon |
|
|
|
and core.cursor_mode = 1 then |
|
|
|
action.all; |
|
|
|
core.cursor_mode := 0; |
|
|
|
if cursor_inside (x, y, core.icon, core.icon) then |
|
|
|
draw (icon_selected, x, y); |
|
|
|
if core.cursor_mode = 1 then |
|
|
|
action.all; |
|
|
|
core.cursor_mode := 0; |
|
|
|
end if; |
|
|
|
end if; |
|
|
|
end draw_icon; |
|
|
|
|
|
|
|