public RequestMonitorPopup(PipeBlockRequestTable table, int orderId) { super(256, 202, 0, 0); _table = table; this.orderId = orderId; guiMapY = -200; Mouse.getDWheel(); // Reset DWheel on GUI open }
@Override public void handleMouseInputSub() throws IOException { int wheel = org.lwjgl.input.Mouse.getDWheel() / 120; if (wheel == 0) { super.handleMouseInputSub(); } if (wheel < 0) { wheeldown = wheel * -1; } else { wheelup = wheel; } }
public LogicLayoutGui(LogicController controller, EntityPlayer player) { super(256, 202 + 90, 0, 0); this.controller = controller; guiMapY = -200; Mouse.getDWheel(); // Reset DWheel on GUI open DummyContainer dummy = new DummyContainer(player.inventory, null); dummy.addNormalSlotsForPlayerInventory(50, 205); inventorySlots = dummy; }
private void handleDWheelMovement() { int dWheelRecentMovement = Mouse.getDWheel(); if (dWheelRecentMovement < 0 && buttonNextPage.visible) { actionPerformed(buttonNextPage); } if (dWheelRecentMovement > 0 && buttonPreviousPage.visible) { actionPerformed(buttonPreviousPage); } }
public void updateMouse(int mouseX, int mouseY) { this.prevMouseX = mouseX; this.prevMouseY = mouseY; int scroll = Mouse.getDWheel(); if (this.isSelected(mouseX, mouseY)) { this.zoom = MathHelper.clamp(this.zoom + scroll / 1600.0F, this.minZoom, this.maxZoom); } }
public ScreenBase(GuiScreen parent) { this.parent = parent; this.mc = Minecraft.getMinecraft(); this.widgets = new HashMap<>(); this.addWidget("canvas", new LayoutCanvas()); Mouse.getDWheel(); // We init the DWheel method (getDWheel returns the value since the last call, so we have to call it once on ui creation) }
@Override public void handleMouseInput() throws IOException { int x = Mouse.getEventX() * width / mc.displayWidth; int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; mouseX = x - guiLeft; mouseY = y - guiTop; mouseWheel = Mouse.getDWheel(); super.handleMouseInput(); }
@Override public void handleMouseInputSub() throws IOException { int wheel = org.lwjgl.input.Mouse.getDWheel() / 120; if (wheel == 0) { super.handleMouseInputSub(); } if (wheel < 0) { textList.scrollUp(); } else if (wheel > 0) { textList.scrollDown(); } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); int dWheel = Mouse.getDWheel(); if (dWheel != 0) { window.postEvent(new GuiEvent.WheelEvent(window, dWheel), GuiEventDestination.ALL); } }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); final int dWheel = Mouse.getDWheel(); if (dWheel != 0) { this.window.callEvent(new EventMouse.Wheel(this.window, dWheel)); } }
@Override public void handleMouseInputSub() throws IOException { int wheel = org.lwjgl.input.Mouse.getDWheel() / 120; if (wheel == 0) { super.handleMouseInputSub(); } if (wheel < 0) { textList.scrollUp(); } else if (wheel > 0) { textList.scrollDown(); } }
@Override public void handleMouseInput() throws IOException { int x = Mouse.getEventX() * width / mc.displayWidth; int y = height - Mouse.getEventY() * height / mc.displayHeight - 1; mouseX = x - guiLeft; mouseY = y - guiTop; mouseWheel = Mouse.getDWheel(); super.handleMouseInput(); } }
public LayoutCanvas() { super(null); this.setGeometry(0, 0, this.rez.getScaledWidth(), this.rez.getScaledHeight(), CType.ABSXY, CType.ABSXY); Mouse.getDWheel(); // This is to "calibrate" the DWheel this.lastMouseEvent = new MouseEvent(this); }
@Override public void handleMouseInput() throws IOException { super.handleMouseInput(); final int wheel = Mouse.getDWheel(); final int mx = Mouse.getEventX() * super.width / super.mc.displayWidth - x; final int my = super.height - Mouse.getEventY() * super.height / super.mc.displayHeight - 1 - y; window.handleHover(mx, my); if(wheel != 0) { window.scrollInput(wheel); } }
@Override public void initGui() { super.initGui(); Mouse.getDWheel(); updateFluids(); Collections.sort(this.fluidWidgets, new FluidWidgetComparator()); this.searchbar = new GuiTextField(0, this.fontRenderer, this.guiLeft + 81, this.guiTop + 6, 88, 10) { private int xPos = 0; private int yPos = 0; private int width = 0; private int height = 0; @Override public boolean mouseClicked(int x, int y, int mouseBtn) { boolean flag = x >= this.xPos && x < this.xPos + this.width && y >= this.yPos && y < this.yPos + this.height; if (flag && mouseBtn == 3) { setText(""); } return flag; } }; this.searchbar.setEnableBackgroundDrawing(false); this.searchbar.setFocused(true); this.searchbar.setMaxStringLength(15); }
@Override public void initGui() { super.initGui(); Mouse.getDWheel(); updateFluids(); Collections.sort(this.fluidWidgets, new FluidWidgetComparator()); this.searchbar = new GuiTextField(0, this.fontRenderer, this.guiLeft + 81, this.guiTop + 6, 88, 10) { private int xPos = 0; private int yPos = 0; private int width = 0; private int height = 0; @Override public boolean mouseClicked(int x, int y, int mouseBtn) { boolean flag = x >= this.xPos && x < this.xPos + this.width && y >= this.yPos && y < this.yPos + this.height; if (flag && mouseBtn == 3) { setText(""); } return flag; } }; this.searchbar.setEnableBackgroundDrawing(false); this.searchbar.setFocused(true); this.searchbar.setMaxStringLength(15); }
/** * Updates our "model" * */ private void updateState() { int dx = Mouse.getDX(); int dy = Mouse.getDY(); int dw = Mouse.getDWheel(); // get out if no movement if (dx == dy && dx == 0 && dw == 0) { return; } //LWJGL: 0=left 1=right 2=middle //GL: 0=left 1=middle 2=right int mode = 0; if (Mouse.isButtonDown(0)) mode |= 1; if (Mouse.isButtonDown(2)) mode |= 2; if (Mouse.isButtonDown(1)) mode |= 4; if (mode != 0) { //LWJGL has inverted dy wrt C++/GL dsMotion (mode, dx, -dy); } }
public MouseEvent(IWidget widget) { this.srcwidget = widget; this.timestamp = System.nanoTime(); this.mc = Minecraft.getMinecraft(); this.x = (double) Mouse.getEventX() * (double) this.srcwidget.getSize().getX() / (double) this.mc.displayWidth; this.y = (double) this.srcwidget.getSize().getY() - (double) Mouse.getEventY() * (double) this.srcwidget.getSize().getY() / (double) this.mc.displayHeight - 1.0; //this.x = Mouse.getEventX(); //this.y = Mouse.getEventY(); //System.out.printf("%s %s\n", this.x, this.y); //this.z = Mouse.getEventDWheel(); this.z = Mouse.getDWheel(); for (int i = 0; i < buttonCount; i++) buttonState[i] = Mouse.isButtonDown(i); this.trgwidget = this.srcwidget.getWidgetAtCoordinates(this.x, this.y); }
@Override public final void drawScreen(int mouseX, int mouseY, float partialTicks) { Gui.drawRect(0, 0, this.width, this.height, LLibrary.CONFIG.getTertiaryColor()); float preciseMouseX = this.getPreciseMouseX(); float preciseMouseY = this.getPreciseMouseY(); this.drawScreen(preciseMouseX, preciseMouseY, partialTicks); synchronized (this.elementLock) { this.elements.forEach(element -> this.renderElement(element, preciseMouseX, preciseMouseY, partialTicks)); } int scrollAmount = Mouse.getDWheel(); if (scrollAmount != 0) { for (Element element : this.getPostOrderElements()) { if (element.isVisible() && element.isEnabled()) { if (element.mouseScrolled(preciseMouseX, preciseMouseY, scrollAmount)) { return; } } } } }
@Override public void handleMouseInputSub() throws IOException { int wheel = org.lwjgl.input.Mouse.getDWheel() / 120; if (wheel == 0) { super.handleMouseInputSub(); } if(compiler.getCurrentTask() == null) { if (categoryTextList.getSize() == 0 && programTextList.getSize() != 0) { if (wheel < 0) { programListLarge.mouseScrollUp(); } else if (wheel > 0) { programListLarge.mouseScrollDown(); } } else { if (wheel < 0) { categoryList.mouseScrollUp(); programList.mouseScrollUp(); } else if (wheel > 0) { categoryList.mouseScrollDown(); programList.mouseScrollDown(); } } } }