On Fri, 2003-09-12 at 21:40, Kerry Twibell wrote:
> I am drawing combination of text, tables and bitmaps
> to the screen. I need to scroll over all of them so
> that they move at the same time. (think Avant-Go
> interface) I am using a gadget to draw the text.
> Therefore I have to attach the gadget and handle all
> events. 
> 
> Based on the last parameter of SclSetScrollBar, I
> tried to delineate the text that I was drawing to the
> screen and update the scroll bar based on these
> determined "line numbers" - mimicking the API examples
> that deal with fields. 
> 
> I am running into strange issues, where the code
> sometimes draws text that hangs over the boundary of
> the gadget. 

A thought that springs to mind...you could try setting the clipping
window to the region of the gadget (using WinSetClip).  That way the
text wouldn't hang outside the widget (though perhaps the last line may
not be fully drawn).

> Question is this - can I set the scroll bar based on
> pixels instead of line numbers? If so, how do I do
> this? 
> Pixels would be a standard known quantity, where as
> line numbers can vary (line height is based on font
> height and I sometimes use standard, bold and italic
> font interchangeably)

Since you're handling all redrawing of the gadget, it's up to you what
to make of the numbers you're handed.

When the user clicks in the trough indicating a page down, you'll get a
sclRepeatEvent with a difference in size equal to that last parameter
(negative for up, positive for down).

It'd be up to your handling function to then deal with the redrawing of
both the gadget and the scrollbar.

If the last parameter is in pixels...the other two parameters should
also be in pixels.

> In addition, could anyone point me to gadget/scroll
> bar examples or references? 

In the O'Reilly book "Palm Programming: The Developer's Guide", Chapter
5, there's a discussion about form objects, and the scrollbar is
discussed here.

Other than that, you should have gotten the source for the built-in
applications along with the SDK's when you download them, and most of
the built-in applications use scrollbars in one way or another.

-Ken


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to