Function overview
Prototype
TopTabPanel_List (
)
Parameters
No parameters for this function.
Description
Tags:
Layout Objects Layout
TopTabPanel_List
by Eric Plassot
jan 09
Not more than Nearby 150 Objects
Not recursive
this list tab panels that are visible.
You can, for example, use this list to create a script to return to their original position (with Go to Object)
Examples
Sample input
TopTabPanel_List ( )
Sample output
santa
red nose reindeer
Gift...
Function code
/* TopTabPanel_List
by Eric Plassot
jan 09
Not more than Nearby 150 Objects
Not recursive
this list tab panels that are visible.
You can, for example, use this list to create a script to return to their original position (Go to Object)*/
Let(
[
$First = "|###|";
$rc = ¶;
$n = "";
$cfront = 0;
$level = 0;
$ListObj = LayoutObjectNames( Get( FileName ); Get( LayoutName ) );
$ListObj2 = $rc & $ListObj & $rc;
End = ValueCount( $ListObj );
Calc =
"let ([
$n = $n + 1;
Value = getValue ( $ListObj; $n );
$level = Case ( Value = \"<\";$level+1;Value = \">\";$level-1;$level);
$numobj= Case( value ≠ \"<\" and value ≠ \">\";$numobj+1;$numobj);
$After = GetLayoutObjectAttribute ( Value; \"containedObjects\" );
$Before = GetLayoutObjectAttribute ( Value; \"enclosingObject\" );
Control = GetLayoutObjectAttribute ( Value; \"isFrontTabPanel\" );
Control_before = GetLayoutObjectAttribute ( $Before; \"isFrontTabPanel\" );
$nivannul=Case(GetLayoutObjectAttribute ( Value; \"objecttype\" )= \"tab panel\" and Control=0 and $nivannul = \"\";$level;$nivannul);
$numobjannul=Case($nivannul ≠ \"\" and $numobjannul = \"\";$numobj+ ValueCount ( $After)-PatternCount($After;\"<\")-PatternCount($After;\">\");$numobjannul);
$numobjannul=Case($numobjannul=$numobj;\"\";$numobjannul);
$nivannul=Case($numobjannul=\"\";\"\";$nivannul);
$tabbef = Case(Control = 1 ; Value;$tabbef);
$cfront = case(Control>0 and $level = 0;$cfront+1;Control>0 and Control_before >0 and $nivannul=\"\" ;$cfront+1;$cfront&\"\");
$cfront = case ($cfront = $level + 1 and $After = \"\"; 0&let($ok=1;\"\");$cfront&let($ok=0;\"\"));
$First = $First & Case ($ok=1 and control>0; $rc & Value;$ok=1 and control=\"\";$rc & $tabbef )
]; \"\" ) &";
Result = Substitute( ( 10 ^ End ) - 1; 9; Calc )
];
Case(
End;
Evaluate( Result & "\"\"" ) & Substitute( $First; "|###|¶"; "" )
)
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/191
Prototype: TopTabPanel_List( )
Function Author: Eric (http://www.fmfunctions.com/mid/128)
Last updated: 17 January 2009
Version: 1.1
*/
// ===================================
/* TopTabPanel_List__LITBR__by Eric Plassot__LITBR__jan 09__LITBR__Not more than Nearby 150 Objects__LITBR__Not recursive__LITBR__ __LITBR__this list tab panels that are visible.__LITBR__You can, for example, use this list to create a script to return to their original position (Go to Object)*/__LITBR__Let(__LITBR__ [__LITBR__ $First = "|###|";__LITBR__ $rc = ¶;__LITBR__ $n = "";__LITBR__ $cfront = 0;__LITBR__ $level = 0;__LITBR__ $ListObj = LayoutObjectNames( Get( FileName ); Get( LayoutName ) );__LITBR__ $ListObj2 = $rc & $ListObj & $rc;__LITBR__ End = ValueCount( $ListObj );__LITBR__ Calc =__LITBR__ "let ([__LITBR__$n = $n + 1;__LITBR__Value = getValue ( $ListObj; $n );__LITBR__$level = Case ( Value = \"<\";$level+1;Value = \">\";$level-1;$level);__LITBR__$numobj= Case( value ≠ \"<\" and value ≠ \">\";$numobj+1;$numobj);__LITBR__$After = GetLayoutObjectAttribute ( Value; \"containedObjects\" );__LITBR__$Before = GetLayoutObjectAttribute ( Value; \"enclosingObject\" );__LITBR__Control = GetLayoutObjectAttribute ( Value; \"isFrontTabPanel\" );__LITBR__Control_before = GetLayoutObjectAttribute ( $Before; \"isFrontTabPanel\" );__LITBR__$nivannul=Case(GetLayoutObjectAttribute ( Value; \"objecttype\" )= \"tab panel\" and Control=0 and $nivannul = \"\";$level;$nivannul);__LITBR__$numobjannul=Case($nivannul ≠ \"\" and $numobjannul = \"\";$numobj+ ValueCount ( $After)-PatternCount($After;\"<\")-PatternCount($After;\">\");$numobjannul);__LITBR__$numobjannul=Case($numobjannul=$numobj;\"\";$numobjannul);__LITBR__$nivannul=Case($numobjannul=\"\";\"\";$nivannul);__LITBR__$tabbef = Case(Control = 1 ; Value;$tabbef);__LITBR__$cfront = case(Control>0 and $level = 0;$cfront+1;Control>0 and Control_before >0 and $nivannul=\"\" ;$cfront+1;$cfront&\"\");__LITBR__$cfront = case ($cfront = $level + 1 and $After = \"\"; 0&let($ok=1;\"\");$cfront&let($ok=0;\"\"));__LITBR__$First = $First & Case ($ok=1 and control>0; $rc & Value;$ok=1 and control=\"\";$rc & $tabbef )__LITBR__]; \"\" ) &";__LITBR__ Result = Substitute( ( 10 ^ End ) - 1; 9; Calc )__LITBR__ ];__LITBR__ Case(__LITBR__ End;__LITBR__ Evaluate( Result & "\"\"" ) & Substitute( $First; "|###|¶"; "" )__LITBR__ )__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/191__LITBR____LITBR__ Prototype: TopTabPanel_List( )__LITBR__ Function Author: Eric (http://www.fmfunctions.com/mid/128)__LITBR__ Last updated: 17 January 2009__LITBR__ Version: 1.1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
28 January 2009
I guess I'm to dumb to get it, I copied/pasted the custom calc and made a layout with ten tabs. The calc result gives me |###| if I click a tab. Only after if I give each tab an object number does the calc give me the object number result by clicking on a tab. But what is the use of that compared to the Get ( ActiveLayoutObjectName ) function? Please explain....
Greetings, Ruben
(Edited by Ruben van der Laan on 28/01/09 )
28 January 2009
We need to give a name to each object tab for this feature.
Regarding the question: "But what is the use of that compared to the Get ( ActiveLayoutObjectName ) function?"
I realize that I have not quite explained the specifics of the function.
The differences are:
ActiveLayoutObjectName actually gives the tabs that are selected from all the tab panels.
However, if several pannels are nested (example a new tab panel put into to a tab of the pannel below), this function will not specify which tab is selected at the end of the chain.
That is why I created this function, what the final tab is shown to be able to undo it if I change the model.
Do you understand?
I will try to remove |###| if tabs have no object name.
Escuse my english (and google translations ;o; I'm french)
best regards
(Edited by Eric on 28/01/09 )
02 February 2009
Now I get it, this is very interesting that you can find the end of the chain of tabpanels, I'll test this and see what I can do with it, thank you for your reply...
Pretty complex programming by the way, I'm sure I can't do it...
Thanks, Ruben
(Edited by Ruben van der Laan on 02/02/09 )
02 February 2009
this function is quite complex, so it is therefore long enough to run with FM function evaluate.
I know faster calculations made by other people in case there are many named objects. I can send them to you if you wish. There are also calculations for the simplest case there are several simple pannels (without nesting)
fun dutch friend.
Eric
30 July 2009
08 August 2009
can you give me an example of your base to e.plassot "put arobase here" laposte.net ?
(Edited by Eric on 22/08/09 )