Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Menus and dialogs

Author
Message
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 24th Mar 2005 09:49
Hey there

In my tile editor today I decided I would like to add a menu (file, edit, help, etc - you know the kind) to my editors window.
It took me a while, but eventually (thanks in no small part to APEXnow from the irc channel!) we got it sussed!

I now have a nice menu ^^ Then after some reading on msdn I figured out how to use custom dialogs and stuff and now have lovely options/settings dialogs for setting up map variables and also for configuring the editor enviorment - im really pleased with ^^

If anyone is interested I have no problem with writing up a simple short artical on how to implement these things alongside darkSDK ^^

Anyway onto my question and ONLY problem. When I open a dialog window or cycle through my menus, the drawing region of my screen (the part belonging to darkSDK()) goes blue! the colour of the 3d backdrop. Everything stops drawing basically, my map doesnt render or anything like that. It looks really.. well, dumb. If I ever shipped my editor with the game then, well it doesnt disturb functionality but it does look really unprofessional :/ I'm wondering if anyone knows a way around this? Perhaps one of you fellas who wrote a gui dll for darkbasic pro encountered a simular a problem?

I could live with it not updating the screen as long as the last frame drawn remained there rather than it going a silly blue and being an obvious glitch.

Any help here appreiciated ^^ Thanks!

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 24th Mar 2005 10:12
Try putting dbSync() in your window procedure, where you handle the opening of menus and stuff. Or something..


"Lets migrate like bricks" - Me
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 24th Mar 2005 16:10
Quote: "When I open a dialog window or cycle through my menus"

Are you sub-classing your menus or trying to tie them into the main window.

I believe you have to sub-class as your new menus and whatnot have to have their own messaging pump.

Visit http://homepages.nildram.co.uk/~nickk/
Questions are a burden to others, answers a prison for oneself.
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 24th Mar 2005 20:54
Menus / dialogs were sub-classed and had their own message handling routines ^^

but your two replies helped tons and I have now fixed it This is my first ever time using the windows messenging pump so I didnt know all the messages you can recive etc, but a quick search on msdn revealed what i was looking for, WM_PAINT. I moved my map / gui rendering into a function called PaintScreen(); then in my message handler look for WM_PAINT and call it in there, everything now works perfeeeeeeeeeeeeectly!

thankyou ^_^

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 24th Mar 2005 22:43
*bows*


"Lets migrate like bricks" - Me
Beavis
21
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 25th Mar 2005 22:25
Can you put some sample code? I need also make some menus but i'm lost

--------
Beavis
http://www.progress-studio.com
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 27th Mar 2005 11:32
sure i will write something simple up (not right now, its 2:30am lol)
i'll make a post when i have written it ^^

it will be based on visual c++ 6 though, okay? Its all I have and I dont know how to use other resource editors ;;;;;

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Beavis
21
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 29th Mar 2005 20:49
Don't you forget about sample?

--------
Beavis
http://www.progress-studio.com
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 30th Mar 2005 11:08
just to let you know i have been writing the article on implementing menus and dialogs with darkSDK for the past 3 or 4 hours XD My fingers hurt T_T Its not finished yet, but nearly there.

13 pages so far including source code, but I have tried to make it as easy and pleasent to read as possiable. I have a friend proof re-reading and sentance restructuring as I go so I hope it comes out okay for you guys ^^ Will submit it when its done and checked over for errors ^^

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 31st Mar 2005 06:10
Should be good

Visit http://homepages.nildram.co.uk/~nickk/
Questions are a burden to others, answers a prison for oneself.
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 31st Mar 2005 15:16
its getting there XD only one, maybe two chapters left to write.

Are people happy with me providing it in pdf format? I have been writing it in open office and it exports pdf's very well, it seems to be the best format for keeping my formating and styles as well as being something that *everyone* should be able to open - so is that cool? ^^

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 12th Apr 2005 23:08
No problem, I am using Open Office too and I always give out the exported pdfs

Now,.. You want some bucks (PayPal) or do you provide the pdf for downloading? ( Or do I miss the link??? )

Sephnroth, I am really interested in your "instructions" because
I was left with the feeling that things like WindowDialogs will break the dgSDK app. So your pdf would be just GREAT

Maybe you can provide it to TGC for implementing in the update of the dgSDK??

Kind regards,
Smithy / DaByte

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++; Delphi; ADSL;
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 13th Apr 2005 07:16
Hey

