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
Ui Global Events
Search
Re: Ui Global Events
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.
@"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
But is there a way to set the code of the event after creating the OOP.
Example:
Is is possible to set the code of "myEvent" in a similar manner?
The following does not seem to work:
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.
The following does not seem to work:
Code: Select all
setValue(refName,"myEvent","DebugN()");
Re: Ui Global Events
Hi,
An event is not a property. It can only be triggered or connected...
BR
Alex
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
Okei.
I can use uiConnect to connect to events from symbols added with "addSymbol". But how can this be done when using "RootPanelOnModule"?
What is the source I should insert instead of ???
BR
Dag-Are
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
BR
Dag-Are
-
gschijndel
- Posts: 373
- Joined: Tue Jan 15, 2019 3:12 pm
Re: Ui Global Events
Try one of the following (as described under CONTROL -> Control graphics -> Graphic objects -> Access shapes in other panels and modules):
or
Code: Select all
this.ModuleName + ".oopitem:"Code: Select all
this.ModuleName + "." + rootPanel(this.ModuleName) + ":"