Embedded module resizing / finding shape for uiConnect
Note: This is no replacement for the Official ETM Support!
I am having a couple of issues, solving either would suffice. I have a panel than dynamically loads several instances of a further panel using the addSymbol command, then performs a uiConnect command to handle events within its sub panels.
This panel is itself then embedded in my applications root panel and uiConnect used again to pass the events from lowest level back to top-level, this is where my troubles start. If I use an embedded module and loadpanel then the events of the lowest level panels correctly propagate back to the root panel which is good! However when loaded in this way I cannot seem to find a method to force the panel to resize itself to fit the dimensions of the embedded module - no matter what I try either part of the panel is cut-off or the embedded module itself is resized rather than its contents.
If I load the sub-panel into the root panel by using addSymbol then everything is perfectly sized to fit the dimensions I want and displays well but the uiConnect command between sub-panel and lowest level panels no longer works as it cannot find the low level object. Using a Panel Ref object instead of embedded module gives me the same issues as addSymbol.
In the root panel I have the following:
to load using embedded module:
mod_Overview.loadPanel(0,"Overview.pnl", "topOverview",makeDynString("$X:"+0, "$Y:"+0));
to load using addSymbol:
addSymbol(myModuleName(), myPanelName(), "Overview.pnl", "topOverview",
uiConnect("HandleAreaPressed", mod_Overview.ModuleName+".topOverview:", "areaPressed");
in overview.pnl i have:
addSymbol(myModuleName(), myPanelName(), "clickarea.pnl", "area_"+storage.Name,
, "$Segment:"+storage.Segment, "$Place:"+storage.Place
, "$FilePath:"+storage.ImagePath, "$Rotation:"+storage.Rotation)
uiConnect("HandleClick", "area_"+storage.Name, "areaPressed");
I have tried using getShape first and passing the result of this as the reference in uiConnect but the shape is only found when overview.pnl is run in an embedded module in this way: anytype posref=getShape( "area_"+storage.Name);
I am assuming that the issue with running via addSymbol is due to the parent panel being different but I have tried many variations of specifying module and panel name but cannot seem to hit on a combination where the shape is found
Thanks in advance for any help.
I eventually figured it out:
uiConnect("HandleClick", myModuleName()+"."+myPanelName()+":area_"+storage.Name, "areaPressed");