Embedded module resizing / finding shape for uiConnect

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
1 post • Page 1 of 1
mikek10
Posts: 6
Joined: Wed Jun 26, 2019 2:05 pm

Embedded module resizing / finding shape for uiConnect

Post by mikek10 » Sat May 02, 2020 11:23 am

Hi,

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",
makeDynString("$X:"+618, "$Y:"+40),641,40,0,0.95,0.95,"");


uiConnect("HandleAreaPressed", mod_Overview.ModuleName+".topOverview:", "areaPressed");



in overview.pnl i have:

addSymbol(myModuleName(), myPanelName(), "clickarea.pnl", "area_"+storage.Name,
makeDynString("$Name:"+storage.Name, "$Width:"+storage.OverviewWidth,
"$Height:"+storage.OverviewHeight
, "$Segment:"+storage.Segment, "$Place:"+storage.Place
, "$FilePath:"+storage.ImagePath, "$Rotation:"+storage.Rotation)
,((float)$X+storage.OverviewX)+20,((float)$Y+storage.OverviewY+22),0,0,0,"");
//,storage.OverviewX+20,storage.OverviewY+22,0,0,0,"");

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.


EDIT:

I eventually figured it out:
uiConnect("HandleClick", myModuleName()+"."+myPanelName()+":area_"+storage.Name, "areaPressed");

Post Reply
1 post • Page 1 of 1