Game Development Community

Script Classes/ Gui Classes

by Nathan Bowhay - ESAL · in Torque 3D Professional · 04/25/2011 (12:23 pm) · 1 replies

I am running into a bug where I can't set a superclass and class for one of my controls. The error I am getting is:

Error: cannot change namespace parent linkage of GuiControlGroupClass from GuiControl to GuiFieldHorizonalResizeGroupClass.

My control is:
new GuiControl(TestControl) {
   position = "152 133";
   extent = "264 18";
   minExtent = "8 2";
   horizSizing = "width";
   vertSizing = "top";
   profile = "GuiDefaultProfile";
   visible = "1";
   active = "1";
   Clickable = "1";
   AffectChildren = "1";
   tooltipProfile = "GuiToolTipProfile";
   hovertime = "1000";
   isContainer = "1";
   class = "GuiControlGroupClass";
   superClass = "GuiFieldHorizonalResizeGroupClass";
   canSave = "1";
   canSaveDynamicFields = "1";
      setCommand = "TestControl.myVar = %value;";
   
   new GuiTextEditCtrl() {
      historySize = "0";
      password = "0";
      tabComplete = "0";
      sinkAllKeyEvents = "0";
      passwordMask = "*";
      text = "";
      maxLength = "1024";
      Margin = "0 0 0 0";
      Padding = "0 0 0 0";
      AnchorTop = "1";
      AnchorBottom = "0";
      AnchorLeft = "1";
      AnchorRight = "0";
      isContainer = "0";
      Profile = "GuiTextEditProfile";
      HorizSizing = "right";
      VertSizing = "bottom";
      position = "0 0";
      Extent = "49 18";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      tooltipprofile = "GuiToolTipProfile";
      hovertime = "1000";
      canSaveDynamicFields = "0";
   };
   new GuiTextEditCtrl() {
      historySize = "0";
      password = "0";
      tabComplete = "0";
      sinkAllKeyEvents = "0";
      passwordMask = "*";
      text = "";
      maxLength = "1024";
      Margin = "0 0 0 0";
      Padding = "0 0 0 0";
      AnchorTop = "1";
      AnchorBottom = "0";
      AnchorLeft = "1";
      AnchorRight = "0";
      isContainer = "0";
      Profile = "GuiTextEditProfile";
      HorizSizing = "right";
      VertSizing = "bottom";
      position = "0 0";
      Extent = "49 18";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      tooltipprofile = "GuiToolTipProfile";
      hovertime = "1000";
      canSaveDynamicFields = "0";
   };
   new GuiTextEditCtrl() {
      historySize = "0";
      password = "0";
      tabComplete = "0";
      sinkAllKeyEvents = "0";
      passwordMask = "*";
      text = "";
      maxLength = "1024";
      Margin = "0 0 0 0";
      Padding = "0 0 0 0";
      AnchorTop = "1";
      AnchorBottom = "0";
      AnchorLeft = "1";
      AnchorRight = "0";
      isContainer = "0";
      Profile = "GuiTextEditProfile";
      HorizSizing = "right";
      VertSizing = "bottom";
      position = "0 0";
      Extent = "49 18";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      tooltipprofile = "GuiToolTipProfile";
      hovertime = "1000";
      canSaveDynamicFields = "0";
   };
};

I suppose an explanation isn't really needed, but GuiControlGroupClass groups the 3 controls so that you can get and set the value on all 3 so something like x, y, z. It will also check all 3 any time one is changed and setCommand replacing %value with the value. GuiFieldHorizonalResizeGroupClass simply uses onWake and onResize to position and re-size the children to be the same with the parent group.

I use the superclass GuiFieldHorizonalResizeGroupClass several times all are of type GuiControl so I know that isn't the issue. Some that also have the class GuiControlGroupClass and some that have none. Same goes for the class GuiControlGroupClass I use it in some guis with no super class and some with the superclass GuiFieldHorizonalResizeGroupClass.

Anyone have an idea of what exactly is causing this issue? I know it can't link it because it is already being used as a parent/child class in some other order, but the way in which this is handled is still a little confusing to me, experimentally since it is a per instance feature.

#1
04/25/2011 (3:37 pm)
After changing some stuff around I think I figured it out a bit. If you have 3 objects: 1, 2 and 3

1 can be superClass = "ClassA"; and class = "ClassB";. 2 can be superClass = "ClassA" only (no class), but object 3 can't be class = "ClassB"; with also being superClass = "ClassA";.