Search in sources :

Example 1 with ScrollableLabel

use of mcjty.lib.gui.widgets.ScrollableLabel in project RFTools by McJty.

the class GuiDimensionMonitor method initGui.

@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
    alarmLevel = new ScrollableLabel(mc, this).setSuffix("%").setDesiredWidth(30).setRealMinimum(0).setRealMaximum(100).setRealValue(tileEntity.getAlarmLevel()).addValueEvent(new ValueEvent() {

        @Override
        public void valueChanged(Widget parent, int newValue) {
            changeAlarmValue(newValue);
        }
    });
    Slider alarmSlider = new Slider(mc, this).setDesiredHeight(15).setHorizontal().setTooltips("Alarm level").setScrollable(alarmLevel);
    Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(alarmLevel).addChild(alarmSlider);
    toplevel.addChild(bottomPanel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, MONITOR_WIDTH, MONITOR_HEIGHT));
    window = new Window(this, toplevel);
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Slider(mcjty.lib.gui.widgets.Slider) ValueEvent(mcjty.lib.gui.events.ValueEvent) Widget(mcjty.lib.gui.widgets.Widget) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) ScrollableLabel(mcjty.lib.gui.widgets.ScrollableLabel) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout)

Aggregations

Window (mcjty.lib.gui.Window)1 ValueEvent (mcjty.lib.gui.events.ValueEvent)1 HorizontalLayout (mcjty.lib.gui.layout.HorizontalLayout)1 VerticalLayout (mcjty.lib.gui.layout.VerticalLayout)1 Panel (mcjty.lib.gui.widgets.Panel)1 ScrollableLabel (mcjty.lib.gui.widgets.ScrollableLabel)1 Slider (mcjty.lib.gui.widgets.Slider)1 Widget (mcjty.lib.gui.widgets.Widget)1