TopTabPanel_List ( )

Function stats

Average user rating
128
191
9999
Support
FileMaker 8.5 +
Date posted
17 January 2009
Last updated
18 January 2009
Version
Recursive function
No

Author Info
 Eric

7 functions

Average Rating None

author_avatar



 

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: 18 January 2009
    Version: 1.1

*/
// ===================================

 

Comments

Ruben van der Laan
28 January 2009



Hi Eric,

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 )
  General comment
Eric
28 January 2009



hello Ruben and thank you for asking.
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 )
  General comment
Ruben van der Laan
03 February 2009



Hi Eric, No problem with your English (I am Dutch (Pays Bas))...

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 03/02/09 )
  General comment
Eric
03 February 2009



Ruben,
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
  General comment
WilliamCB2
31 July 2009



I have two levels of tabs nested inside each other. I am looking for the name of the frontmost tab panel (ie always one of the inside panels). But this function gives me a sibling of the correct result.
 Bug report
Eric
09 August 2009



Hi William and thanks to report bug
can you give me an example of your base to e.plassot "put arobase here" laposte.net ?
(Edited by Eric on 23/08/09 )
  General comment

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)