Cancel
Showing results for 
Search instead for 
Did you mean: 

unselect control

Valued Contributor
Valued Contributor

as below shown ,in below picture I can create a method control. when I select the object  the method will be executed,   now  I want to know  if  this can realize .    how can a  method control will be executed from the  object was  selected   to unselected in 2D and in 3D model .  how  can realize ? thank you  very much ! 

微信截图_20180517133431.png

6 REPLIES 6

Re: unselect control

Phenom
Phenom

Can you explain in other words, what you want to do

Re: unselect control

Valued Contributor
Valued Contributor
dear simulator
I mean when I cancel select the object a method will be call.
namely when the mouse leave the object . in last picture when I select the object use mouse the "select method" will be executed, now I want to know if when the mouse leave the object can a method will be executed?

Re: unselect control

Phenom
Phenom

Well, you can observe the "select" - attribute.

 

The observer method will be triggered , when you select or deselect the object.

 

I guess, a way of selecting an object and triggering a method,

 

when you move the mouse away from the selected object isn't implemented.

 

What workaround probably could work, is wrapping the object in an 2. object (e.g. line, with tooltip method)

 

to observe moving away from 1. object. through the call of 2. tooltip method  s. pic below.

 

In any case I'm curious about what this kind of functionality is meant for.

 

BTW

 

Trying to upload an v13 *.spp as attachment failed with following message

 

The contents of the attachment doesn't match its file type.

 

 

Unbenannt.PNG

 

 

 

 

 

 

 

Re: unselect control

Siemens Phenom Siemens Phenom
Siemens Phenom

I guess this is the "deselect counterpart" to the 3D selection topic you posted a couple of days ago.

 

The question I had when I read that topic back then is the same as now: What do you want to do when an object is selected/deselected and could this also (or better) be done based on something other than the selection? (what that might be, depends on what you want to accomplish)

 

The feature once was added to Plant Simulation before there were interactive controls like checkboxes or buttons that could react to a click by running a method. Reacting on selecting something more or less emulated reacting on clicks.

 

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution
Highlighted

Re: unselect control

Valued Contributor
Valued Contributor
dear PeterKomarek
what I want to do is that when I select the object there will open a dialog that will display some information , and when I deselect counterpart the dialog will be closed automaticly, there is a little similarity with that when the mouse put in a button there will appear a floating window when we Browse the web-site.

Re: unselect control

Siemens Phenom Siemens Phenom
Siemens Phenom

I see where you are getting at.

This roughly corresponds to the behavior of a docked properties window in a couple of applications. So the properties window there changes its content depending on what is selected (e.g. if you modify an element in an MS Office product like PowerPoint).

What it immensely different here, and I would seriously think about that, is that, contrary to such a docked UI element which more or less stays in the focus background politely, a dialog will grab your input focus every time. So every time the dialog opens, it will take over the task of reacting to keyboard input. That might render annoying after a short time.

 

What I imagine as a workaround is writing an Observer method for the SimTime attribute of an EventController.

To have that work, you would need the simulation running, or alternatively, have a dummy simulation running while your actual simulation is not. But it could work.

In that Observer method, you then can write a code that periodically checks whether the SimTime has progress by a certain amount, say, 1 second or so, and if so, search for selected objects in the frame you want to examine or the one object whose selection you are interested in.

 

Honestly, personally, I probably would not do that at all. The standard workflow to open information about an object in a dialog is to write an open control (which will then react on double-clicking, e.g.). The dialog will remain open but the user can close it again whenever he wants.

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution