Hi

The tab order will follow the field’s layer from lowest to highest. (Or from 
highest to lowest if you hold down the SHIFT key while tabbing just like other 
apps.)

So as you said with your original fields they will tab in this order.

field “a" - Layer 9
field ”c" - Layer 12
field “b" - Layer 15

Craig you said...

> whereas changing the layer order explicitly does not (work)


How were you trying to change the layer?

I didn’t know that dragging in the project browser works to order the objects.  
I will have to check that out.


The two ways I have used are either with the property inspector  or by script.

Property Inspector
- click the ‘Position’ tab of the property inspector
- Change the number in the ‘Layer’ field either directly or by using the arrow 
keys.

In your case I would first select field ‘b’ and then bump up its layer to 10.

field “a" - Layer 9
field “b" - Layer 10
field ”c" - Layer 12

Then I would first select field c’ and then bump up its layer to 11. This is to 
prevent the focus going to object with layer 11 before going to object with 
later 12.  The user will think the tab key did not work and have to tab again.

field “a" - Layer 9
field “b" - Layer 10
field ”c" - Layer 11

That of course will reorder tabbing behaviour or overlapping of other objects 
between layer 9 and 15 which may or may not lead to unwanted results.

Sometimes it can get crazy trying to figure out the order that is correct.

Here is a script you can use to quickly show the fields’ layers as their values 
and put the fields names in their tooltips.

command showFieldsLayers

     repeat with tfieldNumber = 1 to the number of fields of this card

          put "Layer: " & the layer of field tfieldNumber into field 
tfieldNumber

          set the tooltip of field tfieldNumber to the name of field 
tfieldNumber

     end repeat

end showFieldsLayers



Set Layer by Script

The other way to set the layer of an object is to do it by script in the 
message box.

     set the layer of field "A" to 3


Have a good weekend all.


Martin Koob


> On Jul 28, 2023, at 11:17 AM, Craig Newman via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> Why does, as Paul suggests, changing the layer order in the Project Browser 
> work, whereas changing the layer order explicitly does not? We know that 
> layers cannot be assigned to a particular object class (like fields) but 
> include all controls at once. Is it possible that the layer order of the 
> fields only was not properly grokked?
> 
> Craig
> 
>> On Jul 28, 2023, at 10:19 AM, Mark Smith via use-livecode 
>> <use-livecode@lists.runrev.com> wrote:
>> 
>> Thanks Paul. That is one of those super helpful tips that is hard to 
>> discover on your own. 1 day we need an easily searchable wiki for all this 
>> acquired wisdom (but for now I have tucked it away for future reference). 
>> Thanks for replying.
>> 
>> Mark
>> 
>> 
>>> On 28 Jul 2023, at 3:00 pm, Paul Dupuis via use-livecode 
>>> <use-livecode@lists.runrev.com> wrote:
>>> 
>>> You can change the layer (order) in the Project Browser in the IDE by just 
>>> dragging the objects up or down the list of objects on the card.
>>> 
>>> 
>>> On 7/28/2023 6:19 AM, Mark Smith via use-livecode wrote:
>>>> How do you reorder fields? I have a form (prebuilt) with 3 fields (a,b,c) 
>>>> in positions 9, 15, 12 (as indicated by the Layer field in the Position 
>>>> tab). Tabbing cause these fields to be visited in the order a, c, b 
>>>> whereas I would prefer a, b, c. I have tried all manner of editing the 
>>>> Layer field to make them be in that order with no success, I’ve variously 
>>>> tried new orders: 9,10,11 or 14,15,16 or even 20,21,22 but nothing seems 
>>>> to affect their order. It always returns to 9, 15, 12. Lock size and 
>>>> position is not checked. I’ve even tried doing this with the Number field 
>>>> in the Advanced tab, also without success. Ok, I did find a solution but 
>>>> while it was easy for me, it might not be as easy on a more complicated 
>>>> form. I deleted all 3 fields. Recreated field A (which was given the 
>>>> starting position of 11) then copy pasted two more times creating fields 
>>>> 12 and 13. So this satisfies my reorder interest, but seems to me a rather 
>>>> cumbersome and unnecessary procedure (if for no other reason than deleting 
>>>> fields also deletes all of the “custom” settings on the fields which 
>>>> doubles or triples the amount of effort involved). Maybe I am missing 
>>>> something more obvious?
>>>> 
>>>> Thanks
>>>> 
>>>> 
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode@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@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to