Class SegmentedControl

java.lang.Object
me.hackware.api.gui.SegmentedControl

public final class SegmentedControl extends Object
A horizontal segmented control (two or more options, one selected) — used for the macro/wheel keybind mode toggle (Toggle / Hold). Stateless: the host owns the selected index and hit-tests clicks with indexAt(int, int, int, int, double, double).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    draw(UiContext ui, int x, int y, int w, String[] options, int selected)
     
    static int
    indexAt(int x, int y, int w, int count, double mx, double my)
    Returns the clicked segment index, or -1 if the point is outside.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • draw

      public static void draw(UiContext ui, int x, int y, int w, String[] options, int selected)
    • indexAt

      public static int indexAt(int x, int y, int w, int count, double mx, double my)
      Returns the clicked segment index, or -1 if the point is outside.