Page 2 of 2

Re: Login Screen

Posted: Thu Apr 12, 2012 11:42 am
by mark.monroe
Hi Phong,

There is no help documentation for that class.

Re: Login Screen

Posted: Wed May 09, 2012 7:06 am
by BobLivingston
Is it possible to make the on-screen keyboard appear with the text window so users can see what they are typing when the textbox is covered?

Re: Login Screen

Posted: Wed May 09, 2012 8:42 am
by mark.monroe
Hi Bob,

No, there is not a way to do that. The on screen keyboard tries to position itself so it does not cover up the text box that the keyboard is entering data into.

Re: Login Screen

Posted: Sun May 13, 2012 2:49 am
by ajack
Dear Mark,

I encounter very strange error today. I tried custom login screen and everything work fine until today, I tried to add and button and delete it right away. This button has nothing to do with the Login Script or any Tags.

But after I validate the project, and many errors appear
LoginError.PNG
LoginError.PNG (32.76 KiB) Viewed 19598 times
It made me so confused cause in Login Screen Script, the last line is 77. Is there anything related to the bug you mentioned above in this thread?

Here is my code for Custom Login Screen

Code: Select all

namespace Neo.ApplicationFramework.Generated
{
    using System.Windows.Forms;
    using System;
    using System.Drawing;
    using Neo.ApplicationFramework.Tools;
    using Neo.ApplicationFramework.Common.Graphics.Logic;
    using Neo.ApplicationFramework.Controls;
    using Neo.ApplicationFramework.Interfaces;
    
	using System.Collections.Generic;
	using Neo.ApplicationFramework.Common.Utilities;
	using Neo.ApplicationFramework.Common.Service;
    
    public partial class LoginScreen
    {
		public ISecurityServiceCF _securityService;
		public IList<ISecurityUser> Users = Globals.Security.Users;
		
		// Get all username
		void LoginScreen_Opened(System.Object sender, System.EventArgs e)
		{
			foreach(ISecurityUser _user in Users)
			{
				UsersList.Items.Add(_user.Description);
			}
			
			passwordInput.Font = new Font("Tahoma", 26, System.Drawing.FontStyle.Regular);
			passwordInput.PasswordChar = '*';
			passwordInput.GotFocus += myEventHandler;
		}
		
		// Show keyboard when password input got focus
		public void myEventHandler(Object sender, EventArgs e)
		{
			passwordInput.SelectAll();
			IKeyboardHelper kh = KeyboardHelperFactory.KeyboardHelper;
			Rectangle rt = new Rectangle(0, 0, 0, 0);
			kh.ShowFullKeyboard(rt);
		}
		
		// check whether password is correct
		// show MessageBox when login sucessfully
		void LoginBtn_Click(System.Object sender, System.EventArgs e)
		{
			_securityService = ServiceContainerCF.GetServiceSafe<ISecurityServiceCF>();
			
			if ( _securityService.LoginUser(Users[UsersList.SelectedIndex].Username, passwordInput.Text) )
			{
				_securityService.ShowMessageBoxWithTimeout("User " + UsersList.Text + " is logged in", "Login Success");
				Globals.HomeScreen.Show();
			}
			else
			{
				_securityService.ShowMessageBoxWithTimeout("Wrong password - try again", "Login Failed");
			}
		}
		
		// Carefully: Delete event handler everytime exit Login Screen
		void LoginScreen_Closed(System.Object sender, System.EventArgs e)
		{
			passwordInput.Click -= myEventHandler;
		}

    }
}
Thanks and best regards,

Phong Duong

Re: Login Screen

Posted: Thu Jun 07, 2012 9:10 am
by khoff
I'm just looking into creating a custom login screen, as the combo boxes are pretty small on the QTERMA7 panel. Now, I'm terrible at scripting as I don't do it very often, but adapting snippets shouldn't be too hard!

Anyway, I get the same pallette of errors that the previous poster did, even after following the instructions on the first page of this thread. Can anyone help me out?

Thanks!
Kendall
error1.PNG
error1.PNG (81.25 KiB) Viewed 19552 times

Re: Login Screen

Posted: Thu Jun 07, 2012 10:05 am
by mark.monroe
You need to follow the following
procedure before opening the application:

1. Create a panel application, import the System.Windows.Forms.TextBox
object
(Embedded image moved to file: pic21726.gif)

2. Close the application
3. Open the CustomRecipeDialog application and build/run.
pic21726.gif
pic21726.gif (53.4 KiB) Viewed 19551 times

Re: Login Screen

Posted: Thu Jun 07, 2012 11:32 am
by khoff
I tried that in the source project, didn't work. Tried it your way, in a new project...worked fine. Thanks!

Also added an if check to exclude specific users (in our case, we want to exclude a "Temporary" user).

Code: Select all

	void PopulateList()
		{
			ISecurityManager securityManager = Globals.Security as ISecurityManager;
			foreach (ISecurityUser user in securityManager.Users)
			{
				if (user.Username == "User1")
				{
				}
				else 
				{
					cbUsers.Items.Add(user.Username);
				}
			}
			if(cbUsers.Items.Count > 0)
			{
				cbUsers.SelectedIndex = 0;
			}
		}

Re: Login Screen

Posted: Wed Oct 03, 2012 3:57 am
by antoineA
Hi everybody,

I have tried to use the custom login project for my T4A panel but there is a problem. In fact, this project is designed for a TA70 panel and when I change it to T4A, iX developer deletes the text form used for password (this form is not available for T4A). I have changed it by an AnalogNumeric form but is there a way to change alphabetic characters by '*' character in keyboard preview?

Thanks a lot.

Re: Login Screen

Posted: Wed Oct 03, 2012 8:51 am
by mark.monroe
This forum thread talks about how to make an AnalogNumeric box display password characters, rather than alpha numeric characters.

I believe that should solve you issue.

Re: Login Screen

Posted: Wed Feb 24, 2016 3:15 am
by Franswa
Hello,
I used the script that you give for my logscreen but I Have a problem on this part:

void PopulateList()
{
ISecurityManager securityManager = Globals.Security as ISecurityManager;
foreach (ISecurityUser user in securityManager.Users)
{
cbUsers.Items.Add(user.Username);
}
if(cbUsers.Items.Count > 0)
{
cbUsers.SelectedIndex = 0;
}
}


And he give me for error messages (in french):
-There is no definitions for "Items" and no extension method "Items"(a directive using or an assembly reference is missing?)
-There is no definitions for "Items" and no extension method "Items"(a directive using or an assembly reference is missing?)
-There is no definitions for "SelectedIndex" and no extension method "SelectedIndex" (a directive using or an assembly reference is missing?)


This message is just for my program because when i try the "customlogindialogue) given there are no problems. The rest of my programm is the same. Have I forgot somethings?

Your help will be welcome.
Best regards

Franswa