TTMSFNCPassLock
The TTMSFNCPassLock gives you the ability to add password protection to your application. This can be done with a numpad or a pattern.
Properties
Property name | Description |
---|---|
ButtonAppearance | Down, hover and normal fill, stroke and font of the buttons in the numpad or pattern. And the maximum size of the buttons. |
EntryAppearance | Down and normal fill and stroke of the entry indicators in the numpad. And the maximum size of the entry indicators. |
Options | Can set the type of passlock (numpad or pattern), to show the ‘OK’ (in case you want the ability to use a variable password length) and ‘CE’ (to clear the last value added to the entry) button in numpad and to enable the learn mode (to set a new password) and enable the keyboard input. |
PasswordEntry | Is the current combination that is entered at the moment. |
PasswordLength | The length of the password that is set (Read-Only). |
PasswordValue | The current password that is set, is a numerical value according to the index of the button. (Eg. for the pattern it is ‘156’ in the image above.) |
Events
Event name | Description |
---|---|
OnBeforeDrawBackground | Event triggered before drawing the Fill and Stroke. |
OnAfterDrawBackground | Event triggered after drawing the Fill and Stroke. |
OnBeforeDrawButton | Event triggered after drawing the Fill and Stroke. |
OnAfterDrawButton | Event triggered after drawing the button |
OnBeforeDrawButtonValue | Event triggered before drawing the button value. |
OnAfterDrawButtonValue | Event triggered after drawing the button value. |
OnBeforeDrawEntry | Event triggered before drawing the password entry. |
OnAfterDrawEntry | Event triggered after drawing the password entry. |
OnBeforeDrawPattern | Event triggered before drawing the pattern line. |
OnAfterDrawPattern | Event triggered after drawing the pattern line. |
OnBeforeDrawPatternCircle | Event triggered before drawing the pattern circle. |
OnAfterDrawPatternCircle | Event triggered after drawing the pattern circle. |
OnButtonAppearanceChanged | Event triggered when the button appearance is changed. |
OnButtonDownChanged | Event triggered when the button in down state is changed. |
OnButtonHoverChanged | Event triggered when the hovered button is changed. |
OnButtonUpChanged | Event triggered when the button in up state is changed. |
OnConfirmPassword | Event triggered when password is set for the second time in learn mode. |
OnEntryAppearanceChanged | Event triggered when the entry appearance is changed. |
OnLearnPassword | Event triggered when password is set for the first time in learn mode |
OnNewPassword | Event triggered when new password is set. |
OnOptionsChanged | Event triggered when the options settings are changed. |
OnPasswordCheck | Event triggered when the entry and password are compared. |
OnPasswordEntryChanged | Event triggered when the entry is changed. |
OnPatternEntryChanged | Event triggered when the entry of the pattern is changed. |
OnPatternEntryEnd | Event triggered when the entry of the pattern is ended. |
If you want the user to set a new password you can do this with the LearnMode property in Options. This enables the user to enter the password that they want (OnLearnPassword event). To set the new password, the user needs to enter the same one for a second time (OnConfirmPassword event). In case these are both similar, then you will have set a new password (OnNewPassword event), otherwise the password will need to be set for the first time again.
The TMSFNCPassLock will center the buttons and the entry indicators automatically based on the size of the component. To block the underlying components it is possible to set the control client alligned and set the size of the buttons and the indicators with the MaxSize property in the appearances. In case you want them to take the full space, you can set the value to -1.
When you don’t want to show the password length you can set the ShowPasswordLength property to false. This will check the password only after the ‘OK’ button was clicked. Which will initially be shown when you set the ShowPasswordLength property to false.