Formatted text in a field.

Michael Doub mikedoub at gmail.com
Thu Apr 3 08:37:04 EDT 2014


Thank you!   Using the pageranges is pretty clever.

So clearly the engine knows how to do these calculations, so I have to believe that  all of the properties must be available to us to do the same calculation.  The one that I think I am not understanding correctly is the property for the number of pixels in the visible part of the field.   I thought that would have been the  height of a field - boarder - margin.

Thanks again,
    Mike


On Apr 3, 2014, at 2:06 AM, jameshale <james at thehales.id.au> wrote:

> Yes Peter is right.
> If all you are looking to do is display the two pages then this might be the
> go.
> 
> If you place a field "f1" on a page and set it up the way you want (size,
> text characteristics etc) and then make two copies, field fa" and field
> "fb".
> Then make "f1" invisible.
> 
> make a button to load the pages like:
> 
> --intialize script--
> 
> global pn
> global pr
> on mouseUp
>   set the htmltext of field "f1" to YOUR_STYLED_TEXT_VARIABLE
>   put 1 into pn
>   put the pageranges of field "f1" into pr
>   put line pn of pr into pr1
>   put line pn+1 of pr into pr2
>   set the htmltext of  field "fa" to the htmltext of char (item 1 of pr1)
> to (item 2 of pr1) of  field "f1"
>   set the htmltext of  field "fb" to the htmltext of char (item 1 of pr2)
> to (item 2 of pr2) of  field "f1"
>   add 2 to pn
> end mouseUp
> 
> ---end initialise---
> 
> Then a next page button script is simply...
> 
> ---next page---
> global pn
> global pr
> on mouseUp
>   put the pageranges of field "f1" into pr
>   put line pn of pr into pr1
>   put line pn+1 of pr into pr2
>   set the htmltext of  field "fa" to the htmltext of char (item 1 of pr1)
> to (item 2 of pr1) of  field "f1"
>   set the htmltext of  field "fb" to the htmltext of char (item 1 of pr2)
> to (item 2 of pr2) of  field "f1"
>   add 2 to pn
> end mouseUp
> ---end next page---
> 
> Works a charm.
> 
> It just depends on what your intention is.
> If this is only for display or printing (the inspiration for the property)
> then this is the neatest way to go.
> But if you want greater user interaction, then maybe not.
> 
> In my application of this idea I am using the first method I mentioned
> (group scroll). I want my users to be able to select text over more than one
> page and to view what may be just overleaf (say at the end of page 2 and the
> beginning of page 3) without having to jump back and forth. 
> 
> James
> 
> 
> 
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/Formatted-text-in-a-field-tp4677903p4677917.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list