On Feb 5, 2006, at 11:46 AM, Joe Cabrera wrote:
Jack said:
> Plus I just instantiate the crossword just the one time this way
and everyone's working from the same crossword; otherwise,
wouldn't the first window have to pass the grid size info to the
second (using global variables I guess), so that the second
window could instantiate the crossword with the speciified
dimensions?
I'm unclear what you mean here because I don't know the details of
your approach, so I'll ramble. SetUp will instantiate a new
Crossword instance, and pass the user defined parameters in a
constructor or call an Init method belonging to Crossword.
CrossWord will have properties that accept and hold these
parameters, and methods to implement the puzzle configuration
accordingly.
It's likely that CrossWord will enable a menuitem for SetUp when
it opens so that the user can revise the configuration at this
point, probably before providing input into the puzzle.
Your File menu may also have a New Puzzle menu item with a
menuhandler in App. When this is selected you would instantiate a new
Crossword instance, using the current user settings from SetUp.
You're right that I'm going to want to add a NewPuzzle menu which
will bring up the SetUp window.
I think I'm unclear just where the best place is to instantiate a
new Crossword in my code. Right now it's in the SetUp window code,
but then no other window knows about the created Crossword
instance. Do I subclass Application, and instantiate the Crossword
there when it activates, which I assume makes it available to the
entire program?
You probably want to add a menuitem under File and name it New
Puzzle. Add a menuhandler for FileNewPuzzle in App. Now you have some
design choices. When the user selects File/New Puzzle, decide whether
you want to open CrossWord with default settings(based on user's last
configuration selections) or do you want to show SetUp first and then
show CrossWord when the user dispatches SetUp. Probably the former,
right? Think of it like opening a new document in Word. You want to
see a blank page that you can start typing into.
Your SetUp window should also be available from the menubar, so that
the opening configuration can be revised per the user's desires. In
this case, the menuhandler for SetUp will go into CrossWord's
menuhandlers, because CrossWord has a method which reads SetUp's
properties and configures itself accordingly.
In the App Open event you can instantiate SetUp and an initial
CrossWord instance. Eventually you may want to have a Preference file
to hold settings on shutdown, and you would read it here. That get's
things going on startup.
Is that clear? I'm still new to the RB world so I'm a little fuzzy
on things that may be obvious to y'all...
The best thing to do at this point is to 'dummy it up' , maybe just
using blank versions of the windows with titles and pushbuttons until
you're comfortable with the flow and menuing, and the methods needed
to transfer information.
Best regards,
Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>