04-02-2015 05:06 AM
Hey all,
I'm trying here to create something like the pattern matching thing on the smartphone (to unlock the phone). But I got things to ask. I couldnt find any topics which might help, perhaps I couldnt find the right keyword for this.
In the attached VI, I can click anywhere inside the cluster, then drag anywhere inside the cluster to change the bool controls OFF --> ON or ON --> OFF.
My Problem is, when I click directly above a bool control, it doesnt change the bool control directly. I have to click somewhere else first then hover my mouse above it to turn it on. Anyone has idea how can I solve this problem? I would have the bool control changed by click, then I can hover my mouse to other bool controls to turn it on either.
Yan.
Solved! Go to Solution.
04-02-2015 06:45 AM
Hello Mystogan,
You need to change your Cluster "indicator" to a "control" and add a event "Value Change" for each "Cluster.BooleschN" case in the event case structure.
In the VI snippet below I only added a "Value Change" for the first Boolesch, you will need to add it for other cases.
Michel
04-02-2015 07:36 AM
Hi Michel,
I'm sorry I dont really get your point. Can you please explain more?
I cant use your snippet since I'm using LV2010 here.What should happen in the "Value Change" event? can you perhaps save it for LV2010 version please?
I think, my problem is, I'm trying to "combine" two different events to get one job done:
hover my mouse over a bool and then click it--> the bool turned ON, then I can move my mouse to other bools to turn them ON either.
What I have now:
when I click (mouse down) anywhere in cluster, the indicator "clicked?" will be set to TRUE, then I can hover my mouse (while holding it down) to any bool to turn it on.
BUT, if I click it on a bool, the bool doesnt turn ON by this first click, I need to move my mouse somewhere else (holding mouse down inside the cluster), then back to the bool to turn it ON.
I've just read about dynamic event registration. But I dont think I can "combine" two events to get one job done.
Yan.
04-02-2015 07:57 AM - edited 04-02-2015 07:58 AM
You just need to double up your events. You should have the Mouse Enter and Mouse Down events for the booleans handled together. The Mouse Down for the cluster will always happen before the Mouse Down for the boolean (which is inside of the cluster). So your Clicked status will be correct when you check the status on the boolean's event.
04-02-2015 08:15 AM
Hi crossrulz,
that is a simple but effective solution. Thank you very much.
This means, when I click a boolean, there are 2 events coming: mouse down cluster and mouse down boolean.
Why havent I thought about this?
Thanks,
Yan.