Ui Global Events

Discussion about recent product features & solutions!
Search

Post Reply
6 posts • Page 1 of 1
walterd
Posts: 38
Joined: Wed Mar 13, 2013 10:39 pm

Ui Global Events

Post by walterd »

Hello,
is there a way to create Ui Global events when using uiConnect ? I know I can create custom event , but in my case it would be really helpful to have a Ui Global event (not the ones pre-defined).

In alternative, is it possible to create custom events with implementation right in the OOP class ?
Let me explain better:

When creating an event in a OOP with
#event myEvent(bool b)

there is no way to create an implementation of the event. You can only do it when the OOP is instantiated. At that point in the Extended tab you'll have the myEvent available to be implemented.

What I would like to have is to implement the event in the design of the OOP , thus all the object of that class will have the same event. Think about instantiating a large number of objects of the same OOP class and implement all the custom event for each one !

Thank You

User avatar
mkoller
Posts: 741
Joined: Fri Sep 17, 2010 9:03 am

Re: Ui Global Events

Post by mkoller »

There is currently no way to add your custom UI-global event. It was requested already so maybe I'll add that in some future version.

@"implementation of the event":
You do not implement an event, you only trigger it.
Any other script can connect to it (receive the event) and implement whatever is needed.
What you see in the extended tab, is the implementation on the RECEIVER of this event.

When you want to do something on all instances of a panel reference, then simply implement a private scopeLib function inside the panelRef,
which you call internally where you would now trigger the event.

Dag-Are.Trydal@nov.com
Posts: 37
Joined: Fri Feb 26, 2016 11:52 am

Re: Ui Global Events

Post by Dag-Are.Trydal@nov.com »

But is there a way to set the code of the event after creating the OOP.

Example:

Code: Select all

OOP Object (OOPItem.pnl) with:
#event myEvent(bool b) 


When adding this object:
addSymbol(myModuleName(), myPanelName(), "OOPItem.pnl", refName, makeDynString(""),0,0,0,1,1);
  
setValue(refName,"position",10,10); // It is possible to set the STANDARD properties.
Is is possible to set the code of "myEvent" in a similar manner?

The following does not seem to work:

Code: Select all

setValue(refName,"myEvent","DebugN()"); 

User avatar
adaneau
Posts: 310
Joined: Tue Feb 21, 2012 9:49 am

Re: Ui Global Events

Post by adaneau »

Hi,

An event is not a property. It can only be triggered or connected...

BR
Alex

Dag-Are.Trydal@nov.com
Posts: 37
Joined: Fri Feb 26, 2016 11:52 am

Re: Ui Global Events

Post by Dag-Are.Trydal@nov.com »

Okei.

I can use uiConnect to connect to events from symbols added with "addSymbol". But how can this be done when using "RootPanelOnModule"?

Code: Select all

OOP Object (OOPItem.pnl) with:
#event myEvent(bool b) 

When adding this object using "addSymbol" uiConnect is ok:
addSymbol(myModuleName(), myPanelName(), "OOPItem.pnl", refName, makeDynString(""),0,0,0,1,1);
uiConnect("testCallback", refName, "myEvent"); // testCallback works 
 
When adding this object using "RootPanelOnModule" uiConnect is NOT ok:
RootPanelOnModule("OOPItem.pnl", "oopitem", this.ModuleName, makeDynString());
uiConnect("testCallback", ???, "myEvent"); // testCallback does not work
What is the source I should insert instead of ???

BR
Dag-Are

gschijndel
Posts: 373
Joined: Tue Jan 15, 2019 3:12 pm

Re: Ui Global Events

Post by gschijndel »

Try one of the following (as described under CONTROL -> Control graphics -> Graphic objects -> Access shapes in other panels and modules):

Code: Select all

this.ModuleName + ".oopitem:"
or

Code: Select all

this.ModuleName + "." + rootPanel(this.ModuleName) + ":"

Post Reply
6 posts • Page 1 of 1