Asking password before setting a component


Recommended Posts

I am using an Edit Box Component and on click of Set button I want some script to run where I can ask for password, match the password and then set the channel value.

I can do it by just providing a normal text box and separate button which will run the action, it is more work as I have many Edit boxes where I want to implement something like that. Also one more problem with that is by using system.EntryDialog I can ask for password but it displays plain string and not '***', is there any way to make text in EntryDialog to be password type ('***').


Or, Is there any other efficient way to do the whole process which I am trying to do because I have multiple set components.


Link to comment
Share on other sites

First, you might want to check this post I made about using Edit boxes:

At present there is no way to make EntryDialog cover passwords.  You'd really just have to create your own popup window with a password edit box and a nice function to call it.

As for the first part, you might try using the OnChange event of the Edit Box.


Link to comment
Share on other sites

I have already implemented it using OnChange event.

I'll try to do everything in a pop up as said in the link with some valid reasons, thanks for the link.


Also, I would like to know, is there anything similar to 'this' keyword in Daqfactory? because it can help to keep the code clean while writing a function similar to this.

Link to comment
Share on other sites

There is in the next release, which will probably be in January.  It's not quite "this" as that returns a pointer, but rather a string that returns the component name, called, appropriately, "ComponentName".  So you can pass this to a common function, then use execute() or evaluate() to access the component by name.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.