Thanks Martin!
Another quick one, do you know if there is a function to get a list of all the panel references on a panel?
Currently I'm using the getShapes function and then pulling out the 'shapes' prefixed with PANEL_REF.
Cheers
Eric
Public Method in ScopeLib hides references to other Panels
- emaddocks
- Posts:83
- Joined: Tue Sep 04, 2018 12:50 am
Re: Public Method in ScopeLib hides references to other Panels
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Public Method in ScopeLib hides references to other Panels
No really elegant way, but what is correct is:
using getShapes() getting all shapes; in a loop ask each shape for the "refName" attribute, which gives the PanelRef name.
Put the result into a dyn_string, at the end, use dynUnique
using getShapes() getting all shapes; in a loop ask each shape for the "refName" attribute, which gives the PanelRef name.
Put the result into a dyn_string, at the end, use dynUnique
Code: Select all
main(mapping event)
{
dyn_string all = getShapes(myModuleName(), myPanelName(), "");
dyn_string refs;
for (int i = 1; i- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: Public Method in ScopeLib hides references to other Panels
If have used a similar approach to get the references in a panel.
main(mapping event)
{
dyn_string ds_shapes;
dyn_string ds_refs;
int i;
// get all shapes
ds_shapes = getShapes(myModuleName(),myPanelName(),"",1);
DebugTN("all shapes",ds_shapes);
for(i=1;i 0)
{
string s_name;
s_name = substr(ds_shapes,0,i_pos);
if(!dynContains(ds_refs,s_name))
dynAppend(ds_refs,s_name);
}
}
DebugTN("all references",ds_refs);
}
Best Regards
Leopold Knipp
Senior Support Specialist
main(mapping event)
{
dyn_string ds_shapes;
dyn_string ds_refs;
int i;
// get all shapes
ds_shapes = getShapes(myModuleName(),myPanelName(),"",1);
DebugTN("all shapes",ds_shapes);
for(i=1;i 0)
{
string s_name;
s_name = substr(ds_shapes,0,i_pos);
if(!dynContains(ds_refs,s_name))
dynAppend(ds_refs,s_name);
}
}
DebugTN("all references",ds_refs);
}
Best Regards
Leopold Knipp
Senior Support Specialist
- emaddocks
- Posts:83
- Joined: Tue Sep 04, 2018 12:50 am
Re: Public Method in ScopeLib hides references to other Panels
Thanks Martin and Leopold,
I was trying to use getValue but didn't know what the parameter name to get was (using "refName" and "namePath" works great!).
Cheers
Eric
I was trying to use getValue but didn't know what the parameter name to get was (using "refName" and "namePath" works great!).
Cheers
Eric