Author Topic: Space Vertically And Space Horizontally  (Read 1187 times)

In the GUI Editor, what are the space vertically and space horizontally features supposed to do? They do nothing right now, as I think they're broken. But I'm fixing up the mission editor and I'd like to know what they're supposed to do, as I intend to fix those features.

They do work, actually. Select at least three controls (using shift+click). It will evenly space them.

I believe everything works in the GUI editor. While you're at it though, can you add a button next to "Center Horizontally" called "Center Vertically"? There's also a lot of console spam.
« Last Edit: July 21, 2014, 11:46:51 AM by Greek2me »

They do work, actually. Select at least three controls (using shift+click). It will evenly space them.

I believe everything works in the GUI editor. While you're at it though, can you add a button next to "Center Horizontally" called "Center Vertically"? There's also a lot of console spam.
No. None of the options in the Layout menu work except Bring to Front and Send to Back. I've also already added Center Vertically, fixed all the layout buttons except Space Vertically and Space Horizontally, and I've fixed all the console spam.

Edit to respond to your edit: Tried selecting three. Didn't do anything. Also, you can't do the shift select thing unless you manually set GuiEditorTreeView.allowMultipleSelections to true. This engine does even have much support for the tree control. You can't even detect if the client is holding down shift for multiple selections(there is however tons of support for it in Torque 3D).
« Last Edit: July 21, 2014, 12:56:10 PM by jes00 »

No, I use multiple selection all the time.

No, I use multiple selection all the time.
:/

Maybe it's because I have a Mac?

Anyways. Those buttons don't work for me. Do they work for you?

Oh, don't select them in the tree view. Shift+Click them on the GUI itself.

Oh, don't select them in the tree view. Shift+Click them on the GUI itself.
Oh. Good to know. Everything works now.

But perhaps I should still overwrite what I've done already? In my overwrites, I've simply made it align according to the parent, which in my opinion is a better way of doing it. What do you think? (I have not overwritten and don't plan to overwrite the two functions we've been discussing)

But perhaps I should still overwrite what I've done already? In my overwrites, I've simply made it align according to the parent, which in my opinion is a better way of doing it. What do you think? (I have not overwritten and don't plan to overwrite the two functions we've been discussing)

What do you mean?

What do you mean?
FYI. This all uses the tree.
Code: [Select]
function GuiEditor::alignLeft(%gui)
{
if(!isObject(%obj = %gui.getSelected()))
{
return;
}

if(!isObject(InspectStaticPosition0_18))
{
return;
}

InspectStaticPosition0_18.setText(0 SPC getWord(%obj.getPosition(), 1));
GuiEditorInspectApply();
}

function GuiEditor::alignRight(%gui)
{
if(!isObject(%obj = %gui.getSelected()))
{
return;
}

if(!isObject(%parent = %obj.getGroup()))
{
return;
}

if(!isObject(InspectStaticPosition0_18))
{
return;
}

InspectStaticPosition0_18.setText(firstWord(%parent.getExtent()) - firstWord(%obj.getExtent()) SPC getWord(%obj.getPosition(), 1));
GuiEditorInspectApply();
}

function GuiEditor::alignTop(%gui)
{
if(!isObject(%obj = %gui.getSelected()))
{
return;
}

if(!isObject(InspectStaticPosition0_18))
{
return;
}

InspectStaticPosition0_18.setText(firstWord(%obj.getPosition()) SPC 0);
GuiEditorInspectApply();
}

function GuiEditor::alignBottom(%gui)
{
if(!isObject(%obj = %gui.getSelected()))
{
return;
}

if(!isObject(%parent = %obj.getGroup()))
{
return;
}

if(!isObject(InspectStaticPosition0_18))
{
return;
}

InspectStaticPosition0_18.setText(firstWord(%obj.getPosition()) SPC getWord(%parent.getExtent(), 1) - getWord(%obj.getExtent(), 1));
GuiEditorInspectApply();
}

function GuiEditor::centerVert(%gui)
{
if(!isObject(%obj = %gui.getSelected()))
{
return;
}

if(!isObject(%parent = %obj.getGroup()))
{
return;
}

if(!isObject(InspectStaticPosition0_18))
{
return;
}

%desiredCenter = mRound(getWord(%parent.getExtent(), 1) / 2);
%currCenter = mRound(getWord(%obj.getPosition(), 1) + (getWord(%obj.getExtent(), 1) / 2));

if(%desiredCenter == %currCenter)
{
return;
}

if(%desiredCenter > %currCenter)
{
%offset = %desiredCenter - %currCenter;

InspectStaticPosition0_18.setText(firstWord(%obj.getPosition()) SPC getWord(%obj.getPosition(), 1) + %offset);
}

else
{
%offset = %currCenter - %desiredCenter;

InspectStaticPosition0_18.setText(firstWord(%obj.getPosition()) SPC getWord(%obj.getPosition(), 1) - %offset);
}

GuiEditorInspectApply();
}

function GuiEditor::centerHoriz(%gui)
{
if(!isObject(%obj = %gui.getSelected()))
{
return;
}

if(!isObject(%parent = %obj.getGroup()))
{
return;
}

if(!isObject(InspectStaticPosition0_18))
{
return;
}

%desiredCenter = mRound(firstWord(%parent.getExtent()) / 2);
%currCenter = mRound(firstWord(%obj.getPosition()) + (firstWord(%obj.getExtent()) / 2));

if(%desiredCenter == %currCenter)
{
return;
}

if(%desiredCenter > %currCenter)
{
%offset = %desiredCenter - %currCenter;

InspectStaticPosition0_18.setText(firstWord(%obj.getPosition()) + %offset SPC getWord(%obj.getPosition(), 1));
}

else
{
%offset = %currCenter - %desiredCenter;

InspectStaticPosition0_18.setText(firstWord(%obj.getPosition()) - %offset SPC getWord(%obj.getPosition(), 1));
}

GuiEditorInspectApply();
}
Or should I keep it how it is?

Maybe have "Align ..." and "Align to parent ...".