Brian Dunning's FileMaker Custom Functions

isFrontMostTabPanel ( _objectName )

Returns 1 if _objectName is or contains the frontmost tab panel, else 0

  Average rating: 4.4 (33 votes) Log in to vote

Fabrice Nordmann   Fabrice Nordmann - Show more from this author
1-more-thing
https://www.1-more-thing.com

Share on Facebook Share on Twitter

  Sample input:
isFrontMostTabPanel ( "myTab" )
  Sample output:
1

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Thanks to Agnès Barouh's CustomList, it is now possible to know if a tab is at frontmost without a recursive funciton.
The above code is long because it integrates CustomList in order to make this function available to FM Pro.
With Custom List installed as a custom function, this code would suffice :
----------------------
Let ([ $x = _objectName

// ENCLOSING OBJECTS
; $EON = $x & ¶ &
CustomList ( 1 ; ValueCount ( LayoutObjectNames ( Get ( FileName ) ; Get ( LayoutName ))) ; "case ( not isempty ( $x ) ; getlayoutobjectattribute ( $x ; \"enclosingobject\" ) & let([ $x = getlayoutobjectattribute ( $x ; \"enclosingobject\" )];\"\"))" )


//FRONT TAB PANELS
; $IFTP =
CustomList ( 1 ; ValueCount ( $EON ) ; "let([ $o = getvalue ( $EON ; [n] )]; getlayoutobjectattribute ( $o ; \"isFrontTabPanel\" ))")

];
PatternCount ( $IFTP ; 1 ) = ValueCount ( $IFTP )
)
---------------------

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: