Curl Global Community
scrolling: find, search, goto with GuiMark - Printable Version

+- Curl Global Community (
+-- Forum: Blogs (
+--- Forum: Tech blog (
+---- Forum: Robert blog (
+---- Thread: scrolling: find, search, goto with GuiMark (/showthread.php?tid=535)

scrolling: find, search, goto with GuiMark - RobertShiplett - 06-18-2012

The ScrollBox class combined with the Curl GuiMark facility makes possible such things as the following:

{scrollBox.scroll-to-object startGuiMark.graphic,vertical-only?=true}

You can see the result at yuki

as you see below:

[Image: yuki-sml.jpg]

As you see, we have found the first row with ぬ夜の雪 and scrolled it to the top of the viewport. The FIND button was able to do this because we can do this:

set (startGuiMark,stopGuiMark) = { {TextSearchPattern pattern=str}, gm=topGuiMark}

where the str value is that of our TextField.

NOTE added June 19: by adding one more 'fixed' GuiMark at the top of our container, we now have a generalized "rolling" search. The top mark is only fixed in the sense that we leave it invariant and use it to reassign our "roving" topGuiMark. A flag is used to determine the need to reset when find fails or ValueFinished fires in the search field. The challenge is that we are not searching in text, but rather in a graphical hierarchy in which some Visual objects contain text.