LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do password protection in tab control?

Solved!
Go to solution
Message Edited by Harold Timmis on 09-07-2009 03:09 AM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 11 of 23
(2,179 Views)

Hi,

 

Thanks for the example. I think both vi are pretty good. I think the roadblock is how to integrate it as a sub-vi, i.e. how to trigger it upon the click of one disabled&grey out tab. Besides, the correct input of password will also re-enable the initially disabled tab..

 

Thx.

 

Nick 

0 Kudos
Message 12 of 23
(2,133 Views)

Hi,

I think Raven's example will be good enough as I just need a simple password protection. I have modified the password setting in the protected tab. thus, could Raven or maybe someone else show me an example of how to integrate the example(in previous attachment by Raven) as a sub-vi and trigger by a click?

 

Cheers,

nick 

0 Kudos
Message 13 of 23
(2,129 Views)

Take a look at this.  I used the Mouse down event to detect when the tab control has been clicked.  I compared the coordinates to the coordinates of the disabled tab.  If the coordinates are in that rectangle, then a user prompt dialog box is called to ask for the password.

 

Note that his is a basic Express VI to get the concept of the mouse clicks demonstrated.  If you need a more sophisticated dialog box like one that has the password ***** display shown, you will need to create your own dialog type subVI.  There are numerous examples of that on the forums.  You could even convert your Express VI to a normal subVI by right click open front panel, and make the modifcations to that and save it.

Message 14 of 23
(2,108 Views)

hey, ravens, thanks a lot..you example is always helpful..I'm not very sure about how you achieve the mouse down in the example. Basically I will remove the while loop&event loop. The express VI 'promp user for input' and comparison of coordinates will be sufficient for me. So my query is how to get the coordinate of cursor upon a mouse click down. In other words, the mouse down will trigger sth to get the cursor postion and then I'll feed this position coordinate to the coordinate comparison you provided in the last example/ 

 

I'm looking forward to your reply!! 

 

Cheers,

SSR 

0 Kudos
Message 15 of 23
(2,061 Views)

BTW, I have explored the basic mouse input example.... that one involving sub_VI seems too complex for my case...I'm just looking for a simple one to get the curse coordinate upon mouse click...

btw, how did you find out the four coordinates of the tab?  

0 Kudos
Message 16 of 23
(2,059 Views)

SSR_Nicholas wrote:

hey, ravens, thanks a lot..you example is always helpful..I'm not very sure about how you achieve the mouse down in the example. Basically I will remove the while loop&event loop. The express VI 'promp user for input' and comparison of coordinates will be sufficient for me. So my query is how to get the coordinate of cursor upon a mouse click down. In other words, the mouse down will trigger sth to get the cursor postion and then I'll feed this position coordinate to the coordinate comparison you provided in the last example/ 

 

I'm looking forward to your reply!! 

 

Cheers,

SSR 


I don't know how you expect it to work without the while loop and event structure.  The event structure is what detects that the mouse down has occurred.  And you need the while loop around it so that you can detect more than just the very first mouse down event.

 

To get the cursor position of the tab, I placed and indicator on the Coords node inside the event structure.  That indicator is still present, but would be removed in the normal program.  Then I just clicked around on the tab at the extremes where I figured the limits of the mouse click should be detected.  I wrote down the coordinates and just placed them as constants when I wrote the remainder of the code.  Of course if the tab control moves within the windows, or the names on the tabs change where they are longer or shorted and change the relative position of that tab, then the coordinates will be different and have to be determined again.

0 Kudos
Message 17 of 23
(2,053 Views)

 

yup, I got a while loop for the whole program so didn't need another internal one. So do you know any alternative for a mouse down?  I'm looking for something simpler than event.. 🙂

 

Cheers,

SSR 

0 Kudos
Message 18 of 23
(2,045 Views)

No, I don't know of any other way to detect the mouse click.  And if there is something, I don't think it would be any simpler than the event structure.

 

Is there some reason you don't want to use the event structure?

0 Kudos
Message 19 of 23
(2,033 Views)

no... it used to be stuck there if i don't click the mouse..but not i created an empty event and it was solved...thx~

 

Cheers,

SSR 

0 Kudos
Message 20 of 23
(2,023 Views)