From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure mouse up event outside icon bounds

I've just noticed that the 'mouse up' event only works if the mouse cursor remains hovering over the control panel icon associated with it.

 

It's a problem for me because I have a slider bar which passes values (via an event queue, then RS232 to hardware) when the slider value changes. But that can generate lots of queued up serial writes if I slide quickly back and forth with the slider, so I use a mouse up event to flush the queue. It appears to work, but if I click and drag, sliding the cursor outside the slider bar area, it fails to recognise the mouse up event.   

0 Kudos
Message 1 of 7
(3,154 Views)

Hi Graham,

 

Is it the default behaviour that the Mouse Up event only works while the mouse is above the control itself. If you want to have a slightly larger area, you can use the Mouse Up event of the Pane, and then check the co-ordinates of the mouse cursor before doing your processing.

Regards,


Imtiaz Chowdhury
Project Manager
Green Running / Austin Consultants

Message 2 of 7
(3,129 Views)

That's exactly what I am looking for. Thank you so much.

 

I am trying to scrol a series of images with a scrol bar.

I need the image in the place my mouse up to show up.

But I just found the "mouse up" event does not work if my mouse be outside the scroll bar, although the scrolling still works.

 

Following your advice, I made a event structure as

 

1. Mouse Down Event for scroll bar

Recognize the scroll bar was clicked and generate a true value.

True value is transfered with a shift register.

 

2. Mouse Up Event for pane

Recognize the mouse up.

If the transfered T/F value is true, then read the value of scroll bar (with local variable).

If the transfered T/F value is false, then do noting.

 

This works perfect.

0 Kudos
Message 3 of 7
(2,935 Views)
  • You replied to a very old post and it is not really clear what you are doing in detail.
  • What is a "series of images" (e.g. an array of images, a sorted list of image files, etc.)
  • Is this a standalone scrollbar control or part of a container or similar?
  • can you attach a simplified version of your code so we can get a better idea of you solution?

Thanks.

0 Kudos
Message 4 of 7
(2,907 Views)
Mouse up events do not fire unless you are over the object associated with the event. The idea is to give some one who mouses down on an object by mistake the chance to abort the operation.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 7
(2,885 Views)

Hi altenbach,

 

I attached the vi I made.

Although this vi works perfectly for me, I still hope you can give me some comment

 

What I want to do is,

1) image does not change until I releae mouse button from the scroll bar

2) But file name change when I move the scroll bar

3) I can relase mouse anywhere, not limited above scroll bar

 

Thanks.

0 Kudos
Message 6 of 7
(2,810 Views)

Just structurally:

 

  1. Get rid of the timeout event as it is doing nothing useful.
  2. Handle the stop button in the event structure too.
  3. Remove the 100msec delay -- also not needed.
  4. So the code properly initializes, programatically fire the scrollbar value change event before entering the loop.\

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(2,789 Views)