Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Oct 23, 2019 10:18 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Custom Window for license agreement
PostPosted: Wed Mar 02, 2011 11:57 am 
Offline

Joined: Wed Jan 31, 2007 9:01 am
Posts: 273
Location: Saratoga Springs, NY area
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,

_________________
writer

Windows 7 Home Premium 64 bit, Core i7, 8G RAM, ATI Radeon HD5770, Release 2011r3


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Window for license agreement
PostPosted: Wed Mar 02, 2011 12:02 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
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.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Window for license agreement
PostPosted: Wed Mar 02, 2011 12:30 pm 
Offline

Joined: Wed Jan 31, 2007 9:01 am
Posts: 273
Location: Saratoga Springs, NY area
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,

_________________
writer

Windows 7 Home Premium 64 bit, Core i7, 8G RAM, ATI Radeon HD5770, Release 2011r3


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Window for license agreement
PostPosted: Wed Mar 02, 2011 12:46 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
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.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Window for license agreement
PostPosted: Wed Mar 02, 2011 1:06 pm 
Offline

Joined: Wed Jan 31, 2007 9:01 am
Posts: 273
Location: Saratoga Springs, NY area
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,

_________________
writer

Windows 7 Home Premium 64 bit, Core i7, 8G RAM, ATI Radeon HD5770, Release 2011r3


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Window for license agreement
PostPosted: Wed Mar 02, 2011 1:12 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
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

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Window for license agreement
PostPosted: Wed Mar 02, 2011 1:36 pm 
Offline

Joined: Wed Jan 31, 2007 9:01 am
Posts: 273
Location: Saratoga Springs, NY area
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,

_________________
writer

Windows 7 Home Premium 64 bit, Core i7, 8G RAM, ATI Radeon HD5770, Release 2011r3


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group