Hi,
just several off-the-top ideas to handle transferring styles:
copy the text of cd fld 1 to cd fld 2
or
copy cd fld 1 to cd fld 2
This would be shortest, but I don't know how to go about using "before".
copy into myVar -- copies binary representation of selected item (text
range, button etc.) into a variable
paste myVar -- pastes data obtained from "copy into"
The code above would be more flexible than just allowing to copy styled
text. It would allow multiple clipboards etc. Pasting of text "before" or
"after" would be done using the "select" command as the selection controls
where the object is pasted.
Problem would be how to allow access to such a style variable. We could
say the data in there is private and the user shouldn't fiddle with it. Or
we could keep it in some private format but allow accessing it as if it was
a nested associative array (MetaCard has these associative arrays), with a
hierarchy like:
myVar --- "1" --- "range": 1,13
"style": bold,italic
"size": 12
"text": Styles, Yeah!
myVar --- "2" --- "range": 14,28
"style": plain
"color": red
"size": 18
"text": Styles, Yeah!
(Quoted text above is an array index)
This would indicate that the first style run in the field encloses
characters 1 to 13, has styles bold and italic, is height 12 and consists
of the text "Styles, Yeah!", ...
This would require internal implicit data typing, though, and would mean
that associative arrays would need to be hacked to support this. Also,
there'd need to be conversion when a user creates such an array "by hand"
and then copies it to a field, e.g. by using "paste myVar".
BTW, this would also require that we allow multi-dimensional arrays, or
we'd have to hack by using a concatenated index like "1,range", "1,style"
instead of a real one. So, to access the text size in style run 2 I'd like
to have:
myVar[2]["size"]
as it will be faster with large style runs than
myVar["2,size"]
as individual sub-arrays would be smaller.
Cheers,
-- M. Uli Kusterer
------------------------------------------------------------
http://www.weblayout.com/witness
'The Witnesses of TeachText are everywhere...'
--- HELP SAVE HYPERCARD: ---
Details at: http://www.hyperactivesw.com/SaveHC.html
Sign: http://www.giguere.uqam.ca/petition/hcpetition.html