field losing formatting on copying

Paul Hibbert paulhibbert at mac.com
Fri Jun 6 02:58:19 CEST 2014


Just tried another test. I renamed the appropriate fields to begin with "Case" and tried this script in the "Do it" button…

on mouseUp
   if exists(grp "J_1" of this cd) then
      delete grp "J_1" of this cd
   end if
   copy grp "J_1" of cd 1 of stack "rawForms" to this cd
   set the topleft of it to 1,1
   
   setTextHeight
end mouseUp

command setTextHeight
   repeat with i = 1 to the number of fields on card "r_controls"
      if the short name of field i begins with "Case" then \
         set the textHeight of fld i to 12
   end repeat
end setTextHeight

…And it seems to work OK just resetting the textHeight.

I know this doesn't answer why the problem occurs, but it does workaround it. I tried setting the textHeight & textSize of the stack "mcp", card "r_controls", the templateField and the templateGroup, all had no effect on the copied group.

I don't have LC5.5.4 installed, but I used LC5.5.5 (on Mac OS X 10.8.5), I expect it would be the same.

Paul


On 2014-06-05, at 2:45 PM, Peter Haworth <pete at lcsql.com> wrote:

> Good catch. The textsize also changes from 9 to 11 (actually the effective
> textsize).
> 
> I think I see why this is happening and Dar touched on it in an earlier
> post.  The label field and its owning groups have a blank textsize in the
> rawforms stack but the rawforms stack has its textsize set to 9.  The mcp
> stack on the other hand has an empty textsize so it defaults to 11which
> also causes the textheight to change.
> 
> Set the text size of the mcp stack to 9 and all should work fine.
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
> 
> 
> On Thu, Jun 5, 2014 at 12:52 PM, Paul Hibbert <paulhibbert at mac.com> wrote:
> 
>> It's not the margins that are changing on the copy, but the 'textHeight'
>> property is, it changes from 12 to 14.
>> 
>> Not sure why it should do that though.
>> 
>> Paul
>> 
>> On 2014-06-05, at 11:39 AM, Dr. Hawkins <dochawk at gmail.com> wrote:
>> 
>>> On Thu, Jun 5, 2014 at 10:36 AM, Peter Haworth <pete at lcsql.com> wrote:
>>> 
>>>> OK, misunderstood.  However, the label field also shows up with margins
>> of
>>>> 0,2,0,0 on my end.
>>>> 
>>> 
>>> So it does . . . but look at it--the text in the original fits in the
>>> field, while the text in the copy doesn't.
>>> 
>>> There is *something* different about these two fields . . .  and not
>>> everything does this on copy, but the fields that do are consistent about
>>> it.
>>> 
>>> 
>>> --
>>> Dr. Richard E. Hawkins, Esq.
>>> (702) 508-8462
>>> _______________________________________________
>>> 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
>> 
>> 
>> _______________________________________________
>> 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
>> 
> _______________________________________________
> 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