PtoolboxLib suggestions

A PocketC native palm library offering native forms and assorted utilities

Postby tthkbw on Wed Apr 10, 2002 1:42 pm


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.

Posts: 75
Joined: Wed Nov 07, 2001 4:04 pm
Location: USA

Postby jstadolnik on Wed Apr 10, 2002 2:13 pm

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
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 3 guests