how do i get the dimentions of the form?

Discuss PocketC for Palm OS (including Desktop Edition)

Postby exit_head on Thu Sep 15, 2005 3:36 am

here is the code im using right now:

checkscreenmode(){
if(penx()==240)drawmode=WIDE;
if(peny()==240)drawmode=TALL;
if(penx()==160 && penx()==160)drawmode=NORMAL;
}

i use it to detect the form orientation. but it never gets set to WIDE or TALL(hires+) and i cant figure out why. from looking at the "Resize.pc" example it seems that the width and height is returned with penx() and peny(), is this correct?

Thanks for your help
Nate Edwards
exit_head
 
Posts: 64
Joined: Tue May 04, 2004 3:50 am
Location: USA

Postby dewey on Tue Sep 20, 2005 2:32 pm

The wide and tall modes aren't actually 240 pixels - they are 240 pixels minus the spaces taken by the control bar. Check for penx() > 160 instead.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby exit_head on Tue Sep 20, 2005 10:16 pm

thanks dewey :) all running smoothly now
exit_head
 
Posts: 64
Joined: Tue May 04, 2004 3:50 am
Location: USA


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 3 guests

cron