Game Development Community

C++ Dialog Boxes 'Browse'

by Richard Fox · in Technical Issues · 07/07/2003 (6:52 am) · 5 replies

I accidently put this in the General Discussions forum, so I moved it here...

I made a really cool Tetris game... Okay maybe that's not the best way to lead in for my very first post, but hey, I'm really proud of my accomplishment. :)
No, but seriuosly, it IS cool. I coded it so that the user can create his/her own tileset to be used for the game and the program arranges everything based on the size of the game blocks. i.e. everything fits, no matter what size game block the use decides to use (following some simple rules of course, like the block has to be evenly divisible by 2 and should be at least 24x24)
Anyway, currently, you have to copy the custom tilesets into my 'images' folder to use them and then start the game. I want to create a dialog box that tells it which folder to look in for the tileset, and then adjust the window for the new tileset. I guess a "Browse" button or a drop down list of folders would work. Oh, and I'm not using MFC. I have no problem with message boxes with buttons, I just can't figure out how to put a list in one and then use the info from the list. ANY help would be greatly appreciated.

Another cool thing about my Tetris game. It uses transparency so you can create odd shaped pieces like doughnuts, hearts, piles of dung or whatever. The coolest part though is how it does it. I didn't want to save another tileset mask, so it creates the mask on start up. It makes a blank bitmap the same size as the tileset and then puts a white pixel whereever there is a black pixel, and a black pixel whever there is a color(non black) one. I'm sure this isn't so startling of an achievement to some of the more experienced game programmers, but I was really proud to come up with the idea on my own. The only draw back is that is slows down the startup process. But I plan to put a splash screen up sooner or later.

#1
07/07/2003 (8:51 am)
You could use the SHBrowseForFolder function, this will bring up the common dialog for browsing folders.

big things come from little steps :)
#2
07/07/2003 (10:35 am)
Is that a function like the MessageBox() function, and/or do I need to #include anything else to use it? I'm at work right now, so I can't explore this just yet. My MSDN library won't install, scratchy disk. So, I can't even look up the function there.
Thanks for your help.
#3
07/07/2003 (10:44 am)
Http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shbrowseforfolder.asp

I just moved flats but if I can find my code backup CDs I'll post a few examples of use. I usually used it with MFC but its all pretty much the same with or without. You just need to supply it with the right arguements and its fine.
#4
07/07/2003 (12:47 pm)
Thanks, I've been getting all my programming experience from books like "Isometric Game Programming with DX7" by Ernest Pazera and "Tricks of the Windows Game Programming Gurus" by Andre Lamothe. Both are really great books and I am able to at least get a window program going and set it up for a game, but a lot of other Windows things I want to know just aren't in those books. They also seem to shy away from using MFC. Which is something I've seen quite a bit in the game programming books and such. #include WIN_32_LEAN_AND_MEAN // no MFC is something I see very often. I think that's how it is written. I haven't looked at the top part of my tetrisgame.cpp file in a long time.
Anyway, I guess where I going with this babble is I will need some more windows oriented knowledge to make things such as map editors for my isometric games. So, where are the best places to find this stuff?
#5
07/07/2003 (1:58 pm)
The only reason I learned MFC was because we had a course on it at uni, ever since then I've used it for any Windows programs I need to write because it totally takes the hassle out of making user-interfaces. For games its not too handy though because it can put a lot in the way of what you're trying to get done. Its not really designed for games use, mostly for interfaces and applications.

but for MFC and Windows programming titbits, I usually try,

http://msdn.microsoft.com/
and
http://www.codeproject.com/ <--- ultra fantastico site :)

Although codeproject is more MFC it's got some good win32 programming stuff as well. Can't stress how many times that site has saved me in the past with all its articles :) If I remember rightly there's a good article on gamedev.net about making a MFC map editor.