Game Development Community

Issue with guiPopUpCtrl?

by Jacob · in Torque Game Engine Advanced · 07/29/2007 (8:39 am) · 1 replies

Has anyone else noticed that this control adds a scroll bar even if only one menu item is in the list? I thought it may be just something on my end but I checked with the TGEA water/terrain demo and in the options gui - display device menu where I have only one choice, still the vertical scroll bar is added.

In guiPopUpCtrl.cpp on @ line 591 is the code that tests whether a scroll bar should be added:

//Calc max Y distance, so Scroll Ctrl will fit on window
   S32 maxYdis = windowExt.y - pointInGC.y - mBounds.extent.y - menuSpace;

   //If scroll bars need to be added
   if(maxYdis < mTl->mBounds.extent.y + textSpace)

Here are the values for the variables:

windowExt.y = 600
pointInGC.y = 272
mBounds.extent.y = 18
menuSpace = 5
*maxYdis should equal to 305*

mTl->mBounds.extent.y = 17
textSpace = 2

... but for some reason maxYdis shows a value of -858993460 which obviously makes the test for scroll bars true, while if maxYdis had the correct value of 305, it would not make it true.

So, why is maxYdis showing this large negative number?

Thanks!

#1
07/29/2007 (9:48 am)
SOLUTION: the GuiPopUpMenuProfile had the borderThickness set at 2. Reducing this to 1 solved the issue.