Re-Usable Data Dialog For Game

Started by
7 comments, last by hatflyer 20 years, 4 months ago
I want to add a button to a Windows dialog app which will open another dialog window with card buttons. The user picks a few cards in the second window, then that card window is closed/hidden/minimized so he''s back to the first window. But, he then gets to go back to the card window later to pick a few more cards. Since I need to keep track of which cards were picked the first time (e.g. to disable those card buttons), what is the best way to save the info in that second window? Should I just minimize that second window after cards are chosen? How would I set up the relationship between these 2 windows best? Thanks, jim
Advertisement
The hell are you talking about.
Great reply.

I''ll try again:

I have an app that has a main dialog window, with a button that opens a second dialog window in which the user selects cards. The user then gets taken back to the main dialog window after card selection. But, there will be several more times when the user is taken back to the cards window to select more cards. The previously selected cards must be dis-enabled so he doesn''t choose the same card twice (that I know how to do).

How should I handle the card window after cards are selected? Do I minimize it? Hide it? I know I can''t destroy it, as data needs to be maintained for each visit to the cards window.

Any ideas?

Thanks,

Matt
You could also seperate the data from your dialog and pass a pointer to your data to the dialog''s constructor.
I would simply store an array of card states.. used/selected/picked or unused/unselected/not picked. Then, when you open the window each time, you can load this list and figure out which cards he''s able to pick. When he picks a new card, update the array, this way, you can close the window at any time (aka, they click the X) without having to call any function to store the info... and now you''re main app window can just use this array as well so there is no reason to leave the second window open when it''s not in use.
Oh, by the way, normally we just ignore AP''s (anonymous posters), they rarely have anything to contribute.
If I did close the cards window each time, would it slow things down too much if I have to redraw/reload all those card icons the next time cards are chosen?

Thanks alot,

Jim

quote:Original post by hatflyer
If I did close the cards window each time, would it slow things down too much if I have to redraw/reload all those card icons the next time cards are chosen?

Thanks alot,

Jim



Depends on how often you need this done. If it''s very common, might as well juts hide it, if it''s only once in a while, better to un-allocate the memory and re-load it when needed (most likely the icon''s, etc will still be in cache, so loading shouldn''t take long at all).
Final Q;

How would you create the second card (dialog) window?

I was using something like:

PickCards.DoModal();

when the Cards button in the main dialog window was clicked.

Is it better to create the second cards window a different way to have more control?

Thanks,

Jim

This topic is closed to new replies.

Advertisement