Search in sources :

Example 6 with Menu

use of com.kotcrab.vis.ui.widget.Menu in project Eidolons by IDemiurge.

the class MenuPanel method initControlMenus.

public void initControlMenus(LE_ControlPanel[] panels) {
    Menu.MenuStyle style = (StyleHolder.getMenuStyle());
    TextButton.TextButtonStyle btnStyle = (StyleHolder.getMenuBtnStyle());
    for (LE_ControlPanel panel : panels) {
        Menu menu = new Menu(TabbedControlPanel.getTitleFromClass(panel.getClazz()), style);
        addMenu(menu);
        for (Method method : panel.getClazz().getMethods()) {
            MenuItem item = new MenuItem(StringMaster.format(method.getName()));
            item.addListener(createItemListener(item, method, panel.getHandler()));
            menu.addItem(item);
            item.setStyle(btnStyle);
        }
    }
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) MenuItem(com.kotcrab.vis.ui.widget.MenuItem) Menu(com.kotcrab.vis.ui.widget.Menu) Method(java.lang.reflect.Method)

Aggregations

Menu (com.kotcrab.vis.ui.widget.Menu)6 MenuItem (com.kotcrab.vis.ui.widget.MenuItem)5 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)3 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)3 PopupMenu (com.kotcrab.vis.ui.widget.PopupMenu)2 FileHandle (com.badlogic.gdx.files.FileHandle)1 Pixmap (com.badlogic.gdx.graphics.Pixmap)1 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)1 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)1 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)1 Array (com.badlogic.gdx.utils.Array)1 ScreenViewport (com.badlogic.gdx.utils.viewport.ScreenViewport)1 MenuBar (com.kotcrab.vis.ui.widget.MenuBar)1 FileChooserAdapter (com.kotcrab.vis.ui.widget.file.FileChooserAdapter)1 ShaderNodeStage (com.talosvfx.talos.editor.addons.shader.workspace.ShaderNodeStage)1 Method (java.lang.reflect.Method)1