reformated gui editor and proposed eddtions.
by Michael Heining · in Torque Game Engine · 08/10/2002 (8:08 pm) · 2 replies
Ive been playing with the gui editor and here is what Ive got:
--------------------------------------------------------
//----------------------------------------------------------------
// Gui Editor
// Initial Development as provided
// Updated capability and interface
// by Michael "MadWizard" Heining
//
// * New Menu bar and organization
// 5 Aug 2002 Michael "MadWizard" Heining
//
//----------------------------------------------------------------
new GuiControlProfile (BackFillProfile)
{
opaque = true;
fillColor = "0 94 94";
border = true;
borderColor = "255 128 128";
fontType = "Arial";
fontSize = 12;
fontColor = "0 0 0";
fontColorHL = "32 100 100";
fixedExtent = true;
justify = "center";
};
new GuiControl(GuiEditorGui) // Defines the entire gui window
{ profile = GuiDefaultProfile;
position = "0 0";
extent = "800 600";
helpPage = "3. Gui Editor"; // help page for this gui
new GuiControl() // green background in viewing screen
{ profile = "BackFillProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "800 600"; // wide=800 high=600 (good!!!)
};
new GuiControl(GuiEditorContent) // the view window
{ profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "600 480";
};
new GuiEditCtrl(GuiEditor)
{ profile = "GuiTextEditProfile"; // so it's tab able
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "600 480";
};
new GuiFrameSetCtrl() // right frame for tree and exam
{ profile = "GuiButtonProfile";
horizSizing = "width";
vertSizing = "height";
position = "600 0";
extent = "225 640";
columns = "0";
rows = "0 300";
//---------------------------------------------------------
// Tree View
// Shows components of the GUI in Tree form
//---------------------------------------------------------
new GuiScrollCtrl()
{ profile = "GuiScrollProfile";
position = "0 0";
extent = "160 300";
horizSizing = "width";
vertSizing = "height";
vScrollBar = "alwaysOn";
hScrollBar = "dynamic";
new GuiTreeViewCtrl(GuiEditorTreeView)
{ profile = "GuiTreeViewProfile";
position = "0 0";
horizSizing = "width";
};
};
//----------------------------------------
// Inspector
// Allows user to see values of attributes of the
// component selected.
//----------------------------------------
new GuiControl()
{ profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "295 300";
new GuiButtonCtrl ()
{ profile = "GuiButtonSmProfile";
position = "6, 16";
extent = "40 16";
font = "12 252 Arial";
fontHL = "12 253 Arial";
text = "APPLY";
command = "GuiEditorInspectApply();";
fillColor = "249";
borderColor = "249";
selectBorderColor = "255";
};
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "52 4";
extent = "30 16";
font = "12 244 Arial";
text = "Name:";
};
new GuiTextEditCtrl (GuiEditorInspectName)
{ profile = "GuiTextEditProfile";
position = "84 3";
extent = "72 18";
text = "";
horizSizing = "width";
vertSizing = "bottom";
};
new GuiScrollCtrl() // scrill box for control inspector
{ profile = "GuiScrollProfile";
position = "0 24";
extent = "290 276";
horizSizing = "width";
vertSizing = "height";
vScrollBar = "alwaysOn";
hScrollBar = "alwaysOff";
new GuiInspector (GuiEditorInspectFields) // inspector
{ profile = "GuiDefaultProfile";
position = "0 0";
extent = "400 0";
horizSizing = "width";
vertSizing = "bottom";
};
};
};
};
//----------------------------------------
// Tool Bar
//----------------------------------------
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "height";
position = "0 465";
extent = "600 135";
// ---------------------------------------
// NEW,SAVE,HELP
// ---------------------------------------
new GuiButtonCtrl ()
{ profile = "GuiButtonSmProfile";
position = "4 5";
extent = "40 25";
text = "New...";
command = "GuiEditorStartCreate();";
};
new GuiButtonCtrl () {
profile = "GuiButtonSmProfile";
position = "46 5";
extent = "40 25";
text = "Save";
command = "GuiEditorSaveGui();";
};
new GuiButtonCtrl ("GuiEditorButtonToggle") {
profile = "GuiButtonSmProfile";
position = "88 5";
extent = "40 25";
text = "Help";
command = "getHelp(\"3. Gui Editor\");";
};
// ---------------------------------------
// ALIGNMENT CONTROLS
// ---------------------------------------
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "135 7";
extent = "35 20";
font = "12 244 Arial";
text = "Align";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "172 5";
extent = "40 25";
text = "Top";
command = "GuiEditor.Justify(3);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "130 35";
extent = "40 25";
text = "Left";
command = "GuiEditor.Justify(0);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "172 35";
extent = "40 25";
text = "Center";
command = "GuiEditor.Justify(1);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "214 35";
extent = "40 25";
text = "Right";
command = "GuiEditor.Justify(2);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "172 65";
extent = "40 25";
text = "Bottom";
command = "GuiEditor.Justify(4);";
};
// ---------------------------------------
// SPACE
// ---------------------------------------
new GuiTextCtrl() // lable
{ profile = "GuiTextProfile";
position = "260 7";
extent = "35 20";
font = "12 244 Arial";
text = "Space";
};
new GuiButtonCtrl () // vert button
{ profile = "GuiButtonSmProfile";
position = "298 5";
extent = "40 25";
text = "Vert";
command = "GuiEditor.Justify(5);";
};
new GuiButtonCtrl() // horiz button
{ profile = "GuiButtonSmProfile";
position = "340 5";
extent = "40 25";
text = "Horiz";
command = "GuiEditor.Justify(6);";
};
// ---------------------------------------
// FRONT/BACK
// ---------------------------------------
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "260 37";
extent = "35 20";
font = "12 244 Arial";
text = "Layer";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "298 35";
extent = "40 25";
text = "Front";
command = "GuiEditor.BringToFront();";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "340 35";
extent = "40 25";
text = "Back";
command = "GuiEditor.PushToBack();";
};
// ---------------------------------------
// SELECTORS
// ---------------------------------------
new GuiControlListPopup(GuiEditorClassPopup) // LIST CONTROLS
{ profile = "GuiEditorClassProfile";
position = "4 35";
extent = "122 25";
};
new GuiPopUpMenuCtrl(GuiEditorContentList) // LIST GUI'S
{ profile = "GuiPopUpMenuProfile";
position = "4 65";
extent = "122 25";
};
};
};
//----------------------------------------
// New Gui Dialog
//----------------------------------------
new GuiControl(NewGuiDialog)
{
profile = "GuiDialogProfile";
position = "0 0";
extent = "200 180";
new GuiWindowCtrl()
{
profile = "GuiWindowProfile";
position = "220 146";
extent = "200 180";
text = "Create new GUI";
canMove = "false";
canClose = "false";
canMinimize = "false";
canMaximize = "false";
horizSizing = "center";
vertSizing = "center";
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "20 28";
text = "GUI Name:";
};
new GuiTextEditCtrl(NewGuiDialogName)
{ profile = "GuiTextEditProfile";
position = "20 44";
extent = "160 20";
};
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "20 68";
text = "Class:";
};
new GuiControlListPopup(NewGuiDialogClass)
{ profile = "GuiControlListPopupProfile";
position = "20 84";
extent = "160 20";
};
new GuiButtonCtrl()
{ profile = "GuiButtonProfile";
position = "56 156";
extent = "40 16";
text = "Create";
command = "GuiEditorCreate();";
};
new GuiButtonCtrl()
{ profile = "GuiButtonProfile";
position = "104 156";
extent = "40 16";
text = "Cancel";
command = "Canvas.popDialog(NewGuiDialog);";
};
};
};
//----------------------------------------
function GuiEditorStartCreate()
{
NewGuiDialogClass.setText("GuiControl");
NewGuiDialogClass.sort();
NewGuiDialogName.setValue("NewGui");
Canvas.pushDialog(NewGuiDialog);
}
//----------------------------------------
function GuiEditorCreate()
{
%name = NewGuiDialogName.getValue();
%class = NewGuiDialogClass.getText();
Canvas.popDialog(NewGuiDialog);
%obj = eval("return new " @ %class @ "(" @ %name @ ");");
GuiEditorOpen(%obj);
}
//----------------------------------------
function GuiEditorSaveGui()
{
%obj = GuiEditorContent.getObject(0);
if(%obj == -1 || %obj.getName() $= "")
return;
%name = %obj.getName() @ ".gui";
getSaveFilename("*.gui", "GuiEditorSaveGuiCallback", %name);
}
function GuiEditorSaveGuiCallback(%name)
{
%obj = GuiEditorContent.getObject(0);
%obj.save(%name);
}
//----------------------------------------
function GuiEdit(%val)
{
if(%val != 0)
return;
%content = Canvas.getContent();
if(%content == GuiEditorGui.getId())
{
//GlobalActionMap.bind(mouse, button1, mouselook);
%obj = GuiEditorContent.getObject(0);
if(%obj != -1)
{
GuiGroup.add(%obj);
Canvas.setContent(%obj);
}
GlobalActionMap.unbind( keyboard, "delete" );
}
else
{
//GlobalActionMap.unbind(mouse, button1);
GuiEditorOpen(%content);
}
}
//----------------------------------------
function GuiEditorOpen(%content)
{
Canvas.setContent(GuiEditorGui);
while((%obj = GuiEditorContent.getObject(0)) != -1)
GuiGroup.add(%obj); // get rid of anything being edited
%i = 0;
GuiEditorContentList.clear();
while((%obj = GuiGroup.getObject(%i)) != -1)
{
if(%obj.getName() !$= Canvas)
{
if(%obj.getName() $= "")
%name = "(unnamed) - " @ %obj;
else
%name = %obj.getName() @ " - " @ %obj;
GuiEditorContentList.add(%name, %obj);
}
%i++;
}
GuiEditorContent.add(%content);
GuiEditorContentList.sort();
GuiEditorClassPopup.sort();
if(%content.getName() $= "")
%name = "(unnamed) - " @ %content;
else
%name = %content.getName() @ " - " @ %content;
GuiEditorContentList.setText(%name);
GuiEditorClassPopup.setText("New Control");
GuiEditor.setRoot(%content);
%content.resize(0,0,640,480);
GuiEditorTreeView.open(%content);
}
//----------------------------------------
function GuiEditorContentList::onSelect(%this, %id)
{
GuiEditorOpen(%id);
}
//----------------------------------------
function GuiEditorClassPopup::onSelect(%this, %id)
{
%class = %this.getText();
%obj = eval("return new " @ %class @ "();");
GuiEditor.addNewCtrl(%obj);
GuiEditorClassPopup.setText("New Control");
}
//----------------------------------------
function GuiEditorTreeView::onSelect(%this, %obj, %rightMouse)
{
if(%rightMouse)
GuiEditor.setCurrentAddSet(%obj);
else
{
GuiEditorInspectFields.inspect(%obj);
GuiEditorInspectName.setValue(%obj.getName());
GuiEditor.select(%obj);
}
}
//----------------------------------------
function GuiEditorInspectApply()
{
GuiEditorInspectFields.apply(GuiEditorInspectName.getValue());
}
//----------------------------------------
function GuiEditor::onSelect(%this, %ctrl)
{
GuiEditorInspectFields.inspect(%ctrl);
GuiEditorInspectName.setValue(%ctrl.getName());
GuiEditor.select(%ctrl);
}
//----------------------------------------
function GuiEditorDeleteSelected( %val ) {
if( %val )
GuiEditor.deleteSelection();
}
GlobalActionMap.bind(keyboard, "f10", GuiEdit);
--------------------------------------------------------
Ive reformetted the editor and added comments to the script. I was thinking that it could use some more functionality. Like the ability to addthe gui to the selector, or maybe the ability to call up help for any of the controls... id appreciate help here...
--------------------------------------------------------
//----------------------------------------------------------------
// Gui Editor
// Initial Development as provided
// Updated capability and interface
// by Michael "MadWizard" Heining
//
// * New Menu bar and organization
// 5 Aug 2002 Michael "MadWizard" Heining
//
//----------------------------------------------------------------
new GuiControlProfile (BackFillProfile)
{
opaque = true;
fillColor = "0 94 94";
border = true;
borderColor = "255 128 128";
fontType = "Arial";
fontSize = 12;
fontColor = "0 0 0";
fontColorHL = "32 100 100";
fixedExtent = true;
justify = "center";
};
new GuiControl(GuiEditorGui) // Defines the entire gui window
{ profile = GuiDefaultProfile;
position = "0 0";
extent = "800 600";
helpPage = "3. Gui Editor"; // help page for this gui
new GuiControl() // green background in viewing screen
{ profile = "BackFillProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "800 600"; // wide=800 high=600 (good!!!)
};
new GuiControl(GuiEditorContent) // the view window
{ profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "600 480";
};
new GuiEditCtrl(GuiEditor)
{ profile = "GuiTextEditProfile"; // so it's tab able
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "600 480";
};
new GuiFrameSetCtrl() // right frame for tree and exam
{ profile = "GuiButtonProfile";
horizSizing = "width";
vertSizing = "height";
position = "600 0";
extent = "225 640";
columns = "0";
rows = "0 300";
//---------------------------------------------------------
// Tree View
// Shows components of the GUI in Tree form
//---------------------------------------------------------
new GuiScrollCtrl()
{ profile = "GuiScrollProfile";
position = "0 0";
extent = "160 300";
horizSizing = "width";
vertSizing = "height";
vScrollBar = "alwaysOn";
hScrollBar = "dynamic";
new GuiTreeViewCtrl(GuiEditorTreeView)
{ profile = "GuiTreeViewProfile";
position = "0 0";
horizSizing = "width";
};
};
//----------------------------------------
// Inspector
// Allows user to see values of attributes of the
// component selected.
//----------------------------------------
new GuiControl()
{ profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "295 300";
new GuiButtonCtrl ()
{ profile = "GuiButtonSmProfile";
position = "6, 16";
extent = "40 16";
font = "12 252 Arial";
fontHL = "12 253 Arial";
text = "APPLY";
command = "GuiEditorInspectApply();";
fillColor = "249";
borderColor = "249";
selectBorderColor = "255";
};
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "52 4";
extent = "30 16";
font = "12 244 Arial";
text = "Name:";
};
new GuiTextEditCtrl (GuiEditorInspectName)
{ profile = "GuiTextEditProfile";
position = "84 3";
extent = "72 18";
text = "";
horizSizing = "width";
vertSizing = "bottom";
};
new GuiScrollCtrl() // scrill box for control inspector
{ profile = "GuiScrollProfile";
position = "0 24";
extent = "290 276";
horizSizing = "width";
vertSizing = "height";
vScrollBar = "alwaysOn";
hScrollBar = "alwaysOff";
new GuiInspector (GuiEditorInspectFields) // inspector
{ profile = "GuiDefaultProfile";
position = "0 0";
extent = "400 0";
horizSizing = "width";
vertSizing = "bottom";
};
};
};
};
//----------------------------------------
// Tool Bar
//----------------------------------------
new GuiControl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "height";
position = "0 465";
extent = "600 135";
// ---------------------------------------
// NEW,SAVE,HELP
// ---------------------------------------
new GuiButtonCtrl ()
{ profile = "GuiButtonSmProfile";
position = "4 5";
extent = "40 25";
text = "New...";
command = "GuiEditorStartCreate();";
};
new GuiButtonCtrl () {
profile = "GuiButtonSmProfile";
position = "46 5";
extent = "40 25";
text = "Save";
command = "GuiEditorSaveGui();";
};
new GuiButtonCtrl ("GuiEditorButtonToggle") {
profile = "GuiButtonSmProfile";
position = "88 5";
extent = "40 25";
text = "Help";
command = "getHelp(\"3. Gui Editor\");";
};
// ---------------------------------------
// ALIGNMENT CONTROLS
// ---------------------------------------
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "135 7";
extent = "35 20";
font = "12 244 Arial";
text = "Align";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "172 5";
extent = "40 25";
text = "Top";
command = "GuiEditor.Justify(3);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "130 35";
extent = "40 25";
text = "Left";
command = "GuiEditor.Justify(0);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "172 35";
extent = "40 25";
text = "Center";
command = "GuiEditor.Justify(1);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "214 35";
extent = "40 25";
text = "Right";
command = "GuiEditor.Justify(2);";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "172 65";
extent = "40 25";
text = "Bottom";
command = "GuiEditor.Justify(4);";
};
// ---------------------------------------
// SPACE
// ---------------------------------------
new GuiTextCtrl() // lable
{ profile = "GuiTextProfile";
position = "260 7";
extent = "35 20";
font = "12 244 Arial";
text = "Space";
};
new GuiButtonCtrl () // vert button
{ profile = "GuiButtonSmProfile";
position = "298 5";
extent = "40 25";
text = "Vert";
command = "GuiEditor.Justify(5);";
};
new GuiButtonCtrl() // horiz button
{ profile = "GuiButtonSmProfile";
position = "340 5";
extent = "40 25";
text = "Horiz";
command = "GuiEditor.Justify(6);";
};
// ---------------------------------------
// FRONT/BACK
// ---------------------------------------
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "260 37";
extent = "35 20";
font = "12 244 Arial";
text = "Layer";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "298 35";
extent = "40 25";
text = "Front";
command = "GuiEditor.BringToFront();";
};
new GuiButtonCtrl()
{ profile = "GuiButtonSmProfile";
position = "340 35";
extent = "40 25";
text = "Back";
command = "GuiEditor.PushToBack();";
};
// ---------------------------------------
// SELECTORS
// ---------------------------------------
new GuiControlListPopup(GuiEditorClassPopup) // LIST CONTROLS
{ profile = "GuiEditorClassProfile";
position = "4 35";
extent = "122 25";
};
new GuiPopUpMenuCtrl(GuiEditorContentList) // LIST GUI'S
{ profile = "GuiPopUpMenuProfile";
position = "4 65";
extent = "122 25";
};
};
};
//----------------------------------------
// New Gui Dialog
//----------------------------------------
new GuiControl(NewGuiDialog)
{
profile = "GuiDialogProfile";
position = "0 0";
extent = "200 180";
new GuiWindowCtrl()
{
profile = "GuiWindowProfile";
position = "220 146";
extent = "200 180";
text = "Create new GUI";
canMove = "false";
canClose = "false";
canMinimize = "false";
canMaximize = "false";
horizSizing = "center";
vertSizing = "center";
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "20 28";
text = "GUI Name:";
};
new GuiTextEditCtrl(NewGuiDialogName)
{ profile = "GuiTextEditProfile";
position = "20 44";
extent = "160 20";
};
new GuiTextCtrl()
{ profile = "GuiTextProfile";
position = "20 68";
text = "Class:";
};
new GuiControlListPopup(NewGuiDialogClass)
{ profile = "GuiControlListPopupProfile";
position = "20 84";
extent = "160 20";
};
new GuiButtonCtrl()
{ profile = "GuiButtonProfile";
position = "56 156";
extent = "40 16";
text = "Create";
command = "GuiEditorCreate();";
};
new GuiButtonCtrl()
{ profile = "GuiButtonProfile";
position = "104 156";
extent = "40 16";
text = "Cancel";
command = "Canvas.popDialog(NewGuiDialog);";
};
};
};
//----------------------------------------
function GuiEditorStartCreate()
{
NewGuiDialogClass.setText("GuiControl");
NewGuiDialogClass.sort();
NewGuiDialogName.setValue("NewGui");
Canvas.pushDialog(NewGuiDialog);
}
//----------------------------------------
function GuiEditorCreate()
{
%name = NewGuiDialogName.getValue();
%class = NewGuiDialogClass.getText();
Canvas.popDialog(NewGuiDialog);
%obj = eval("return new " @ %class @ "(" @ %name @ ");");
GuiEditorOpen(%obj);
}
//----------------------------------------
function GuiEditorSaveGui()
{
%obj = GuiEditorContent.getObject(0);
if(%obj == -1 || %obj.getName() $= "")
return;
%name = %obj.getName() @ ".gui";
getSaveFilename("*.gui", "GuiEditorSaveGuiCallback", %name);
}
function GuiEditorSaveGuiCallback(%name)
{
%obj = GuiEditorContent.getObject(0);
%obj.save(%name);
}
//----------------------------------------
function GuiEdit(%val)
{
if(%val != 0)
return;
%content = Canvas.getContent();
if(%content == GuiEditorGui.getId())
{
//GlobalActionMap.bind(mouse, button1, mouselook);
%obj = GuiEditorContent.getObject(0);
if(%obj != -1)
{
GuiGroup.add(%obj);
Canvas.setContent(%obj);
}
GlobalActionMap.unbind( keyboard, "delete" );
}
else
{
//GlobalActionMap.unbind(mouse, button1);
GuiEditorOpen(%content);
}
}
//----------------------------------------
function GuiEditorOpen(%content)
{
Canvas.setContent(GuiEditorGui);
while((%obj = GuiEditorContent.getObject(0)) != -1)
GuiGroup.add(%obj); // get rid of anything being edited
%i = 0;
GuiEditorContentList.clear();
while((%obj = GuiGroup.getObject(%i)) != -1)
{
if(%obj.getName() !$= Canvas)
{
if(%obj.getName() $= "")
%name = "(unnamed) - " @ %obj;
else
%name = %obj.getName() @ " - " @ %obj;
GuiEditorContentList.add(%name, %obj);
}
%i++;
}
GuiEditorContent.add(%content);
GuiEditorContentList.sort();
GuiEditorClassPopup.sort();
if(%content.getName() $= "")
%name = "(unnamed) - " @ %content;
else
%name = %content.getName() @ " - " @ %content;
GuiEditorContentList.setText(%name);
GuiEditorClassPopup.setText("New Control");
GuiEditor.setRoot(%content);
%content.resize(0,0,640,480);
GuiEditorTreeView.open(%content);
}
//----------------------------------------
function GuiEditorContentList::onSelect(%this, %id)
{
GuiEditorOpen(%id);
}
//----------------------------------------
function GuiEditorClassPopup::onSelect(%this, %id)
{
%class = %this.getText();
%obj = eval("return new " @ %class @ "();");
GuiEditor.addNewCtrl(%obj);
GuiEditorClassPopup.setText("New Control");
}
//----------------------------------------
function GuiEditorTreeView::onSelect(%this, %obj, %rightMouse)
{
if(%rightMouse)
GuiEditor.setCurrentAddSet(%obj);
else
{
GuiEditorInspectFields.inspect(%obj);
GuiEditorInspectName.setValue(%obj.getName());
GuiEditor.select(%obj);
}
}
//----------------------------------------
function GuiEditorInspectApply()
{
GuiEditorInspectFields.apply(GuiEditorInspectName.getValue());
}
//----------------------------------------
function GuiEditor::onSelect(%this, %ctrl)
{
GuiEditorInspectFields.inspect(%ctrl);
GuiEditorInspectName.setValue(%ctrl.getName());
GuiEditor.select(%ctrl);
}
//----------------------------------------
function GuiEditorDeleteSelected( %val ) {
if( %val )
GuiEditor.deleteSelection();
}
GlobalActionMap.bind(keyboard, "f10", GuiEdit);
--------------------------------------------------------
Ive reformetted the editor and added comments to the script. I was thinking that it could use some more functionality. Like the ability to addthe gui to the selector, or maybe the ability to call up help for any of the controls... id appreciate help here...
About the author
#2
08/11/2002 (7:35 pm)
Eric, right click on an object and it will be surrounded with a green square... now every new control you place will be placed inside that object...
Torque 3D Owner Eric Forhan
I think my two major issues w/the standard GUI are that there could be more workspace room (moveable editor windows?), and that adding new windows/controls could make a bit more sense. It would be nice if it were like the game editor, where you can highlight what group you wish the object be put under... and it actually puts it there. :-)
Edit: BTW, his file is GuiEditorGui.gui