Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Waiting for Zax, cleaned up an issue with horizontal scrolling with one or more long lines of unwrapped text. Still not perfect as regards the vertical scrollbar.
dunbarx wrote: Mon Apr 15, 2024 9:45 pm
Waiting for Zax, cleaned up an issue with horizontal scrolling with one or more long lines of unwrapped text. Still not perfect as regards the vertical scrollbar.
on ScrollbarDrag
lock screen
put the uStartLine of field "overlay" into tStartLinle
put the uEndLine of field "overlay" into tEndLine
put the rect of field "fText" into tTextFieldRect
if the hScrollBar of field "fText" then
subtract the scrollbarWidth of field "fText" from item 4 of tTextFieldRect
end if
## add this <--------------------------------------
if the vScrollbar of field "fText" then
subtract the scrollbarWidth of field "fText" from item 3 of tTextFieldRect
end if
-------------- end add this
-- more code
-- more code
Wow, very impressive!
I didn't know about the formattedRect and your use of it opens up great perspectives for me. Also, the blendDarken ink is smart.
In absolute terms, we could dream of a future version of LC which would manage a few more HTML tags, like "<br>" for example.
In any case, thank you very much Craig and Bernd.
It’s a personal standalone that is currently being developed.
The method which adds an overlay field is much simpler to use than the one which adds/removes ASCII 11 characters but it can be more complex if I need several highlights in a large scrolling field.
At this stage of production, I haven't decided yet.
richmond62 wrote: Tue Apr 16, 2024 5:51 pm
Why do quite a few things that might have been expected to be fundamental to LiveCode come down to awkward kludges or work-arounds?
In this case they gave us ascii 11 back in LC 5. For myself, I prefer the text method because it requires no scrolling scripts, no additional controls, etc. Whatever method is used to calculate the text block in the overlay method can also be used to replace returns. Or you should be able to note the selection position in enterField and again in closeField to define the area.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com