Poll

Did you find this helpful?

Yes
No

Author Topic: [Tutorial] Making a Gui  (Read 45083 times)

I have Windoodle Seven and I throw all my fecal matter in %PROGRAMFILES.
Lol, didn't see the last post date.
Followed a link.

big bump

I dont think it's a very good idea to remove the main menu GUI completely, but I will cover adding (and if possible, removing) pieces to (/from) a GUI.

If you must know now, I'll tell you that you can add controls to a GUI by using something like this:

Code: [Select]
$NewCntrl = new CtrlType(CntrlName) {
                        profile = "GuiDefaultProfile";
                        horizSizing = "right";
                        vertSizing = "bottom";
                        position = "0 0";
                        extent = "310 335";
                        minExtent = "8 2";
                        visible = "0";
                        color = "50 50 50 128";
};

CntrlName/WindowName.add($NewCntrl);
Note that you can add the new control to either a named Control (like a scroll bar) or to the window it self


I don't know if there is a remove(); function, but there might be. Try dump()-ing some GUI's to see what methods they have.

Please include this along with how to move existing controls in the new version

I thought this was sticky
« Last Edit: August 17, 2010, 04:28:57 PM by Miner Blockman »

Nope, no sticky on this one. He is going to make a new version of it I guess.

If I do a new version, I will include a section that describes how to edit existing GUI's without creating a new GUI.

Anything else?

I have a question for right now:

I am editing an existing GUI, the server password gui, and I can't make my button stay with the GUI- its a free button that is just floating there if I change the resolution.

So, my question is, how do I attach a button to an existing gui?

Here is the method I am using to get the button:
Code: [Select]
ExampleGUIName.add(
new GuiCheckBoxCtrl()
{
//stuff here- removed for post//
}
);

Parent it.  That will make it act like the parent is the screen, so it will follow the parent.

But how do I parent it? Do I add Parent = "blah"; to the code?

But how do I parent it? Do I add Parent = "blah"; to the code?
No, instead of guiname.add(newcontrol) do existingparent.add(newcontrol);

Existing parent could be any GUI control anywhere

If you make a new guide add what an AltCommand does.

No, instead of guiname.add(newcontrol) do existingparent.add(newcontrol);

Existing parent could be any GUI control anywhere

What is the parent though? Is that just the name of the existing GUI?

What is the parent though? Is that just the name of the existing GUI?
The parent is the control, window, or GUI that th new control sticks to. If the control doesn't have a parent (a window), the control just floats around. Parent the new control to the control you want it to be in/on (window, scrollbar, swatch).

Can you tell me what is wrong with this then:

Code: [Select]
if(!%Added)
{
JoinServerPassGUI.add(
new GuiCheckBoxCtrl()
{
profile = "GuiCheckBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "71 80";
extent = "140 30";
minExtent = "8 2";
visible = "1";
variable = "vargoeshere";
text = "text";
groupNum = "-1";
buttonType = "ToggleButton";
}
);
%Added = 1;
}

Right now it just floats on its own.

Nevermind, I had to set the window as the object. All good now, thanks everyone.

Is it possible to edit default gui's like the wrench events? And if so, Where to put files?