Blockland Forums > Modification Help
Making a gui send a message in a textbox on the gui.
tyler0:
Ok here is my code:
Client.cs
--- Code: ---exec("./Testgui.gui");
moveMap.bind(keyboard, "m", pushTestgui);
function SetMessage(%Client)
{
messageAll('', Textbox1.text );
}
--- End code ---
Testgui.gui
--- Code: ---//--- OBJECT WRITE BEGIN ---
new GuiControl(Testgui) {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 2";
visible = "1";
new GuiWindowCtrl() {
profile = "GuiWindowProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "149 66";
extent = "337 185";
minExtent = "8 2";
visible = "1";
command = "canvas.popdialog(Testgui);";
accelerator = "escape";
text = "Test GUI";
maxLength = "255";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "1";
canMinimize = "1";
canMaximize = "1";
minSize = "50 50";
closeCommand = "canvas.popdialog(Testgui);";
new GuiSwatchCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 49";
extent = "223 53";
minExtent = "8 2";
visible = "1";
color = "175 175 175 255";
new GuiMLTextCtrl() {
profile = "BlockChatChannelSize7Profile";
horizSizing = "right";
vertSizing = "bottom";
position = "4 9";
extent = "223 29";
minExtent = "8 2";
visible = "1";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "CLICK DA BUTTON";
maxBitmapHeight = "-1";
selectable = "1";
};
};
new GuiTextEditCtrl(Textbox1) {
profile = "GuiTextEditProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "34 119";
extent = "264 18";
minExtent = "8 2";
visible = "1";
text = "Empty";
maxLength = "255";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
};
new GuiButtonCtrl(Button1) {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "98 145";
extent = "140 30";
minExtent = "8 2";
visible = "1";
command = "SetMessage();";
text = "Button";
groupNum = "-1";
buttonType = "PushButton";
};
};
};
//--- OBJECT WRITE END ---
--- End code ---
otto-san:
Did you try making a separate variable for the text box?
tyler0:
--- Quote from: otto-san on July 01, 2010, 10:12:51 PM ---Did you try making a separate variable for the text box?
--- End quote ---
i saw that but i don't know how to use it :(
otto-san:
%textbox=Textbox1.txt
I don't know a lot about text boxes.
MegaScientifical:
No no, you're doing it all wrong. I'd say more, but I'm in a weird mood where as I don't feel like explaining something I haven't worked with much at all.