Jump to content

Pane Mouse Down event


Recommended Posts

Dear sir,

 

I am using state machine concept in one of my projects. In my VI i have total 20 controls with different events. Now i would like to introduce the Pane mouse down event to front panel to validate my input parameters. If i introduce this pane mouse down event, then i have click on controls first it is executing the pane mouse down event and then it is going to particular control event means two events are happening. If i click on Pane only Pane mouse down event is executing. I want to discard the pane mouse down event when i click on the controls.

 

Kindly let me know how to implement this kind of events.

 

Thanks & regards,

S Nagaraju.

Link to comment

Perform the mouse down event on the control not the pane.  This will generate one event when there is a mouse down.  But a better solution would be to use the value change on the control, because I can change the value using the keyboard, with things like tab, which then wouldn't be caught using your mouse down event.  

 

Also post your code if you can so it can be made more clear what you are trying to do.

Link to comment

Wow this is entirely too complicated.  

 

  • How do you even stop this?  You have a false making sure your VI never stops running.  
  • What's with the random 10ms waits all over, and the key focus?  And the 100ms loop which does nothing for you.  
  • Your enums aren't typed.  
  • Your controls aren't labeled well (there is a boolean output named true).  
  • Controls aren't on the root of the BD in subVIs.  
  • You have multiple controls named the same in a single VI, your Panel Close should always discard, so you can perform cleanup by stopping the loop.
  • You should not exit LabVIEW like you are when in the development environment
  • No need to validate the values again when you start, if you are validating them when they have the value changed.

 

As I mentioned before just use the value change event on the control, no need for that top loop or all those local variables at all, or the functional global variable.  Attached is an updated version with some of these changes but man you know what would make this code even easier?  If you you use the control to coerce the entered value to have the range you want, then there would be no need to perform a validation because you'll know the values are correct.  Lucky for you someone has already posted this solution for you :angry:

Test_Pane Hooovahh Edit.zip

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.