public class WScrollBar extends WWidget
| Modifier and Type | Field and Description |
|---|---|
protected int |
anchor |
protected int |
anchorValue |
protected Axis |
axis |
protected int |
maxValue |
protected boolean |
sliding |
protected int |
value |
protected int |
window |
| Constructor and Description |
|---|
WScrollBar()
Constructs a horizontal scroll bar.
|
WScrollBar(Axis axis)
Constructs a scroll bar with a custom axis.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustSlider(int x,
int y) |
boolean |
canFocus()
Tests whether this widget can have the focus in the GUI.
|
boolean |
canResize()
Checks whether this widget can be resized using
WWidget.setSize(int, int). |
protected void |
checkValue()
Checks that the current value is in the correct range
and adjusts it if needed.
|
int |
getHandlePosition() |
int |
getHandleSize()
Gets the on-axis size of the scrollbar handle in gui pixels
|
int |
getMaxScrollValue()
Gets the maximum scroll value achievable; this will typically be the maximum value minus the
window size
|
int |
getMaxValue() |
int |
getMovableDistance()
Gets the number of pixels the scrollbar handle is able to move along its track from one end to the other.
|
int |
getValue() |
int |
getWindow() |
void |
onKeyPressed(int ch,
int key,
int modifiers)
Notifies this widget that a key has been pressed.
|
InputResult |
onMouseDown(int x,
int y,
int button)
Notifies this widget that the mouse has been pressed while inside its bounds
|
InputResult |
onMouseDrag(int x,
int y,
int button,
double deltaX,
double deltaY)
Notifies this widget that the mouse has been moved while pressed and inside its bounds.
|
InputResult |
onMouseScroll(int x,
int y,
double amount)
Notifies this widget that the mouse has been scrolled inside its bounds.
|
InputResult |
onMouseUp(int x,
int y,
int button)
Notifies this widget that the mouse has been released while inside its bounds
|
void |
paint(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
int mouseX,
int mouseY)
Paints this widget.
|
int |
pixelsToValues(int pixels) |
WScrollBar |
setMaxValue(int max) |
WScrollBar |
setValue(int value) |
WScrollBar |
setWindow(int window) |
addPainters, addTooltip, createPeers, cycleFocus, getAbsoluteX, getAbsoluteY, getHeight, getHost, getParent, getWidth, getX, getY, hit, isActivationKey, isFocused, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onHidden, onKeyReleased, onMouseMove, onShown, releaseFocus, renderTooltip, requestFocus, setHost, setLocation, setParent, setSize, tick, validateprotected Axis axis
protected int value
protected int maxValue
protected int window
protected int anchor
protected int anchorValue
protected boolean sliding
public WScrollBar()
public WScrollBar(Axis axis)
axis - the axis@Environment(value=CLIENT)
public void paint(net.minecraft.client.util.math.MatrixStack matrices,
int x,
int y,
int mouseX,
int mouseY)
WWidgetpublic boolean canResize()
WWidgetWWidget.setSize(int, int).public boolean canFocus()
WWidgetpublic int getHandleSize()
public int getMovableDistance()
public int pixelsToValues(int pixels)
public int getHandlePosition()
public int getMaxScrollValue()
protected void adjustSlider(int x,
int y)
public InputResult onMouseDown(int x, int y, int button)
WWidgetonMouseDown in class WWidgetx - The X coordinate of the event, in widget-space (0 is the left edge of this widget)y - The Y coordinate of the event, in widget-space (0 is the top edge of this widget)button - The mouse button that was used. Button numbering is consistent with LWJGL Mouse (0=left, 1=right, 2=mousewheel click)InputResult.PROCESSED if the event is handled, InputResult.IGNORED otherwise.@Environment(value=CLIENT) public InputResult onMouseDrag(int x, int y, int button, double deltaX, double deltaY)
WWidgetonMouseDrag in class WWidgetx - The X coordinate of the event, in widget-space (0 is the left edge of this widget)y - The Y coordinate of the event, in widget-space (0 is the top edge of this widget)button - The mouse button that was used. Button numbering is consistent with LWJGL Mouse (0=left, 1=right, 2=mousewheel click)deltaX - The amount of dragging on the X axisdeltaY - The amount of dragging on the Y axisInputResult.PROCESSED if the event is handled, InputResult.IGNORED otherwise.@Environment(value=CLIENT) public InputResult onMouseUp(int x, int y, int button)
WWidgetonMouseUp in class WWidgetx - The X coordinate of the event, in widget-space (0 is the left edge of this widget)y - The Y coordinate of the event, in widget-space (0 is the top edge of this widget)button - The mouse button that was used. Button numbering is consistent with LWJGL Mouse (0=left, 1=right, 2=mousewheel click)InputResult.PROCESSED if the event is handled, InputResult.IGNORED otherwise.public void onKeyPressed(int ch,
int key,
int modifiers)
WWidgetonKeyPressed in class WWidgetkey - the GLFW scancode of the key@Environment(value=CLIENT) public InputResult onMouseScroll(int x, int y, double amount)
WWidgetonMouseScroll in class WWidgetx - The X coordinate of the event, in widget-space (0 is the left edge of this widget)y - The Y coordinate of the event, in widget-space (0 is the top edge of this widget)amount - The scrolled amount. Positive values are up and negative values are down.InputResult.PROCESSED if the event is handled, InputResult.IGNORED otherwise.public int getValue()
public WScrollBar setValue(int value)
public int getMaxValue()
public WScrollBar setMaxValue(int max)
public int getWindow()
public WScrollBar setWindow(int window)
protected void checkValue()