Author Topic: Brick Name Box : Child GUI Objects  (Read 1066 times)

Does anyone know the name of the Brick Name Box on the WrenchDlg GUI?
I've tried getting the names of the child objects on the GUI, but can't seem to get it working right.

Code: [Select]
function findSubGUI(%this,%name)
{  
   %gui = %this.findObjectByInternalName(%name,true);  
   return %gui;    
}

package ChildGUINames
{
   function WrenchDlg::onWake(%this,%name)
   {
      %brickName = findSubGUI();
      echo(" " @ %brickName @  " ");
      return Parent::onWake(%this,%name);
   }
};
activatePackage(ChildGUINames);
I only need the name of the Brick name Box ctrl object, but this function would be
useful for future GUI modification
« Last Edit: May 03, 2015, 07:55:42 PM by Goth77 »

You realize you're not passing findSubGUI any parameters, right?

Take a look in tree();
« Last Edit: May 04, 2015, 03:05:53 AM by boodals 2 »

Just use the gui editor ...?


Use the GUI editor, like Zeblote suggested.

Also, "findObjectByInternalName" does not exist as this version of Torque does not have internal names. Make sure that you look up TGE references, not T3D.

Also, "findObjectByInternalName" does not exist as this version of Torque does not have internal names.

No, but it's trivial to implement decently.

function SimSet::findObjectByInternalName(%this, %internalName) {
    %count = %this.getCount();

    for (%i = 0; %i < %count; %i++) {
        %object = %this.getObject(%i);
       
        if (%object.internalName $= %internalName) {
            return %object;
        }
       
        %result = %object.findObjectByInternalName(%internalName);

        if (%result) {
            return %result;
        }
    }

    return 0;
}
« Last Edit: May 04, 2015, 12:34:13 PM by portify »

Thanks, but I was pointing out that it doesn't exist by default. It's better to just give GUI objects an actual name.

No, but it's trivial to implement decently.

function SimSet::findObjectByInternalName(%this, %internalName) {
    %count = %this.getCount();

    for (%i = 0; %i < %count; %i++) {
        %object = %this.getObject(%i);
       
        if (%object.internalName $= %internalName) {
            return %object;
        }
       
        %result = %object.findObjectByInternalName(%internalName);

        if (%result) {
            return %result;
        }
    }

    return 0;
}

Amazing. Thanks much Port

Thanks, but I was pointing out that it doesn't exist by default. It's better to just give GUI objects an actual name.
Thanks for the screenshot Greek, helped more than you think.
I have never used the GUI editor, but I did use mission editor back in the day for terrain