com.threerings.opengl.gui
Class PopupMenu

java.lang.Object
  extended by com.threerings.opengl.gui.Component
      extended by com.threerings.opengl.gui.Container
          extended by com.threerings.opengl.gui.Window
              extended by com.threerings.opengl.gui.PopupWindow
                  extended by com.threerings.opengl.gui.PopupMenu
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, Comparable<Window>

public class PopupMenu
extends PopupWindow

Displays a popup menu of items, one of which can be selected.


Field Summary
 
Fields inherited from class com.threerings.opengl.gui.Component
DEFAULT, DISABLED, HOVER
 
Constructor Summary
PopupMenu(GlContext ctx, Window parent)
           
PopupMenu(GlContext ctx, Window parent, boolean horizontal)
           
PopupMenu(GlContext ctx, Window parent, int rows, int columns)
           
 
Method Summary
 void addMenuItem(MenuItem item)
          Adds the supplied item to this menu.
 boolean dispatchEvent(Event event)
          Instructs this component to process the supplied event.
 void setPreferredDimensions(int rows, int columns)
          Sets the preferred number of rows and columns.
 
Methods inherited from class com.threerings.opengl.gui.PopupWindow
popup, shouldShadeBehind
 
Methods inherited from class com.threerings.opengl.gui.Window
center, compareTo, dismiss, getLayer, getParentWindow, getRoot, invalidate, isAdded, isModal, isOverlay, pack, pack, setBounds, setLayer, setModal, setParent, setParentWindow
 
Methods inherited from class com.threerings.opengl.gui.Container
add, add, add, add, getComponent, getComponentCount, getComponentIndex, getHitComponent, getLayoutManager, remove, remove, removeAll, replace, setAlpha, setEnabled, setHoverable, setLayoutManager, validate
 
Methods inherited from class com.threerings.opengl.gui.Component
acceptsFocus, addListener, boundsToString, configUpdated, contains, createDefaultTooltipComponent, createDefaultTooltipComponent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getContext, getCursor, getFocusTarget, getHeight, getInsets, getParent, getPreferredSize, getProperty, getState, getStyleConfigs, getTooltipText, getTooltipTimeout, getTooltipWindowStyle, getTransferHandler, getWidth, getX, getY, hasFocus, isEnabled, isHoverable, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeAllListeners, removeListener, render, requestFocus, scrollRectToVisible, setBackground, setCursor, setLocation, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleConfig, setStyleConfig, setStyleConfig, setStyleConfigs, setTooltipRelativeToMouse, setTooltipText, setTransferHandler, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopupMenu

public PopupMenu(GlContext ctx,
                 Window parent)

PopupMenu

public PopupMenu(GlContext ctx,
                 Window parent,
                 boolean horizontal)

PopupMenu

public PopupMenu(GlContext ctx,
                 Window parent,
                 int rows,
                 int columns)
Method Detail

addMenuItem

public void addMenuItem(MenuItem item)
Adds the supplied item to this menu.


setPreferredDimensions

public void setPreferredDimensions(int rows,
                                   int columns)
Sets the preferred number of rows and columns. Will relayout the existing menu items into the preferred number of columns, but may add more columns if the menu will not fit in the vertical space.

Parameters:
rows - the number of rows to display at one time, or zero if unlimited.
columns - the number of columns to display.

dispatchEvent

public boolean dispatchEvent(Event event)
Description copied from class: Component
Instructs this component to process the supplied event. If the event is not processed, it will be passed up to its parent component for processing. Derived classes should thus only call super.dispatchEvent for events that they did not "consume".

Overrides:
dispatchEvent in class Component
Returns:
true if this event was consumed, false if not.


Copyright © 2011. All Rights Reserved.