Page 1 of 1

PostPosted: Wed Apr 10, 2002 1:42 pm
by tthkbw

How about a function like this:

text(x,y,width,"this text");

where x and y are the location of the text as in the PocketC text call, width is the maximum width in pixels for the text, and the function truncates the string to however many characters fit in width.

I find myself doing this all the time and have a function to do it, but it is really slow in PocketC. Seems like a native lib function would be very helpful. I don't want partial characters drawn, just as many characters as possible in the width stated.

I seem to need to manipulate the text in buttons and fields all the time, but the overflow and/or partial characters are bad.

What do you think??

Second issue:

Is there any way to get around the PalmOS thing where the alert call takes over the event subsystem and results in my applications losing control of the hardkey buttons? It would be cool to have an alternative alert call which avoided this. If I pop an alert, suddenly the app buttons (MemoPad, etc) can cause an exit in my application, but I don't want them to. I know I can just pop forms and labels, but alerts seem to be the standard thing for PalmOS.


PostPosted: Wed Apr 10, 2002 2:13 pm
by jstadolnik
1) See the textbox() function.

2) Use NoKeyEvents() before (and after... to reenable) popping an alert. This should prevent the PalmOS event handler from trapping hardkey buttons. Though I have not tested this.


The PToolboxLib guy.

Edited by - jstadolnik on 04/10/2002 12:27:23