Game Development Community

T3D 1.1 Final - guiPopUpCtrlEx Bug Fixes - LOGGED (THREED-2231)

by Nathan Martin · in Torque 3D Professional · 07/22/2011 (9:44 am) · 1 replies

Build: 1.1 Final

Platform: Any

Target: GUI Controls

Issues:
  1. When using more than one column (inserting tabs 't' with the entry text), the left most column has garbage characters when it should be empty. --Fixed in Patch
  2. AddCategory() TorqueScript method still just inserts normal entries and therefore are unexpectedly selectable items. --Fixed in Patch
  3. When inserting an entry using colorbox code "|R|G|B" causes duplicate items to be inserted. --Fixed in Patch

Steps to Repeat:
%obj = guiPopUpCtrlEx;
  1. %obj.add("t<--That side should be empty, this side should not.");
  2. %obj.addCategory("My Category");
  3. %obj.add("Red option |255|0|0");


Suggested Fix:
I have created a patch file that fixes all these bug issues and then some:
guiPopUpCtrlEx_Fixes-20110722.patch

This patch additionally updates some of the DefineEngineMethod() usage comments and corrects a mistake of using the Highlight colors instead of the Not Active (disabled state) colors for category entry items as expected. Using HL instead of NA makes it confusing as they look like they've already been preselected when in fact they're not selectable at all.


Other Thoughts:
Explanation of only the bug fixes.
  1. Issue was fixed by setting returnbuff initially to zero to make it an empty string in getColumn():
  2. // Function to return the 'index' column from 'string' given delimeters in 'set'
    static const char *getColumn(const char *string, char* returnbuff, U32 index, const char *set)
    {
       U32 sz;
    
       // bugfix: make return buffer an emtpy string
       *returnbuff = 0;
    ...
  3. Issue was fixed by declaring a special negative entry id value of -5 using the enum item eGUI_PopupCtrlEx_Category and then going throughout the control's source code and replacing the original id checker value for category (-1) to the enum item as the -1 conflicting with the default entry id being used to identify what items to automatically assign a unique entry id with in void GuiPopUpMenuCtrlEx::addEntry().

  4. Issue was a rather simple yet difficult problem to track down and it was due to a missing else in %obj.add() ConsoleMethod(). I know that fix doesn't immediately make sense as to why it only showed up when using colorbox code "|R|G|B|", but then when you notice that the colorbox parser NULLs off the beginning of the colorbox so it won't show in the entry item text and that GuiPopUpMenuCtrlEx::addEntry() tries to prevent redundant entries, then it finally makes sense.

#1
07/22/2011 (9:54 am)
Thanks Nathan! I've logged a ticket under THREED-2231.