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 / Visual C++ Forms with GDK

Author
Message
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th Nov 2010 00:42
What I am trying to do is this:

1. Design a form with gadgets in it. These gadgets will interact with the main display window for GDK. ie. typing something into a text box will tell the program when its entered to scroll some message across the screen.

2. Open up another borderless window and move it to another monitor. This window will display all of Dark GDK's stuff.

I've been bouncing across the forums trying to figure this out and VC++ and its form designer is they way I'd like to go.

Even if I could get a skeleton program with a button to make the screen flash would be a great start.

Warning! May contain Nuts!
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 13th Nov 2010 13:25 Edited at: 13th Nov 2010 13:49
It looks like you need either to buy the Dark GDK .NET version, or learn Windows API programming. The forms designer is related with .NET.

There was somewhere a thread which described compiling Dark GDK appliations into DLL and then merging it with a .NET application but I can't find it now. In any case it's easier to just get the Dark GDK .NET product.

With Windows API, you can integrate the Dark GDK (C++) program with any Windows GUI element, create separate dialog windows, etc. But you need to use an external resource editor to design the dialog boxes and you can prepare for slow progress if you don't know the API already.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 20th Nov 2010 03:16
I've started using ResEdit but VC++ Express blocks the Add Resource. Is there any way around this or am I missing something?

Warning! May contain Nuts!
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 20th Nov 2010 15:14
Add the resource file as "existing item". You need to add also the header file. I'm using ResEdit too and the compilation works, once you put both files into the project.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 23rd Nov 2010 00:10
Excellent stuff now. Although DGDK has it's own window at least I can do all my controls now through a dialogue. It's nice to know I can click in another window and get DGDK to swap in real time it's functions without having to spawn another process and go about it long winded. I'll get something basic finished and post it (how I do that I'll figure it out) so anyone else can it helpful.

Warning! May contain Nuts!
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 23rd Nov 2010 04:10
Just in case anyone is interested take a look here at modeless dialogues.

Warning! May contain Nuts!
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Nov 2010 13:03
http://forum.thegamecreators.com/?m=forum_view&t=152825&b=22

this might help you, messy but can be easily be re-written

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 23rd Nov 2010 17:13 Edited at: 23rd Nov 2010 20:59
Hi Hassan, by the time I read your message I'd made a start on implementing a modeless window. I had a good look through the link you gave me by Mista. Very long piece of code. :-(

I started out approx 20 years ago on the Atari and Amiga 68000 asm and C programming. I've done odd and sods of windows api and stuck with basic for years. C++ amd classess put me back.

Getting back into it because of the Dark GDK C seems to be strong as usual. The windows api programming is just like any libraries you build up yourself over time. There's tons of resources out there I've looked through and found them invaluable. Sometimes I feel like a noob all over again but its sinking in.

I have found that everything has to be stuck inside the main loop in a GDK api apart from initialising code but that ain't a problem. Just getting the message handling to work now on a modeless dialogue while the 3D is still running in the background. I may have to setup some kind of timer function just in case I can't handle all the windows messages.

"winapistuff.h"


"Main.cpp"


So far this will open a modeless dialogue (I'm hoping I've done everything right). It has two buttons on it, "Pause" and "Continue". As you can see in the winapistuff.h file, the global variable "app_pause" is set to TRUE or FALSE on a click of a buttong in the dialogue.

Currently here I am unsure yet where to put in my code the TranslateMessage and DispatchMessage calls.

Has anyone got any pointers as to were I am upto...

Warning! May contain Nuts!

Attachments

Login to view attachments
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Nov 2010 06:23
I just finished v1.0 of a GUI engine/editor. Take a look:
http://forum.thegamecreators.com/?m=forum_view&t=178271&b=22

The fastest code is the code never written.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 26th Nov 2010 08:41
Quote: "I had a good look through the link you gave me by Mista. Very long piece of code. :-("


you don't need to read the whole code, it includes too many stuff that you dont need (or at least, for now), just follow the program's flow and see how to merge the gdk window with the winapi, the whole point is in dbOverrideWindow() function, see how it works and how he used it

sorry for late reply, i don't really view this forum too much often nowadays

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 28th Nov 2010 22:17
Hey Hawkblood. I was also working on something similar sometime ago but then I needed to put everything into a seperate window and also onto another screen display. Mine wasn't as in depth as yours though.

Hassan, it seems the OverrideWindow function is what I am looking for. I have managed to get GDKs window borderless and my modeless window working with all kinds of gadgets now. The only gadget I am missing now is the Timer one. I'll see what I come up with after having another nosey through that long piece of code. Cheers guys...

Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-06-30 10:32:27
Your offset time is: 2024-06-30 10:32:27