Normal Topic Security, visibility, Application Menu (Read 707 times)
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Security, visibility, Application Menu
Oct 25th, 2007 at 6:50pm
Print Post Print Post  
First, thanks to Ray for some issues he has resolved off line.

But now, I could use some guidelines about the use of Application Menu, and making Menu buttons invisible with security.

I have a Menu Page with 10 buttons.  This page is StartUp Page in Application Manager screen.
I have code that makes 6 invisible to all but @Group = "Admin".  Admin members see all 10, others only see 4.  This code is in FormEntry for the Menu Page.

Problem:
When starting application, Menu Page is visible with all 10 buttons, Login screen is visible.
After logging in, visibility does not change, (form is already open and visible before login).
This causes two problems for me: 1.  I don't want non-Admin to know about other buttons/functions.  2.  Invisibility does not run.
So, I changed the six admin buttons to be invisible as default.  That solved the first issue, the admin buttons do not show when the login screen comes up.  But after login, the Invisibility code does not run again , form is already loaded?
So, I tried putting the Invisibility code in Application Manager but that failed "Test" because the CommandButtons did not exist.

------------------------------
So, how do I trigger the code to change visibility of elements on a form that is loaded from the Application Manager?  I tried FormReveal as a trigger, but that also did not work.  I am looking for a solution that does not require any mouse or keyboard action to present the Menu with the Visibility Code executed.

And as a general comment, I would prefer that that form not even be made visible until after login has been authenticated.  Changing that timing would also probably solve this problem of code not executing because event has already happened.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Security, visibility, Application Menu
Reply #1 - Oct 25th, 2007 at 6:59pm
Print Post Print Post  
The only programming that runs on a start-up form is the On Element Entry event of Command Buttons.

To do what you are wanting to do you will want to have No startup form and use @SelectTreeItem() in the On Application Open Event to open your Main Menu and SetDefaultTab() to set it as the default.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Security, visibility, Application Menu
Reply #2 - Oct 26th, 2007 at 6:32am
Print Post Print Post  
Now that my Menu Form is the "Application Form", only the buttons work OnEnter, as you mentioned above.

What was not mentioned is that none of the menu Accelerator Hot Keys work.  When the form is loaded normally, the Hot Keys work fine, but when used on Application Menu, the button flashes, but the program does not execute. 

I think that this should be corrected to enable Accelerator Keys to function.  I suspect that in most cases, the Application Form will usually be a Menu Page.

Maybe in 2.0.4?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Security, visibility, Application Menu
Reply #3 - Oct 27th, 2007 at 3:39am
Print Post Print Post  
Bob_Hansen wrote on Oct 26th, 2007 at 6:32am:
What was not mentioned is that none of the menu Accelerator Hot Keys work.  When the form is loaded normally, the Hot Keys work fine, but when used on Application Menu, the button flashes, but the program does not execute.

I know this is not the answer you wanted, but if you first click on the form background, then the hotkeys will work.

Also, I found that Visibility() and Label() type commands work on Startup forms if you put them in Global Code. Though, you will still see your "hidden" buttons flash briefly before and after the login process.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Security, visibility, Application Menu
Reply #4 - Oct 27th, 2007 at 4:02am
Print Post Print Post  
Thanks Carl

You are correct, I really expect the Accelerator keys to work right away. Ah, it's probably the old "focus" issue.  Need to do the first click to get focus on the form.  Click on the button does not do both focus and click.  But this requires using the mouse.  Want to try to stay with keyboard only.  How to get focus on form so Accelerator key will work?

Re the code in GlobalCode section:
How are you triggering the code?  Did you make a sub routine that is called by FormName/OnFormEnter?

To hide the Main Menu until after login, I am now using a Welcome Form that shows during login.  And it has one button with Accelerator key that continues to the Main Menu.  So I have handled the "hide the application during login" issue, but still want to get to Main Menu from keyboard.  Will have to play around some more.  Not a killer problem, but like a smooth GUI.  Don't like moving back and forth from keyboard to mouse.

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Security, visibility, Application Menu
Reply #5 - Oct 27th, 2007 at 4:53am
Print Post Print Post  
Bob_Hansen wrote on Oct 27th, 2007 at 4:02am:
Re the code in GlobalCode section:
How are you triggering the code?  Did you make a sub routine that is called by FormName/OnFormEnter?

No. I simply put the code right there in the Global Code.

For example, when the following is in Global Code, the Deposits button displays "2007 Deposits" rather then its regular "Deposits".
Code
Select All
Stat sYear as String = @GlobalValue("CurrentWorkingYear")
Label(Deposits, sYear + " Deposits") 



BTW, the hotkeys are not being affected by the Startup form being set, they are being affected by the login. Try temporarily disabling security, and you should find that the hotkeys work without the mouse click requirement.

Just had an idea...
Instead of using a welcome form that shows during login, maybe you could design the Startup form with a large box that covers all the other LEs. Then, you could hide it at the same time as when you hide the other items. This way, nothing from the form would be seen until you allow it.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Security, visibility, Application Menu
Reply #6 - Oct 27th, 2007 at 5:17am
Print Post Print Post  
The "large box to cover the entire form" idea works!

I created a filled box (filled with same color as the form background) which covers the entire form, set it to a layer higher than the rest of the elements so that it always covers them, and added a Visibility() command to Global Code (right next to the section that hides the other command button).

This stops the elements that you want to keep out of sight, from briefly displaying before and after the login process. The following code is what I used to test this idea.
Code
Select All
Stat sYear as String = @GlobalValue("CurrentWorkingYear")

Label(Add, sYear + " Deposits")
Visibility(Search, 0)	// Hides a Command Button
Visibility(Box1, 0)	// Hiding Box1 reveals the other form elements 



I was never able to catch a glimpse if the "Search" command button. So, you could use this method instead of the welcome screen to keep the secret buttons/elements fully hidden.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Security, visibility, Application Menu
Reply #7 - Oct 27th, 2007 at 4:19pm
Print Post Print Post  
Sounds good Carl.

Next step is to replace box with  full screen image/logo, etc.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged