Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Getting selection positions from area

From: anton::wilddsl::net::au at: 2-Oct-2007 18:27

Hi Greg, It's necessary to make some custom AREA styles which will interact with each other. The Map AREA is needed for positioning the Text AREA. Edits of the text in the Text area require the Map area to be updated. It's necessary to modify/replace the FEEL/ENGAGE function in each new area style. The default feel is: print mold svv/vid-styles/area/feel Check out CTX-TEXT: print mold first ctx-text Then check out EDIT-TEXT, referred to in the area feel: print mold get in ctx-text 'edit-text Here's a possibly helpful first experiment: full-text: "I spoke^/she spoke^/we spoke together." derive-map: func [full-text /local map-text][ map-text: copy "" parse/all full-text [some [thru newline (append map-text "-")]] return map-text ] view layout [ across map-area: area 100 (derive-map full-text) font-name (font-fixed) feel [ engage: func [face action event][ ; call the default engage svv/vid-styles/area/feel/engage face action event print "update the text-area here" ; <-- ] ] text-area: area (full-text) feel [ engage: func [face action event][ ; call the default engage svv/vid-styles/area/feel/engage face action event print "update map-area here" ; <-- if necessary, eg. ; the key changed number of newlines or moved vertical scroll position ] ] ] Regards, Anton.