Game Development Community

[Bug 1.1Beta] GUI Editor

by Peter K · in Torque 3D Professional · 02/14/2010 (5:43 am) · 20 replies

Not a Major bug but in the GUI Editor the "send to front" and "send to back" buttons both tooltip as send to back. The function seems to work correctly for send to front but I did have to think for a second if I was pressing the correct button from memory :)

#1
02/16/2010 (11:55 pm)
I would like to add another GUI editor bug. If you choose "Revert GUI" from the File menu, you wind up in an endless dialog loop if you keep clicking "OK" to confirm that you want the action to take place. You have to finally click "Cancel" to get the GUI to revert and the dialog to close.
#2
02/18/2010 (4:44 pm)

@Peter
Fixed. Thanks for reporting.

@Netwyrm
This must be the day of the gui-editor-bugs-that-avoid-me-like-the-plague...

Could not reproduce this on both Mac and Windows.

Is this always happening for you? If not, are there reproducible steps leading to this behavior?
#3
02/18/2010 (7:44 pm)
Hi Rene, sorry not to answer more quickly.

I have only used "Revert" once, ever. The result was to lock up and go into the loop described until, very much desiring not to crash out and lose the changes I had made, clicked "Cancel" in desperation and it got me out of the loop.

I reported it because a lot of GUI bugs seem to be cropping up in this new version... I put up a report so if anyone else runs into it they can say "Me too" at least, or perhaps glean that hitting "Cancel" is the way out.

I could pull something similar out of this morning's session but I suspect it would be difficult to reproduce as well--I tapped Cntrl-S to save after cloning ~six more shapes through the drag-shift method and the program began to insist that I "Save As..." rather than save, by giving the dialog to save the mission under a new name repeatedly, until I decided to do just that.

Then I went into the project folder and looked at the original .mis file and the new one. The only difference appeared to be the addition of the new objects, so I renamed the "new" file as the old one and fired back up again, and everything worked--I wasn't able to trigger the insistence that I save under a new name again no matter what I did--I just hadn't done anything other than I have done dozens of time in the past.
#4
02/18/2010 (7:54 pm)
Revert "might" pop up dialogue boxes for each revision made since original/last save.
#5
02/20/2010 (12:29 am)
Whenever I use the "send to back" button or use the same function from the drop down menu my GUI editor automatically crashes. Has anyone else seen this?

In the demo version I had before recently purchasing my license this feature worked fine.
#6
02/20/2010 (7:52 am)

@Netwyrm
I will do my best looking into this though unfortunately spurious runtime errors with no clear reproduction steps are really hard to pinpoint.

Due to a number of core GUI code changes, there have been a number of instabilities and inconsistencies in the GUI framework, but the changes are stabilizing. Here things are already rather stable and smoothly running though the first beta probably is somewhere in the middle of the transition.

@fire513
I cannot reproduce this here on my end. Could you try running in a debug build and posting the stack trace of the crash? This would be most helpful.
#7
02/20/2010 (10:44 am)

@Rene I hope this is the information that you need.

