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 / Codemaster's dilemma: A tale of Windows Forms, Homebrew GUI, and Dark GDK

Author
Message
code master
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 19th Mar 2014 17:42 Edited at: 19th Mar 2014 17:44
Hey there folks, I appreciate your time. Join me on a journey of programmatic, problematic road blocks, the twists and turns of one man's fight to develop.

My goal is to write an application that marries the DGDK 3D viewport with an extensive set of data entry controls. This software will serve a niche in 3D content work.

We start, humbly enough, with getting Dark GDK to work with Windows 8 and Visual Studio 2013. It was an arduous process, but I am happy to say I can now compile Dark GDK applications. (If you would like to hear more about this process, see the following thread: http://forum.thegamecreators.com/?m=forum_view&t=209733&b=22 )

Ah, good; much was accomplished. Now I began to write a User Interface. It starts simply, click-zones and button animations and even Event function hooks, all relatively a walk in the park. But then, Enter the text box, stage right. Suddenly there are entry buffers and timers and multiple function keys. I've got it flying along neatly now, but it was quite the workout for my fingers and mind.

All is well, still. Ah, but then! It suddenly dawns on me. Where is my drag and drop functionality? Drag and Drop was one of the core mechanics of my application in the design stage. I say, perhaps I can hook into the Windows API and intercept some sort of message that must be sent? That's well and good, except I don't know the first thing about the Windows API. Furthermore, Dark GDK clearly already hooks into said API. Where, and how, do I modify this default behavior?

I thought too, perhaps I can start all over and create a Windows API application from the beginning; throw out this needless Homebrew GUI; drop in some REAL WinForms. Ah, but again, I am not skilled in the use of the windows API. Not in the slightest.

My dear reader, I congratulate you on making it this far. I implore you for advice, anecdotes, sympathy, and solutions.

I thank you.


Timidon
18
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 19th Mar 2014 19:34 Edited at: 19th Mar 2014 19:42
There is a .net version of DGK as well. Might be more windows friendly?... I am working on a Homebew Gui as well. Adding List functions as I type.. today.

There are many answers but just one question" ~ Jerilith the Mad
code master
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 21st Mar 2014 21:41
Yes, there is! I did actually write a version of this application in DGDK .NET, at one point. I have spent much more time coding in C++ recently than Visual Basic, and I'm afraid my VB skills are a bit rusty. There is also the possibility of learning C#, which I hear is an excellent language. I suppose at this point in the application life cycle switching languages is not an efficient option.

How is your GUI progressing? I find it tedious work, but certainly good experience.

- Codemaster


Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 22nd Mar 2014 13:47 Edited at: 22nd Mar 2014 13:52
Drag and Drop isnt hard.
Just check if dbMouseClick is 1. Remind it somehow.
Check in the next frame (or after a short time) if dbMouseClick is still 1, if not, it's a single mouse click.
If yes, check the coordinates of the window border (or item icon, or what ever you want to do), if the mouse pos is in it, pick up the item icon / window.

Check for MouseClick is 0, if its not 0, still stick the icon / window to the cursor, if yes, check the mouse position for the destination.

I dont know if you want to use WinAPI stuff only, but GDK provides functions to make it easily working.

GUI / HUD programming is a pain in the ass, until you write a clean and good code. With a good code, it's very easy actually.
code master
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 24th Mar 2014 00:52
Ah, I understand. I wasn't clear. What I mean is drag and drop from Windows to my application. In practice, I would like to drag a file from Explorer onto my application and have the file loaded up to work with.

I concur with your comment about good code. I think that writing this GUI in C++ is much smoother than it would be to write it in Dark Basic or something else.


Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 27th Mar 2014 11:16
Maybe this helps?
http://anton.maurovic.com/posts/win32-api-approach-to-windows-drag-and-drop/

It's a wrapper for the WinAPI

Login to post a reply

Server time is: 2024-04-25 14:27:07
Your offset time is: 2024-04-25 14:27:07