@Override public void initGui() { super.initGui(); this.name = new GuiTextField( 0, this.fontRenderer, this.guiLeft + 24, this.guiTop + 32, 79, this.fontRenderer.FONT_HEIGHT ); this.name.setEnableBackgroundDrawing( false ); this.name.setMaxStringLength( 32 ); this.name.setTextColor( 0xFFFFFF ); this.name.setVisible( true ); this.name.setFocused( true ); }
@Override public void onInitGui() { super.onInitGui(); if(!GuiLexicon.isValidLexiconGui(this)) { currentOpenLexicon = new GuiLexicon(); mc.displayGuiScreen(currentOpenLexicon); ClientTickHandler.notifyPageChange(); return; } buttonList.add(backButton = new GuiButtonBack(12, left + guiWidth / 2 - 8, top + guiHeight + 2)); buttonList.add(leftButton = new GuiButtonPage(13, left, top + guiHeight - 10, false)); buttonList.add(rightButton = new GuiButtonPage(14, left + guiWidth - 18, top + guiHeight - 10, true)); searchField = new GuiTextField(15, fontRenderer, left + guiWidth / 2 + 28, top + guiHeight + 6, 200, 10); searchField.setCanLoseFocus(false); searchField.setFocused(true); searchField.setEnableBackgroundDrawing(false); updateAll(); }
void tabFocus(int change) { textFields.get(focusedField).setFocused(false); focusedField = wrapLine(focusedField + change); textFields.get(focusedField).setFocused(true); }
private void mouseClickedTextboxes(int mouseX, int mouseY, int btn) { for (GuiTextField txt : txtBoxes) { txt.mouseClicked(mouseX, mouseY, btn); if (btn == 0) {//basically left click boolean flag = mouseX >= this.guiLeft + txt.x && mouseX < this.guiLeft + txt.x + txt.width && mouseY >= this.guiTop + txt.y && mouseY < this.guiTop + txt.y + txt.height; txt.setFocused(flag); } } }
protected void setSearchFieldFocussed(boolean focused) { getSearchField().setFocused(focused); }
@Override protected void mouseClicked(int x, int y, int btn) throws IOException { super.mouseClicked(x, y, btn);// x/y pos is 33/30 if (txtPassword != null) { txtPassword.mouseClicked(x, y, btn); txtPassword.setFocused(true); } } // ok end of textbox fixing stuff
@Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { super.mouseClicked(mouseX, mouseY, mouseButton); int currentFocus = focusedField; textFields.forEach((field) -> field.mouseClicked(mouseX, mouseY, mouseButton)); updateFocusField(); if(focusedField == currentFocus && !textFields.get(focusedField).isFocused()) textFields.get(focusedField).setFocused(true); }
@Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { if (this.nameField.mouseClicked(mouseX, mouseY, mouseButton)) { nameField.setFocused(true); } else { nameField.setFocused(false); if (panel.contains(mouseX - guiLeft, mouseY - guiTop)) { clickButton = mouseButton; panelClicked = true; clickX = Mouse.getX(); clickY = Mouse.getY(); } super.mouseClicked(mouseX, mouseY, mouseButton); } }
private void openPanel() { closePanel(); panelEnabled = true; page = Math.min(page, getPageCount() - 1); panelX = gridLeft + (selectedX + 1) * 18; panelY = gridTop; searchField.x = panelX + 18; searchField.y = panelY + 4; searchField.setText(""); spellNameField.setFocused(false); updatePanelButtons(); }
@Override public void mouseClicked(int i, int j, int k) { if (isMouseOverTextField(textFieldAddTrustedPlayer, i, j)) { if (textFieldAddTrustedPlayer.isFocused()) { textFieldAddTrustedPlayer.mouseClicked(i, j, k); } else { textFieldAddTrustedPlayer.setFocused(true); } } else { try { super.mouseClicked(i, j, k); } catch (IOException e) { e.printStackTrace(); } } }
@SuppressWarnings("EmptyCatchBlock") @Override protected void keyTyped(char typedChar, int keyCode) { if (textFieldAddTrustedPlayer == null || !textFieldAddTrustedPlayer.isFocused()) { try { super.keyTyped(typedChar, keyCode); } catch (IOException e) { } } else if (textFieldAddTrustedPlayer != null) { if (typedChar != 27) { textFieldAddTrustedPlayer.textboxKeyTyped(typedChar, keyCode); } else { textFieldAddTrustedPlayer.setFocused(false); } } }
@Override public void setFocused(boolean par1) { if (isFocused() == true && par1 == false) { if (observer != null) observer.textFieldNewValue(this, this.getText()); if (iGuiObjectObserver != null) iGuiObjectObserver.guiObjectEvent(this); } super.setFocused(par1); }
@Override public void initGui(){ super.initGui(); this.nameField = new GuiTextField(4000, this.fontRenderer, this.guiLeft+5, this.guiTop+6, 114, 8); this.nameField.setMaxStringLength(20); this.nameField.setEnableBackgroundDrawing(false); this.nameField.setFocused(true); }
@Override public void initGui() { Keyboard.enableRepeatEvents(true); messageTextField = new GuiDoorMatTextField(2, fontRenderer, this.width / 2 - 150, this.height / 2 - 20, 300, 20, 50, 4); messageTextField.setFocused(true); messageTextField.setMaxStringLength(100); doneBtn = new GuiButton(0, this.width / 2 - 4 - 150, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.done")); cancelBtn = new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel")); buttonList.add(doneBtn); buttonList.add(cancelBtn); doneBtn.enabled = false; }
public void onSpellChanged(boolean nameOnly) { if(!spectator) { MessageSpellModified message = new MessageSpellModified(programmer.getPos(), programmer.spell); NetworkHandler.INSTANCE.sendToServer(message); } programmer.onSpellChanged(); onSelectedChanged(); spellNameField.setFocused(nameOnly); if(!nameOnly || compiler != null && compiler.getError() != null && compiler.getError().equals(SpellCompilationException.NO_NAME) || programmer.spell.name.isEmpty()) compiler = new SpellCompiler(programmer.spell); }
@Override public void initGui() { super.initGui(); addressNameField = new GuiTextField(0, this.fontRenderer, guiLeft + 44, guiTop + 39, 90, 14); addressNameField.setText(container.getAddress().getName()); addressNameField.setFocused(true); }
@Override public void setFocused(boolean keyboardFocus) { final boolean previousFocus = isFocused(); super.setFocused(keyboardFocus); if (previousFocus != keyboardFocus) { if (keyboardFocus) { previousKeyboardRepeatEnabled = Keyboard.areRepeatEventsEnabled(); Keyboard.enableRepeatEvents(true); } else { Keyboard.enableRepeatEvents(previousKeyboardRepeatEnabled); } saveHistory(); } }
@Override public void init(int x, int y) { addSideButton(new SideButtonRedstoneMode(this, readerWriter.getRedstoneModeParameter())); add = addButton(x + 128, y + 15, 20, 20, "+"); remove = addButton(x + 150, y + 15, 20, 20, "-"); name = new GuiTextField(0, fontRenderer, x + 8 + 1, y + 20 + 1, 107, fontRenderer.FONT_HEIGHT); name.setEnableBackgroundDrawing(false); name.setVisible(true); name.setTextColor(16777215); name.setCanLoseFocus(true); name.setFocused(false); }
@Override public void init(int x, int y) { addSideButton(new SideButtonType(this, TileDetector.TYPE)); addSideButton(new SideButtonDetectorMode(this)); addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, IComparer.COMPARE_DAMAGE)); addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, IComparer.COMPARE_NBT)); amount = new GuiTextField(0, fontRenderer, x + 41 + 1, y + 23 + 1, 50, fontRenderer.FONT_HEIGHT); amount.setText(String.valueOf(TileDetector.AMOUNT.getValue())); amount.setEnableBackgroundDrawing(false); amount.setVisible(true); amount.setTextColor(16777215); amount.setCanLoseFocus(true); amount.setFocused(false); }
@Override public void onGuiInit(int x, int y, int width, int height) { addButton.onGuiInit(); privateButton.onGuiInit(); deleteChannelB.onGuiInit(); sendB.onGuiInit(); recieveB.onGuiInit(); y = parent.getGuiTop() + 12; x = parent.getGuiLeft() + 8; newChannelTF.x = x; newChannelTF.y = y; newChannelTF.setCanLoseFocus(false); newChannelTF.setMaxStringLength(32); newChannelTF.setFocused(true); channelList.onGuiInit(parent); sendChannels.onGuiInit(parent); recieveChannels.onGuiInit(parent); }