i921.photobucket.com/albums/ad51/joelectric/gg/GUIerror.jpg
> 513_DEBUG.dll!SimSet::front() Line 91 + 0x1a bytes C++
513_DEBUG.dll!SimSet::bringObjectToFront(SimObject * obj=0x141959f8) Line 146 + 0x14 bytes C++
513_DEBUG.dll!GuiEditCtrl::pushToBack() Line 1390 C++
513_DEBUG.dll!cm_GuiEditCtrl_pushToBack(GuiEditCtrl * object=0x05156278, int argc=2, const char * * argv=0x114bd3c8) Line 2515 C++
513_DEBUG.dll!cm_GuiEditCtrl_pushToBack_caster(SimObject * object=0x05156278, int argc=2, const char * * argv=0x114bd3c8) Line 2512 + 0x65 bytes C++
513_DEBUG.dll!CodeBlock::exec(unsigned int ip=8, const char * functionName=0x00000000, Namespace * thisNamespace=0x00000000, unsigned int argc=0, const char * * argv=0x00000000, bool noCalls=false, const char * packageName=0x00000000, int setFrame=-1) Line 1708 + 0x20 bytes C++
513_DEBUG.dll!CodeBlock::compileExec(const char * fileName=0x00000000, const char * inString=0x051530c5, bool noCalls=false, int setFrame=0) Line 648 C++
513_DEBUG.dll!Con::evaluate(const char * string=0x051530c5, bool echo=false, const char * fileName=0x00000000) Line 975 C++
513_DEBUG.dll!GuiControl::evaluate(const char * str=0x051530c5) Line 1957 + 0xd bytes C++
513_DEBUG.dll!GuiControl::execConsoleCallback() Line 1966 + 0x17 bytes C++
513_DEBUG.dll!GuiControl::onAction() Line 1712 C++
513_DEBUG.dll!GuiButtonBaseCtrl::onAction() Line 349 C++
513_DEBUG.dll!GuiBitmapButtonCtrl::onAction() Line 303 C++
513_DEBUG.dll!GuiButtonBaseCtrl::onMouseUp(const GuiEvent & event={...}) Line 232 C++
513_DEBUG.dll!GuiCanvas::rootMouseUp(const GuiEvent & event={...}) Line 994 C++
513_DEBUG.dll!GuiCanvas::processMouseEvent(InputEventInfo & inputEvent={...}) Line 688 C++
513_DEBUG.dll!GuiCanvas::processInputEvent(InputEventInfo & inputEvent={...}) Line 461 + 0x1e bytes C++
513_DEBUG.dll!WindowInputGenerator::generateInputEvent(InputEventInfo & inputEvent={...}) Line 75 + 0x16 bytes C++
513_DEBUG.dll!WindowInputGenerator::handleMouseButton(unsigned int did=0, unsigned int modifiers=0, unsigned int action=2, unsigned short button=0) Line 198 C++
513_DEBUG.dll!fastdelegate::FastDelegate4<unsigned int,unsigned int,unsigned int,unsigned short,void>::operator()(unsigned int p1=0, unsigned int p2=0, unsigned int p3=2, unsigned short p4=0) Line 1245 + 0x27 bytes C++
513_DEBUG.dll!Signal<void __cdecl(unsigned int,unsigned int,unsigned int,unsigned short)>::trigger(unsigned int a=0, unsigned int b=0, unsigned int c=2, unsigned short d=0) Line 359 + 0x24 bytes C++
513_DEBUG.dll!Journal::Call<Signal<void __cdecl(unsigned int,unsigned int,unsigned int,unsigned short)>,unsigned int,unsigned int,unsigned int,unsigned short>(Signal<void __cdecl(unsigned int,unsigned int,unsigned int,unsigned short)> * obj=0x03d43ca0, void (unsigned int, unsigned int, unsigned int, unsigned short)* method=0x105f15aa, unsigned int a=0, unsigned int b=0, unsigned int c=2, unsigned short d=0) Line 535 + 0xc1 bytes C++
513_DEBUG.dll!JournaledSignal<void __cdecl(unsigned int,unsigned int,unsigned int,unsigned short)>::trigger(unsigned int a=0, unsigned int b=0, unsigned int c=2, unsigned short d=0) Line 133 + 0x1f bytes C++
513_DEBUG.dll!_dispatch(HWND__ * hWnd=0x000a02d6, unsigned int message=514, unsigned int wParam=0, unsigned int lParam=721672) Line 291 C++
513_DEBUG.dll!DispatchNext() Line 565 + 0x15 bytes C++
513_DEBUG.dll!Win32WindowManager::_process() Line 294 + 0x5 bytes C++
513_DEBUG.dll!fastdelegate::FastDelegate0<void>::operator()() Line 905 + 0x16 bytes C++
513_DEBUG.dll!Signal<void __cdecl(void)>::trigger() Line 315 + 0x13 bytes C++
513_DEBUG.dll!Process::processEvents() Line 78 C++
513_DEBUG.dll!StandardMainLoop::doMainLoop() Line 543 + 0x5 bytes C++
513_DEBUG.dll!torque_enginetick() Line 103 + 0x5 bytes C++
513_DEBUG.dll!TorqueMain(int argc=2, const char * * argv=0x00cfdc60) Line 369 + 0x5 bytes C++
513_DEBUG.dll!torque_winmain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * __formal=0x00000000, char * lpszCmdLine=0x00151f2d, HINSTANCE__ * __formal=0x00000000) Line 423 + 0x17 bytes C++
513_DEBUG.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpszCmdLine=0x00151f2d, int nCommandShow=1) Line 47 + 0x16 bytes C++
513_DEBUG.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
513_DEBUG.exe!WinMainCRTStartup() Line 182 C
kernel32.dll!7c816d4f()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
kernel32.dll!7c8399f3()
#8
02/20/2010 (11:10 am)

