DragDropGui Control
by Stefan Beffy Moises · 04/07/2004 (12:47 pm) · 60 comments
This gui was originally written by Jarred Schnelle (Jafa Rykos) in 2003 and I have updated it to work with the current HEAD and to show the functionality in a little demo gui...
The demo gui artwork was kindly provided by Timothy Aste, www.gremlinstudios.com - thanks dude!
Please note: this is not a working inventory system, it's only the fancy gui/frontend part of it...
any inventory or whatever logic has to be implemented by the user... :-)
The zip contains a readme file, the source files, images as well as a patch file so that you don't have to make the necessary changes manually if you don't want to...
Here is what it looks like:
tork.beffy.de/images/remository_pics/dragdrop.jpg
and here is a little video showing it in action:
tork.beffy.de/downloads/videos/dragdrop1.avi (~1 MB, DivX 5.05)
Since the file is too large for the resource, you can grab it
here.
Have a lot of fun! :-)
The demo gui artwork was kindly provided by Timothy Aste, www.gremlinstudios.com - thanks dude!
Please note: this is not a working inventory system, it's only the fancy gui/frontend part of it...
any inventory or whatever logic has to be implemented by the user... :-)
The zip contains a readme file, the source files, images as well as a patch file so that you don't have to make the necessary changes manually if you don't want to...
Here is what it looks like:
tork.beffy.de/images/remository_pics/dragdrop.jpg
and here is a little video showing it in action:
tork.beffy.de/downloads/videos/dragdrop1.avi (~1 MB, DivX 5.05)
Since the file is too large for the resource, you can grab it
here.
Have a lot of fun! :-)
#42
08/22/2007 (3:01 pm)
Just got this implemented in TGEA 1.02 and want to express my Thanks to the creators of the resource as well as those who ported it to TGEA (Ted and Andrea) - works great!
#43
10/11/2007 (7:12 am)
should note the texture-loss in tgea conversion can be fixed by changing the entries for the GFXDefaultRenderTargetProfile to GFXDefaultGUIProfile (to elaborate on that, if it looks like your gui has started shifting to the side, or drawing the wrong button after you alt-tab, that's liable to be the culprit)
#44
12/06/2007 (9:06 pm)
Excellent resource! I just followed the readme and in about 10 minutes got it working perfectly in 1.5.2. Thanks again to the author!
#45
first of all, great job Stefan!
For my needs, I required to have an array of 676 of this handy little controls in a neat little grid. problem was, that only 128 of them would work. If you need to have hordes of them like me just do this:
in GuiControl.cc and GuiControl.h there is a variable 'DragDropArray' (after implementing this resource)
it's value is 128. this means that the guiDragDropButtonCtrl will only look for 128 slots.
Ctrl-F and look for these entries (you can just look for '128')
change '128' to a higher number, like 1024 and rebuild.
-mike
03/06/2008 (3:50 pm)
--------------------------------MORE SLOTS!!------------------------------------first of all, great job Stefan!
For my needs, I required to have an array of 676 of this handy little controls in a neat little grid. problem was, that only 128 of them would work. If you need to have hordes of them like me just do this:
in GuiControl.cc and GuiControl.h there is a variable 'DragDropArray' (after implementing this resource)
it's value is 128. this means that the guiDragDropButtonCtrl will only look for 128 slots.
Ctrl-F and look for these entries (you can just look for '128')
change '128' to a higher number, like 1024 and rebuild.
-mike
#46
04/09/2008 (11:20 am)
Has anyone tried using this with TGEA recently? Vince Gee's link above is dead, unfortunately.
#47
04/28/2008 (2:39 pm)
Working fine in TGEA 1.0.2 but i cannot make it work in 1.7 :S
#48
http://www.sokyuu.es/recursos/dragydrop.rar
05/03/2008 (12:14 pm)
I've done on porting it into 1.7. here i let you the pack with the instructions, the script files, the new engine files and, if you have your engine clean and don't want to follow the structions, i've added also the gui/core files ready to go ;Phttp://www.sokyuu.es/recursos/dragydrop.rar
#49
guiDragDropButtonCtrl.obj : error LNK2001: unresolved external symbol "public: static unsigned int * GuiControl::DragDropArray" (?DragDropArray@GuiControl@@2PAIA)
05/13/2008 (12:01 am)
In Visual Studio 2005, Eros, I get this Linker Error:guiDragDropButtonCtrl.obj : error LNK2001: unresolved external symbol "public: static unsigned int * GuiControl::DragDropArray" (?DragDropArray@GuiControl@@2PAIA)
#50
05/13/2008 (12:27 am)
Weird... I did a re-build of the project and the linker error auto-magically solved itself... go figure.
#51
How do you open 2 and drag items from one to another ?
06/17/2008 (11:28 am)
This works great with one exception:How do you open 2 and drag items from one to another ?
#52
It only reverts to the plant on hover when I click to drag it is food.
I looked at the onMouseEnter routine in the code and it says the bitmap is food but still displays plant.
anyone have an idea here?
06/22/2008 (9:20 am)
Another little bugger here. I use this as a dialog to make something in game. Drag a plant to the control, hit a button < magic happens > the plant is converted to food. I change the bitmap from a plant icon to a food icon but when I hover over the now food icon to drag it to inventory it changes back to the plant.It only reverts to the plant on hover when I click to drag it is food.
I looked at the onMouseEnter routine in the code and it says the bitmap is food but still displays plant.
anyone have an idea here?
#53
Any quick work around for this ?
06/26/2008 (10:49 am)
Another fun bug if I have a ddbutton on a pane and another one on a different pane located in the same place then set one pane inactive or not visible then drag to the visible one it actually drags to the invisible one.Any quick work around for this ?
#54
I want to use this in a manner that is similar to the problem you have described and would like to make sure it works properly or see if I have to do some work in fixing this up a bit.
08/03/2008 (4:42 pm)
Howard- did you ever find a solution for your problem? I want to use this in a manner that is similar to the problem you have described and would like to make sure it works properly or see if I have to do some work in fixing this up a bit.
#55
The 2 windows drag one to the other works if you use the modal flag but still doesn't highlight properly.
The showing the proper graphic was solved by copying the bitmap to the button AND the hover
The button position being the same only in different panes was solved by using different windows
So no real resolution just more band aids...
08/03/2008 (6:28 pm)
Which one Ron?The 2 windows drag one to the other works if you use the modal flag but still doesn't highlight properly.
The showing the proper graphic was solved by copying the bitmap to the button AND the hover
The button position being the same only in different panes was solved by using different windows
So no real resolution just more band aids...
#56
08/05/2008 (2:40 pm)
Well Howard I was referring to the issue with the layered bitmaps with one set as not visible. I tried the modal flag and it had no effect. Are you using TGE or TGEA? I am using TGEA.
#57
For the layered bitmaps I am not sure what the answer is.
I was going to try a couple different things as follows:
When a layer is NOT active, move the box to some location off the window. So when you activate a layer move that one into position.
The other thing I was going to try was change the dropBorderType to a different name on the one you dont want it to hit.
Let me know if either works
08/06/2008 (3:52 pm)
I am using TGE. The modal flag (now depricated for some odd reason) would only work if you had seperate windows. For the layered bitmaps I am not sure what the answer is.
I was going to try a couple different things as follows:
When a layer is NOT active, move the box to some location off the window. So when you activate a layer move that one into position.
The other thing I was going to try was change the dropBorderType to a different name on the one you dont want it to hit.
Let me know if either works
#58
It works great and no bug issues.
08/06/2008 (3:58 pm)
Well for my needs I managed to just use seperate guis that open and close as you need them instead of the visibilty thing with the layers.It works great and no bug issues.
#59
I get this digital kick in the crotch when building the project:
error LNK2001: unresolved external symbol "public: virtual class AbstractClassRep * __thiscall GuiDragDropButtonCtrl::getClassRep(void)const " (?getClassRep@GuiDragDropButtonCtrl@@UBEPAVAbstractClassRep@@XZ)
C++ isn't my strong suit. Anyone have a clue how to resolve that beast?
08/17/2008 (9:08 pm)
I was unable to get this working with Eros' code under TGEA+AFX 1.7.1.I get this digital kick in the crotch when building the project:
error LNK2001: unresolved external symbol "public: virtual class AbstractClassRep * __thiscall GuiDragDropButtonCtrl::getClassRep(void)const " (?getClassRep@GuiDragDropButtonCtrl@@UBEPAVAbstractClassRep@@XZ)
C++ isn't my strong suit. Anyone have a clue how to resolve that beast?
#60
I am very new to TGE 1.4. I dont how to patch a GUI. Any body can help me out??
Basically I want to patch a DragnDrop GUI to my engine. Thank u all in advanced..
12/04/2008 (3:34 am)
Hi All...I am very new to TGE 1.4. I dont how to patch a GUI. Any body can help me out??
Basically I want to patch a DragnDrop GUI to my engine. Thank u all in advanced..

Torque Owner Kirk Longendyke