Bringing fields to front

Richard Gaskin ambassador at fourthworld.com
Sun Apr 27 00:51:57 EDT 2003


James Lewes wrote:

> on 4/26/03 7:45 PM, Richard Gaskin at ambassador at fourthworld.com wrote:
> 
>> James Lewes wrote:
>> 
>>> I have imported a project from Supercard, which consists of 6 substacks and
>>> lots of card. On some of the cards there are 7 fields. In supercard you
>>> could write a script to bring a specific text field to the front, how can
>>> one do this in Runtimwe Revolution
>> 
>> How would you write that in SC, and does the same script work for you in
>> Rev?
> 
> 
> The script in Supercard read
> 
> 
> on mouseUp
> select card field "page 7"
> bringFront
> set the textFont of card field "page 7" to "Courier"
> set the textHeight of card field "page 7" to auto
> set the textSize of card field "page 7" to 12
> set the height of card field "page 7" to 355
> set the width of card field "page 7" to 620
> set the loc of card field "page 7" to 310,192
> set the style of card field "page 7" to rectangle
> set the lockText of card field "page 7" to true
> bringFront
> choose browse tool
> end mouseUp 

Why does it bring the same field forward twice?
Also, why does it reset the text attributes each time this handler is
called?

Here's your Rev version:

on mouseUp
  set the textFont of field "page 7" to "Courier"
  set the textHeight of field "page 7" to auto
  set the textSize of field "page 7" to 12
  set the height of field "page 7" to 355
  set the width of field "page 7" to 620
  set the loc of field "page 7" to 310,192
  set the style of field "page 7" to rectangle
  set the lockText of field "page 7" to true
  set the layer of fld "page 7" to top
end mouseUp 

You may be able to trim it down further by removing any redundant text
attribute settings.  The rules governing the relationship between text
attribute settings to a field object and chunks of text within it are
slightly more complex in SC than Rev.  I think you'll find Rev a little more
straightforward about seing object-level settings expressed in displayed
text; unless those settings are periodicically changed elsewhere, you can
probably toss the first three lines of that handler.

Note that there's no need for tool mode chages: while SC's bringFront
command requires that an object must be selected with the pointer tool, Rev'
layer property can be set at ant time in any tool mode.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list