That's perfect. Thanks for the dump.

What's very fishy is that apparently the editor is trying to push a GuiControl to the back of itself.

Please replace GuiEditCtrl::pushToBack() in guiEditCtrl.cpp with the following and retry:

void GuiEditCtrl::pushToBack()
{
   if( getNumSelected() != 1 )
      return;

   GuiControl* ctrl = mSelectedControls.first();
   ctrl->getParent()->bringObjectToFront( ctrl );
}
#9
02/20/2010 (1:24 pm)
That fixed it!. Thanks for the help. Do you know why this was giving me problems and not anybody else? I have not made any changes to the source code except for what you mentioned above. Once again thanks for the quick help.
#10
02/20/2010 (7:13 pm)

The problem is the add set handling in the Gui Editor code (plus the fact that bringToFront and pushToBack were implemented in a very odd way). I've cleaned that up completely.

In your case, it seems to have triggered because the control you were reordering was a container (isContainer=true) thus causing the selection set to coincide with the add set.

Anyways, this should all be fixed for good and rollout in the next beta.

//Edit:
Many thanks for reporting and especially for the helpful dump you posted.
#11
02/20/2010 (7:19 pm)
@Rene.. Should this also be applied to bringToFront? The code looks the same as pushToBack. I have not tried it yet just curious.

Thanks
#12
02/20/2010 (7:21 pm)

Yes, I've changed it to look like this:

void GuiEditCtrl::bringToFront()
{
   if( getNumSelected() != 1 )
      return;

   GuiControl* ctrl = mSelectedControls.first();
   ctrl->getParent()->pushObjectToBack( ctrl );
}
#13
02/20/2010 (7:23 pm)
Wow..That was quick!! Thanks Rene..

edit: Good one fire513!!
#14
02/20/2010 (8:34 pm)
Thanks for the help! Glad I could assist in squashing a bug.
#15
02/21/2010 (12:10 pm)
Something else that is causing me issues is creating new profiles from the GUI editor. I can create a new profile such as a new text color and it will work fine. I save the profile and the GUI, I press F10 and everything looks perfect. However whenever I go to play my game the changes are not there and when I go back and open the GUI the new profile is completely gone. Almost like changes are not made to the gameProfile.cs script as shown in the GUI tutorial.
#16
02/21/2010 (1:34 pm)
The problem is that the Gui Editor is by default saving to a file that is not executed at start-up (scripts/gui/profiles.cs). I'll change this default to save in customProfiles.cs.

You can do this yourself by settings $GUI_EDITOR_DEFAULT_PROFILE_FILENAME in guiEditorProfiles.ed.cs accordingly:

$GUI_EDITOR_DEFAULT_PROFILE_FILENAME = "art/gui/customProfiles.cs";

Alternatively, explicitly save the profiles to a different file or make sure scripts/gui/profiles.cs gets executed at startup.
#17
02/21/2010 (1:50 pm)
Thanks for the fix. That was easy enough works perfect.
#18
04/04/2010 (11:34 am)
I am having trouble with this too... I think.

I am trying to work through the GUI tutorials in the online documentation. There is a Part there where it is suggested to "add a GuiPanelCtrl, resize it, and send to the back by pressing the tool bar Send To Back icon." I saw nothing called GuiPanelCtrl so I used GuiPanel, which crashed the program when I tried to send it to the back. I applied the above fix, but attempting to send it to the back still crashes the program. Other gui elements such as GuiBitMapCtrl seem to work fine.
#19
04/04/2010 (8:53 pm)

The Send to Back problem is definitely fixed for the next beta.

There's two controls with very similar (and both not too accurate) names: GuiPaneControl and GuiPanel. GuiPaneControl displays a header on top of its sole child where as GuiPanel simply renders a gradient in the background and has no other specific functionality.
#20
04/05/2010 (4:56 am)
Thanks so much for the info, Rene.