Its nearly finished ^^ Im sorry about the huge delay, it should of been done dayyyyyyyyyyys ago. The first problem was a ton of friends i haddnt seen in like half a year because they all left for uni and stuff came back for an extended easter break and basically moved into my house XD It was great to see them whilst they were here, but it meant I got nothing done When they left, i then became ill rofl. Nothing serious, just a little bug. The worst thing it did to me was knock my sleep patterns out of kilter, waking up at odd hours and falling asleep at even odder hours XD Nearly stablised now.

Oh wow no I would never charge for something like this! It never occured to me that I even could o.O But not, its free. Communities like this rely on the generosity of others to survive, providing free or exceptionally low cost material of -all- kinds to each other allowing everyone to devlop and grow whilst obtaining stuff that would usually be far out of reach. But rofl.. if you reallllllllly like the tutorial and want to donate I do have paypal XD

haha, read it first.

Everything about menu's is now written (complete with screenshots! ) and i now have to write a chapter or two about dialogs and the kinda funky stuff you can do with them. When its done and proof read I will notify everyone in this post, might make a fresh post here for it too. I will -try- and reallllllly finish it tomorrow, just hope I dont get sidetracked XD

Thanks for the interest in it ^^

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Beavis
21
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 13th Apr 2005 18:32
In new version of SDK there will be new functions for simple implementation of menu. I have quick look on beta and I think that it will be easy task.

--------
Beavis
http://www.progress-studio.com
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 13th Apr 2005 19:12
Ohhhhh, so Sephnroth did the article for "nothing"??? Too bad

Well, on the other hand, it's good to know that they implement such a system as I think it is essentialy.

btw, Thanks for the info Mr.Beavis!


!--Smithy--!

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 13th Apr 2005 20:00
I tried to get into the beta files but i just get 404's. So i have no idea whats in this patch of theirs and how much of my tutorial is now redundent :/

Is it just menu's? How deep can you go with the menu's? Does it allow you to use the resource editor as well?
what about dialogs? Like full forms with all the components availiable?

My tutorial will cover all of this

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 13th Apr 2005 20:02
Anyway, I am still interested in your tut/article...

//Pentium IV 3200E/Prescott; 800Mhz FSB; Hyperthreading; WinXP Pro (!XP2); ATI R9700PRO; 1024MB RAM (2x 512MB "DualChanneled"; VC++ 6.0; Delphi; ADSL;
Beavis
21
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 14th Apr 2005 15:45
Not exactly menu, but there are new functions like :
dbOverrideHWND( HWND hWnd );
ConstructorDisplay();

I dont have time yet to test it because I have some problems with beta, but I think that there will be possibile to implement DGSDK window into normal application (MFC,...).

--------
Beavis
http://www.progress-studio.com
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 14th Apr 2005 17:51
that will be interesting as MFC programs arnt allowed to #include windows.h which the darkSDK does and i presume needs - this is why i had to go the route of the winapi in the first place. To make it MFC compliant it would be like needing a seperate SDK o.O

But theres very much sound like helper functions as aposed to contruction functions.

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 16th Apr 2005 20:08
Quote: "because I have some problems with beta"

What problems are you having? I've found that a fair few have been renamed, and dbExitPrompt does... nothing...

Visit http://homepages.nildram.co.uk/~nickk
Bill Nighy - The Doctor for me...
Beavis
21
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 18th Apr 2005 17:11
In 5.8 there is changes in DBO format, and I cant load dbo files exported from giles, so cant fully test my project under new beta until fix in giles. Author of giles works on new exporter, so I'm waiting now.

--------
Beavis
http://www.progress-studio.com
Artus
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: France
Posted: 19th Apr 2005 01:45
Quote: "dbExitPrompt does... nothing..."


Instead, you can use:

::MessageBox(0,"Little text to display","The caption", MB_OK);

if you use MB_YESNO or MB_OKCANCEL.. instead of MB_OK, you can ask for confirmation (returns IDYES, IDNO, IDOK, IDCANCEL etc..)

Example:

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 19th Apr 2005 16:53
Quote: "::MessageBox(0,"Little text to display","The caption", MB_OK);"

Yes, I know - but dbExitPrompt should work. Oh and you only need the :: if your using C++

Login to post a reply

Server time is: 2024-11-18 23:50:09
Your offset time is: 2024-11-18 23:50:09