Hey Joseph,
2010/6/28 Joseph VanAndel <[email protected]>:
> Is is possible for a program to set the state of Wt scroll bars?
>
> 1) I have a log window, built from a WTextArea. When I add messages to the
> bottom, I'd like to insure the text at the bottom of the window is visible.
> I don't see any methods to force the scroll "thumb" to the bottom, so the
> users sees the last log mesage.
There is indeed no such API, but you can use the same trick as I use
in the simplechat example to scroll the messages to the bottom when a
new message arrives:
/*
* Little javascript trick to make sure we scroll along with new content
*/
WApplication::instance()->doJavaScript(messages_->jsRef() + ".scrollTop += "
+ messages_->jsRef() + ".scrollHeight;");
> 2) I have a WSelectionBox that shows a set of names, corresponding to what
> scan a radar antenna is performing. There may be more scans than would fit
> in the vertical space, so I need a scrollbar. How do make sure the current
> state is always visible?
This will require some research -- it seems that if you are
manipulating the selection after it has been rendered then the browser
will (usually ?) scroll the selected option into view. I guess the
main problem is then when the list is rendered entirely as HTML with
the initial selection.
Regards,
koen
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest