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: 

Mouse clicks send app to crazy land

I have a multi-threaded app with two main windows. One is the data display / main user interface event handler. The other is a seperate window with nothing but the menu bar--basically categorized commands that may be executed independent of what the main user interface is doing. This way I can move the commands around, hide them, etc--they are seperate.

From the user interface I am running a script. At first the sub-vi that ran scripts was a modal 'Cancel' button to end the script and return to the user interface. The modal property kept the user from doing anything with the user-interface while the script was executing. Perfect. The problem is, it also kept the user from accessing the command window. So I changed the scri
pt from a modal dialog box to a non-modal pop-up window that i set to Always-on-Top. This allows access to the command window and keeps the 'Cancel' button on top so it won't disappear behind the user interface if the main window gets clicked. Also, the user interface remains locked out because the script sub-vi is called from the user interface event handler.

The problem I have is that clicking on the main user interface (for example, selecting a different tab to view) while the 'Cancel' button dialog box is visible, does nothing. When the dialog box exits however, all of the clicks done previously (which you'd think would have been forgotten), get propogated. The application goes haywire momentarily trying to change and update things. If you clicked five different tabs while the dialog box was open, it would do nothing, then all of a sudden (when the dialog box exits), flip rapidly between the five different tabs selected, as fast as possible.

Is there any way to cancel
or ignore these mouse click events that get sent to the main user interface? Is this a problem with the windows Always-on-Top setting?
0 Kudos
Message 1 of 4
(2,382 Views)
This is certainly occuring because of the "Always on Top" selection. However, there is one option you have here. You could try using Dynamic Events. They're new to LabVIEW 7.0. You can actually unregister a particular event (tab changed) and have it only trigger when you want. For instance, you could unregister this right before the cancel window comes up. Then, if the user clicks the tabs, since this event is unregistered, they will not be tallied. Then, when you get back to that window, there will be no events stored up so nothing should happen.
J.R. Allen
0 Kudos
Message 2 of 4
(2,382 Views)
Sounds good... unfortunately for me the red tape is going to be a while to cut through before I can get my hands on version 7.

For any further comments, this message was inadvertantly posted twice... Please see the other post by the same name for replies.
0 Kudos
Message 3 of 4
(2,382 Views)
> For any further comments, this message was inadvertantly posted
> twice... Please see the other post by the same name for replies.

I could swear that I posted a response to this, but I don't see it
anywhere. You might want to look at disabling the controls on the panel
that you want disabled. The easiest way to do this is likely to put the
controls in a tab structure. You can then disable the tab and it will
disable everything inside. This means that when the floater opens,
disable the tab, when it goes down, enable again. You might also
consider using disabled and grayed so that the user will realize they
can't click on the main window.

Greg McKaskle
0 Kudos
Message 4 of 4
(2,381 Views)