Personally, after Zak's OP, I am not 'wedded', but I am 'in a relationship', as it does seem a good thing, if it is at all possible.Are you wedded to using the border-whatevers?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Personally, after Zak's OP, I am not 'wedded', but I am 'in a relationship', as it does seem a good thing, if it is at all possible.Are you wedded to using the border-whatevers?
Code: Select all
on mouseup
replace cr with numToNativeChar(11) in fld 1
set the borderwidth of paragraph 1 to 4 of fld 1 to 3 -- > ok
end mouseup
Code: Select all
on returnInField
put numToNativeChar(11) into the selection
end returnInField
I don't understand your proposal Craig. Could you explain?dunbarx wrote: ↑Fri Apr 12, 2024 2:57 pmI am thinking about using an overlay and modifying its properties to fit. Maybe a field with just the right backColor, borderColor, borderWidth and blendlevel? That way it is a single control not subject to the line and paragraph constraints you are seeing. You can easily size and locate it to fit.
Doesn't that mean that your border will go round all the text, not just the paragraphs you want?But we have to replace all CRs typed/pasted by users, and it add complexity.
Oops! Right, that would involve placing CRs in the desired locations, and that would definitely be too complex and not robust enough.richmond62 wrote: ↑Sat Apr 13, 2024 8:26 amDoesn't that mean that your border will go round all the text, not just the paragraphs you want?
Code: Select all
on mouseUp
set the borderColor of paragraph 2 of fld "f1" to red
set the borderColor of paragraph 2 of fld "f2" to red
set the borderwidth of paragraph 2 of fld "f1" to 4
set the borderwidth of paragraph 2 of fld "f2" to 4
end mouseUp
Code: Select all
on mouseUp
set the borderColor of paragraph 2 to 3 of fld "f1" to green
set the borderColor of paragraph 2 to 3 of fld "f2" to green
--
set the borderwidth of paragraph 2 to 3 of fld "f1" to 4
set the borderwidth of paragraph 2 to 3 of fld "f2" to 4
end mouseUp
Code: Select all
on mouseUp
put paragraph 2 to 3 of fld "f1" into PARAS1
delete paragraph 2 to 3 of fld "f1"
replace cr with numToNativeChar(11) in PARAS1
put cr & PARAS1 & cr after paragraph 1 of fld "f1"
set the borderwidth of paragraph 2 of fld "f1" to 4
set the bordercolor of paragraph 2 of fld "f1" to "purple"
end mouseUp
Code: Select all
on mouseUp
put the selectedText into SELEX
replace cr with numToNativeChar(11) in SELEX
delete the selectedText
put SELEX after the selectedText
set the borderwidth of the selectedText to 4
set the bordercolor of the selectedText to "red"
select after fld "f1"
end mouseUp
Code: Select all
on mouseUp
put the selectedText into savedText
replace cr with numToNativeChar(11) in savedText
put savedText into the selectedText
set the borderwidth of the selectedText to 4
set the bordercolor of the selectedText to "red"
end mouseUp
I only colorized the backGround because one or more of the previous posts showed that. You do not have to.However, if I want to be a perfectionist, placing a semi-transparent element on top of text decreases the contrast of the text and it is no longer black.
Code: Select all
on mouseUp
put word 2 of the selectedlines into tStartLine
put word 4 of the selectedLines into tEndLine
put the formattedRect of line tStartLine to tEndLine of field fText into tRect
set the rect of field "overlay" to tRect
## set a custom property of field "overlay" to reference it
## in script of field "fText" for scrolling
set the uStartLine of field "overlay" to tStartLine
set the uEndLine of field "overlay" to tEndLine
end mouseUp
Code: Select all
on mouseUp
put the selectedlines into tSelectedLines
put word 2 of tSelectedLines into tStartLine
if tSelectedLines contains "to" then put word 4 of tSelectedLines into tEndLine --"to" only appears with multi-line selections
else put word 2 of tSelectedLines into tEndLine --same line
....