Real Software Forums
http://forums.realsoftware.com/

Custom Window for license agreement
http://forums.realsoftware.com/viewtopic.php?f=6&t=37921
Page 1 of 1

Author:  writer [ Wed Mar 02, 2011 11:57 am ]
Post subject:  Custom Window for license agreement

Hi,

I've created a main window and a few additional windows. But, the first window that I want the user to view is a license agreement window, where they can either accept or cancel (accept would open the main window and close the license agreement window. The accept button also sets a boolean value to true, then hopefully in the license agreement window's open event, if the boolean value is true, the license agreement window will immediately close and the main window will open. No pre-open event? An app event?)

Question: Having created this license agreement window last (after the main window and others), how can I make it the first window that the user encounters/views after the app opens?

Kind Regards,

Author:  markwalsh [ Wed Mar 02, 2011 12:02 pm ]
Post subject:  Re: Custom Window for license agreement

writer wrote:
Hi,

I've created a main window and a few additional windows. But, the first window that I want the user to view is a license agreement window, where they can either accept or cancel (accept would open the main window and close the license agreement window. The accept button also sets a boolean value to true, then hopefully in the license agreement window's open event, if the boolean value is true, the license agreement window will immediately close and the main window will open. No pre-open event? An app event?)

Question: Having created this license agreement window last (after the main window and others), how can I make it the first window that the user encounters/views after the app opens?

Kind Regards,

I set the 'Default window' for the app to be 'none' in my applications, and specifically open the main window in code.

Author:  writer [ Wed Mar 02, 2011 12:30 pm ]
Post subject:  Re: Custom Window for license agreement

Hi Mark,

At first, I wondeedr if just setting the default window to the agreement window would work.

The challenge is that once the user agrees one time by clicking OK, I would like to set it up that they do not have to see the agreement window again (they would hopefully go directly to the main window from that time on).

I could code the OK button to set a boolean to true as a 'flag,' but without a way to store this boolean value somewhere on the user's machine and read it back every time the app is booted up, I began to realize that this won't work.

Would the method that you used work for this?

Other suggestions?

Kind Regards,

Author:  markwalsh [ Wed Mar 02, 2011 12:46 pm ]
Post subject:  Re: Custom Window for license agreement

writer wrote:
Hi Mark,

At first, I wondeedr if just setting the default window to the agreement window would work.

The challenge is that once the user agrees one time by clicking OK, I would like to set it up that they do not have to see the agreement window again (they would hopefully go directly to the main window from that time on).

I could code the OK button to set a boolean to true as a 'flag,' but without a way to store this boolean value somewhere on the user's machine and read it back every time the app is booted up, I began to realize that this won't work.

Would the method that you used work for this?

Other suggestions?

Kind Regards,

Whatever window you set as the default will always open with the application. If you want to run the agreement window each time, then that would work, but if you want to show the agreement once only and open the main window every other time agterwards, you will need to set the default to none and open each window at the proper time manually.

Author:  writer [ Wed Mar 02, 2011 1:06 pm ]
Post subject:  Re: Custom Window for license agreement

Hi Mark,

Any way to write to the registry, set an "agreement" flag to "True" and then read back from it on opening the app?

If yes, how?

Kind Regards,

Author:  markwalsh [ Wed Mar 02, 2011 1:12 pm ]
Post subject:  Re: Custom Window for license agreement

writer wrote:
Hi Mark,

Any way to write to the registry, set an "agreement" flag to "True" and then read back from it on opening the app?

If yes, how?

Kind Regards,

There are multiple ways to save the flag to the user's machine; registry(Windows) a 'prefs' file, or store it in a database. In my apps, I was always using a database already, so I would just store any preferences there. I've never used the Registry to store values.

DaveS wrote a class for saving 'ini' files that you might want to take a look at: viewtopic.php?f=6&t=31782

Author:  writer [ Wed Mar 02, 2011 1:36 pm ]
Post subject:  Re: Custom Window for license agreement

Thanks, Mark.

I also found an interesting registry tutorial by Aaron Ballman at http://www.aaronballman.com/programming/REALbasic/registry_item_article.php.

Kind Regards,

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/