mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-28 16:41:01 +00:00
Add 2d value types
- TypePoint2F and TypePoint2I now display as multi dimensional
This commit is contained in:
parent
22f8e46288
commit
f127b084ce
|
|
@ -2093,6 +2093,100 @@ bool GuiInspectorType4DValue::updateRects()
|
|||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// TypePoint2F GuiInspectorField Class
|
||||
//-----------------------------------------------------------------------------
|
||||
IMPLEMENT_CONOBJECT(GuiInspectorTypePoint2F);
|
||||
|
||||
ConsoleDocClass(GuiInspectorTypePoint2F,
|
||||
"@brief Inspector field type for Point2F\n\n"
|
||||
"Editor use only.\n\n"
|
||||
"@internal"
|
||||
);
|
||||
void GuiInspectorTypePoint2F::consoleInit()
|
||||
{
|
||||
Parent::consoleInit();
|
||||
|
||||
ConsoleBaseType::getType(TypePoint2F)->setInspectorFieldType("GuiInspectorTypePoint2F");
|
||||
}
|
||||
|
||||
GuiControl* GuiInspectorTypePoint2F::constructEditControl()
|
||||
{
|
||||
GuiStackControl* retCtrl = new GuiStackControl();
|
||||
|
||||
if (retCtrl == NULL)
|
||||
return retCtrl;
|
||||
|
||||
mCaptionLabel = new GuiTextCtrl();
|
||||
mCaptionLabel->registerObject();
|
||||
mCaptionLabel->setControlProfile(mProfile);
|
||||
mCaptionLabel->setText(mCaption);
|
||||
addObject(mCaptionLabel);
|
||||
|
||||
mDimensionLabelX = new GuiTextCtrl();
|
||||
mDimensionLabelX->registerObject();
|
||||
mDimensionLabelX->setControlProfile(mProfile);
|
||||
mDimensionLabelX->setText("X");
|
||||
addObject(mDimensionLabelX);
|
||||
|
||||
mDimensionLabelY = new GuiTextCtrl();
|
||||
mDimensionLabelY->registerObject();
|
||||
mDimensionLabelY->setControlProfile(mProfile);
|
||||
mDimensionLabelY->setText("Y");
|
||||
addObject(mDimensionLabelY);
|
||||
|
||||
retCtrl->setDataField(StringTable->insert("profile"), NULL, "ToolsGuiDefaultProfile");
|
||||
retCtrl->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
|
||||
retCtrl->setDataField(StringTable->insert("stackingType"), NULL, "Vertical");
|
||||
retCtrl->setDataField(StringTable->insert("dynamicSize"), NULL, "1");
|
||||
retCtrl->setDataField(StringTable->insert("padding"), NULL, "3");
|
||||
|
||||
_registerEditControl(retCtrl);
|
||||
|
||||
constructEditControlChildren(retCtrl, getWidth());
|
||||
|
||||
char szBuffer[512];
|
||||
dSprintf(szBuffer, 512, "setClipboard(%d.getText() SPC %d.getText());", mCtrlX->getId(), mCtrlY->getId());
|
||||
mCopyButton->setField("Command", szBuffer);
|
||||
addObject(mCopyButton);
|
||||
|
||||
dSprintf(szBuffer, 512, "%d.apply(getWords(getClipboard(), 0, 1));", getId());
|
||||
mPasteButton->setField("Command", szBuffer);
|
||||
addObject(mPasteButton);
|
||||
|
||||
mUseHeightOverride = true;
|
||||
mHeightOverride = retCtrl->getHeight() + 16 + 6;
|
||||
|
||||
return retCtrl;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// TypePoint2I GuiInspectorField Class
|
||||
//-----------------------------------------------------------------------------
|
||||
IMPLEMENT_CONOBJECT(GuiInspectorTypePoint2I);
|
||||
|
||||
ConsoleDocClass(GuiInspectorTypePoint2I,
|
||||
"@brief Inspector field type for Point2I\n\n"
|
||||
"Editor use only.\n\n"
|
||||
"@internal"
|
||||
);
|
||||
void GuiInspectorTypePoint2I::consoleInit()
|
||||
{
|
||||
Parent::consoleInit();
|
||||
|
||||
ConsoleBaseType::getType(TypePoint2I)->setInspectorFieldType("GuiInspectorTypePoint2I");
|
||||
}
|
||||
|
||||
GuiControl* GuiInspectorTypePoint2I::constructEditControl()
|
||||
{
|
||||
GuiControl* retCtrl = Parent::constructEditControl();
|
||||
|
||||
mCtrlX->setDataField(StringTable->insert("format"), NULL, "%d");
|
||||
mCtrlY->setDataField(StringTable->insert("format"), NULL, "%d");
|
||||
|
||||
return retCtrl;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// TypePoint3F GuiInspectorField Class
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -2162,7 +2256,7 @@ GuiControl* GuiInspectorTypePoint3F::constructEditControl()
|
|||
addObject(mPasteButton);
|
||||
|
||||
mUseHeightOverride = true;
|
||||
mHeightOverride = retCtrl->getHeight();
|
||||
mHeightOverride = retCtrl->getHeight() + 6;
|
||||
|
||||
return retCtrl;
|
||||
}
|
||||
|
|
@ -2237,7 +2331,7 @@ GuiControl* GuiInspectorTypeMatrixRotation::constructEditControl()
|
|||
addObject(mPasteButton);
|
||||
|
||||
mUseHeightOverride = true;
|
||||
mHeightOverride = retCtrl->getHeight();
|
||||
mHeightOverride = retCtrl->getHeight() + 6;
|
||||
|
||||
return retCtrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -652,6 +652,32 @@ public:
|
|||
virtual bool updateRects();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// TypePoint2F GuiInspectorField Class
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class GuiInspectorTypePoint2F : public GuiInspectorType2DValue
|
||||
{
|
||||
private:
|
||||
typedef GuiInspectorType2DValue Parent;
|
||||
public:
|
||||
DECLARE_CONOBJECT(GuiInspectorTypePoint2F);
|
||||
static void consoleInit();
|
||||
virtual GuiControl* constructEditControl();
|
||||
};
|
||||
|
||||
class GuiInspectorTypePoint2I : public GuiInspectorTypePoint2F
|
||||
{
|
||||
private:
|
||||
typedef GuiInspectorTypePoint2F Parent;
|
||||
public:
|
||||
DECLARE_CONOBJECT(GuiInspectorTypePoint2I);
|
||||
static void consoleInit();
|
||||
virtual GuiControl* constructEditControl();
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// TypePoint3F GuiInspectorField Class
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue