Re: Touch periodic table on HP Prime - revisited Message #3 Posted by Mic on 23 Nov 2013, 11:47 a.m., in response to message #1 by Terje Vallestad
I am correcting the issue with left scrolling in the program.
If somebody finds a way to stop left scrolling when the user is at the beginning of the table and correct white screen got with BLIT_P command :
DrawTable()
begin
DIMGROB_P(G1,320,220); RECT(G1);
local x:=startX-offset,y:=startY,i,j;
local tablePos=1;
for j:=1 to 10 do
for i:=1 to 18 do
if tablePos:=position(j,i) then
RECT_P(G1,x,y,x+width,y+height,RGB(0,0,0),m1(m2(tablePos)));
if selEl== tablePos then
RECT_P(G1,x+1,y+1,x+width-1,y+height-1,RGB(0,0,0),RGB(0,0,0,255));
end;
TEXTOUT_P(tablePos,G1,x+2,y+1,1);
TEXTOUT_P(symbol(tablePos),G1,x+8,y+10,1);
end;
x:=x+width;
end;
x:=x-18*width;
y:=y+height;
end;
x:=2*width-offset+width/4+startX; y:=7*height+startY;
-----------------------------------------------------
if size(touch(1)) then //something in our mouse
case
if touch(1,5)==0 then //touch
local el:= FindEl(touch(1,1),touch(1,2));
if el then
selEl:=el;
DrawTable();
end;
end;
if touch(1,5)==1 then "incomplete" end;
if touch(1,5)==2 then //drag
offset:=touch(1,3)-touch(1,1);
DrawTable();
end;
if touch(1,5)==3 then return "stretch"; end;
if touch(1,5)==4 then return "rotate"; end;
if touch(1,5)==5 then return "long click"; end;
end;
end;
For now I've improved this :
* each element page is now static : press HOME button to go back to the table
You can download the new version here :
*** coming soon ***
Procedure to send the program to your calc :
Edited: 23 Nov 2013, 12:05 p.m.
|