Java Code Examples for net.minecraft.client.gui.GuiTextField#setEnabled()

The following examples show how to use net.minecraft.client.gui.GuiTextField#setEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiCyberwareMenu.java    From Cyberware with MIT License 5 votes vote down vote up
@Override
public void initGui()
{
	super.initGui();
	int numRows = ((colorOptions.length + ROW_SIZE - 1) / ROW_SIZE);
	hex = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 70, this.height / 2 - 100 + (30 * numRows), 140, 20);
	String s = Integer.toHexString(CyberwareAPI.getHUDColorHex()).toUpperCase();
	while (s.length() < 6)
	{
		s = "0" + s;
	}
	hex.setText(s);
	hex.setEnabled(false);
}
 
Example 2
Source File: GuiSpaceLaser.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
@Override
public void initGui() {
	super.initGui();

	int x = (width - xSize) / 2;
	int y = (height - ySize) / 2;

	//Create and setup the textboxes
	xbox = new GuiTextField(0,this.fontRenderer, x + 113, y + 31, 50, 10);
	ybox = new GuiTextField(1,this.fontRenderer, x + 113, y + 41, 50, 10);
	xbox.setMaxStringLength(15);
	xbox.setEnableBackgroundDrawing(true);
	xbox.setFocused(true);
	xbox.setCanLoseFocus(true);
	xbox.setEnabled(true);
	ybox.setMaxStringLength(15);
	ybox.setEnableBackgroundDrawing(true);
	ybox.setFocused(false);
	ybox.setCanLoseFocus(true);
	ybox.setEnabled(true);

	modeDown = new GuiImageButton(0, x + 103, y + 20, 5, 8, zmaster587.libVulpes.inventory.TextureResources.buttonLeft);
	modeUp = new GuiImageButton(1, x + 157, y + 20, 5, 8,  zmaster587.libVulpes.inventory.TextureResources.buttonRight);
	this.buttonList.add(modeUp);
	this.buttonList.add(modeDown);
	this.buttonList.add(new GuiButton(2, x + 103, y + 62, 34,20, "Reset"));
}
 
Example 3
Source File: GuiReactorControlRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void initGui() {
	super.initGui();

	int leftX = guiLeft + 4;
	int topY = guiTop + 4;
	
	Keyboard.enableRepeatEvents(true);
	
	titleString = new BeefGuiLabel(this, "Reactor Control Rod", leftX, topY);
	topY += titleString.getHeight() + 8;
	
	rodNameLabel = new BeefGuiLabel(this, "Name:", leftX, topY + 6);
	
	rodName = new GuiTextField(fontRendererObj, leftX + 4 + rodNameLabel.getWidth(), topY, 100, 20);
	rodName.setCanLoseFocus(true);
	rodName.setMaxStringLength(32);
	rodName.setText(entity.getName());
	rodName.setEnabled(true);
	
	setNameBtn = new GuiButton(2, guiLeft + 140, topY, 30, 20, "Set");
	setNameBtn.enabled = false;
	topY += 28;
	
	rodInsertIcon = new BeefGuiIcon(this, leftX+42, topY, 16, 16, ClientProxy.GuiIcons.getIcon("controlRod"), new String[] { EnumChatFormatting.AQUA + "Rod Insertion", "", "Change the control rod's insertion.", "Higher insertion slows reaction rate.", "", "Lower reaction rates reduce heat,", "energy, radiation output, and", "fuel consumption." });
	insertionLabel = new BeefGuiLabel(this, "", leftX+62, topY+5);
	topY += 20;
	insertionBar = new BeefGuiInsertionProgressBar(this, leftX+40, topY);

	topY += 12;
	rodRetractBtn = new GuiIconButton(0, leftX+70, topY, 20, 20, ClientProxy.GuiIcons.getIcon("upArrow"), new String[] { EnumChatFormatting.AQUA + "Insert Rod", "Increase insertion by 10.", "", "Shift: +100", "Alt: +5", "Shift+Alt: +1", "", "Ctrl: Change ALL Rods" });
	topY += 20;
	rodInsertBtn = new GuiIconButton(1, leftX+70, topY, 20, 20, ClientProxy.GuiIcons.getIcon("downArrow"), new String[] { EnumChatFormatting.AQUA + "Retract Rod", "Reduce insertion by 10.", "", "Shift: -100", "Alt: -5", "Shift+Alt: -1", "", "Ctrl: Change ALL Rods" });
	topY += 32;

	registerControl(insertionBar);
	registerControl(titleString);
	registerControl(rodNameLabel);
	registerControl(rodInsertIcon);
	registerControl(insertionLabel);

	registerControl(rodName);
	registerControl(rodRetractBtn);
	registerControl(rodInsertBtn);
	registerControl(setNameBtn);
	
	updateStrings();
}