ChangeEvent is fired when the selectbox selection changes.
The preferred size of the select box is determined by the maximum text bounds of the items and the size of the
SelectBoxStyle#background.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | SelectBox.
The style for a select box, see |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private ClickListener | |
| pack-priv boolean | |
| pack-priv final Array | |
| private float | |
| private float | |
| pack-priv SelectBox. | |
| pack-priv boolean | |
| pack-priv final ArraySelection | |
| pack-priv SelectBox. | |
| pack-priv static final Vector2 |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| protected GlyphLayout | |
| protected Drawable | getBackgroundDrawable()
Returns appropriate background drawable from the style based on the current select box state. |
| public ClickListener | |
| protected Color | getFontColor()
Returns the appropriate label font color from the style based on the current button state. |
| public Array | |
| public List | |
| public int | getMaxListCount()
Returns: Max number of items to display when the box is opened, or <= 0 to display them all. |
| public float | getMaxSelectedPrefWidth()
Returns the pref width of the select box if the widest item was selected, for use when
|
| public float | |
| public float | |
| public SelectBox. | getScrollPane()
Returns the scroll pane containing the list that is shown when the select box is open. |
| public T | |
| public int | |
| public boolean | |
| public ArraySelection | Returns: a Selection object containing the selected elementsGet the set of selected items, useful when multiple items are selected |
| public SelectBox. | getStyle()
Implements com. Returns the select box's style. |
| public void | |
| public void | |
| public boolean | |
| public boolean | |
| public void | layout()
Overrides com. Implements com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls |
| protected SelectBox. | |
| protected void | |
| protected void | |
| public void | |
| public void | setDisabled(boolean disabled)
Implements com.
|
| public void | |
| public void | |
| public void | setMaxListCount(int maxListCount)
Set the max number of items to display when the select box is opened. |
| public void | |
| public void | setSelected(T item)
Sets the selection to only the passed item, if it is a possible choice, else selects the first item. |
| public void | |
| public void | setSelectedPrefWidth(boolean selectedPrefWidth)
When true the pref width is based on the selected item. |
| protected void | setStage(Stage stage)
Overrides com. Called by the framework when this actor or any ascendant is added to a group that is in the stage. |
| public void | setStyle(SelectBox.
Implements com. Set the current style of the actor |
| public void | |
| public void | |
| protected String |
| alignment | back to summary |
|---|---|
| private int alignment | |
| clickListener | back to summary |
|---|---|
| private ClickListener clickListener | |
| disabled | back to summary |
|---|---|
| pack-priv boolean disabled | |
| items | back to summary |
|---|---|
| pack-priv final Array<T> items | |
| prefHeight | back to summary |
|---|---|
| private float prefHeight | |
| prefWidth | back to summary |
|---|---|
| private float prefWidth | |
| scrollPane | back to summary |
|---|---|
| pack-priv SelectBox. | |
| selectedPrefWidth | back to summary |
|---|---|
| pack-priv boolean selectedPrefWidth | |
| selection | back to summary |
|---|---|
| pack-priv final ArraySelection<T> selection | |
| style | back to summary |
|---|---|
| pack-priv SelectBox. | |
| temp | back to summary |
|---|---|
| pack-priv static final Vector2 temp | |
| SelectBox | back to summary |
|---|---|
| public SelectBox(Skin skin) | |
| SelectBox | back to summary |
|---|---|
| public SelectBox(Skin skin, String styleName) | |
| SelectBox | back to summary |
|---|---|
| public SelectBox(SelectBox. | |
| clearItems | back to summary |
|---|---|
| public void clearItems() | |
| draw | back to summary |
|---|---|
| public void draw(Batch batch, float parentAlpha) Overrides com. Doc from com. If this method is overridden, the super method or | |
| drawItem | back to summary |
|---|---|
| protected GlyphLayout drawItem(Batch batch, BitmapFont font, T item, float x, float y, float width) | |
| getBackgroundDrawable | back to summary |
|---|---|
| protected Drawable getBackgroundDrawable() Returns appropriate background drawable from the style based on the current select box state.
| |
| getClickListener | back to summary |
|---|---|
| public ClickListener getClickListener() | |
| getFontColor | back to summary |
|---|---|
| protected Color getFontColor() Returns the appropriate label font color from the style based on the current button state. | |
| getItems | back to summary |
|---|---|
| public Array Returns the internal items array. If modified, | |
| getList | back to summary |
|---|---|
| public List Returns the list shown when the select box is open. | |
| getMaxListCount | back to summary |
|---|---|
public int getMaxListCount()
| |
| getMaxSelectedPrefWidth | back to summary |
|---|---|
| public float getMaxSelectedPrefWidth() Returns the pref width of the select box if the widest item was selected, for use when
| |
| getPrefHeight | back to summary |
|---|---|
| public float getPrefHeight() Overrides com. Implements com. | |
| getPrefWidth | back to summary |
|---|---|
| public float getPrefWidth() Overrides com. Implements com. | |
| getScrollPane | back to summary |
|---|---|
| public SelectBox. Returns the scroll pane containing the list that is shown when the select box is open. | |
| getSelected | back to summary |
|---|---|
| public T getSelected() Returns the first selected item, or null. For multiple selections use
| |
| getSelectedIndex | back to summary |
|---|---|
public int getSelectedIndex()
| |
| getSelectedPrefWidth | back to summary |
|---|---|
| public boolean getSelectedPrefWidth() | |
| getSelection | back to summary |
|---|---|
| public ArraySelection Get the set of selected items, useful when multiple items are selected
| |
| getStyle | back to summary |
|---|---|
| public SelectBox. Implements com. Returns the select box's style. Modifying the returned style may not have an effect until | |
| hideList | back to summary |
|---|---|
| public void hideList()
Deprecated Use
| |
| hideScrollPane | back to summary |
|---|---|
| public void hideScrollPane() | |
| isDisabled | back to summary |
|---|---|
| public boolean isDisabled() Implements com. | |
| isOver | back to summary |
|---|---|
| public boolean isOver() | |
| layout | back to summary |
|---|---|
| public void layout() Overrides com. Implements com. Doc from com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls | |
| newScrollPane | back to summary |
|---|---|
| protected SelectBox. Allows a subclass to customize the scroll pane shown when the select box is open. | |
| onHide | back to summary |
|---|---|
| protected void onHide(Actor scrollPane) | |
| onShow | back to summary |
|---|---|
| protected void onShow(Actor scrollPane, boolean below) | |
| setAlignment | back to summary |
|---|---|
| public void setAlignment(int alignment) Sets the alignment of the selected item in the select box. See
| |
| setDisabled | back to summary |
|---|---|
| public void setDisabled(boolean disabled) Implements com. | |
| setItems | back to summary |
|---|---|
| public void setItems(T... newItems) Set the backing Array that makes up the choices available in the SelectBox | |
| setItems | back to summary |
|---|---|
| public void setItems(Array<T> newItems) Sets the items visible in the select box. | |
| setMaxListCount | back to summary |
|---|---|
| public void setMaxListCount(int maxListCount) Set the max number of items to display when the select box is opened. Set to 0 (the default) to display as many as fit in the stage height. | |
| setScrollingDisabled | back to summary |
|---|---|
| public void setScrollingDisabled(boolean y) Disables scrolling of the list shown when the select box is open. | |
| setSelected | back to summary |
|---|---|
| public void setSelected(T item) Sets the selection to only the passed item, if it is a possible choice, else selects the first item. | |
| setSelectedIndex | back to summary |
|---|---|
| public void setSelectedIndex(int index) Sets the selection to only the selected index. | |
| setSelectedPrefWidth | back to summary |
|---|---|
| public void setSelectedPrefWidth(boolean selectedPrefWidth) When true the pref width is based on the selected item. | |
| setStage | back to summary |
|---|---|
| protected void setStage(Stage stage) Overrides com. Doc from com. Called by the framework when this actor or any ascendant is added to a group that is in the stage. | |
| setStyle | back to summary |
|---|---|
| public void setStyle(SelectBox. Implements com. Doc from com. Set the current style of the actor | |
| showList | back to summary |
|---|---|
| public void showList()
Deprecated Use
| |
| showScrollPane | back to summary |
|---|---|
| public void showScrollPane() | |
| toString | back to summary |
|---|---|
| protected String toString(T item) | |
| Modifier and Type | Field and Description |
|---|---|
| private InputListener | |
| pack-priv final List | |
| pack-priv int | |
| private Actor | |
| pack-priv final SelectBox | |
| private final Vector2 |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | act(float delta)
Overrides com. Updates the actor based on time. |
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| public List | |
| public SelectBox | |
| public void | |
| protected List | |
| protected void | setStage(Stage stage)
Overrides com. Called by the framework when this actor or any ascendant is added to a group that is in the stage. |
| public void |
| hideListener | back to summary |
|---|---|
| private InputListener hideListener | |
| list | back to summary |
|---|---|
| pack-priv final List<T> list | |
| maxListCount | back to summary |
|---|---|
| pack-priv int maxListCount | |
| previousScrollFocus | back to summary |
|---|---|
| private Actor previousScrollFocus | |
| selectBox | back to summary |
|---|---|
| pack-priv final SelectBox<T> selectBox | |
| stagePosition | back to summary |
|---|---|
| private final Vector2 stagePosition | |
| SelectBoxScrollPane | back to summary |
|---|---|
| public SelectBoxScrollPane(final SelectBox<T> selectBox) | |
| act | back to summary |
|---|---|
| public void act(float delta) Overrides com. Doc from com. Updates the actor based on time. Typically this is called each frame by
The default implementation calls | |
| draw | back to summary |
|---|---|
| public void draw(Batch batch, float parentAlpha) Overrides com. Doc from com. If this method is overridden, the super method or | |
| getList | back to summary |
|---|---|
| public List | |
| getSelectBox | back to summary |
|---|---|
| public SelectBox | |
| hide | back to summary |
|---|---|
| public void hide() | |
| newList | back to summary |
|---|---|
| protected List Allows a subclass to customize the select box list. The default implementation returns a list that delegates
| |
| setStage | back to summary |
|---|---|
| protected void setStage(Stage stage) Overrides com. Doc from com. Called by the framework when this actor or any ascendant is added to a group that is in the stage. | |
| show | back to summary |
|---|---|
| public void show(Stage stage) | |
SelectBox.
| Modifier and Type | Field and Description |
|---|---|
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Color | |
| public BitmapFont | |
| public Color | |
| public List. | |
| public Color | |
| public ScrollPane. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SelectBoxStyle(BitmapFont font, Color fontColor, Drawable background, ScrollPane.
|
| public |
| background | back to summary |
|---|---|
| public Drawable background
| |
| backgroundDisabled | back to summary |
|---|---|
| public Drawable backgroundDisabled
| |
| backgroundOpen | back to summary |
|---|---|
| public Drawable backgroundOpen
| |
| backgroundOver | back to summary |
|---|---|
| public Drawable backgroundOver
| |
| disabledFontColor | back to summary |
|---|---|
| public Color disabledFontColor
| |
| font | back to summary |
|---|---|
| public BitmapFont font | |
| fontColor | back to summary |
|---|---|
| public Color fontColor | |
| listStyle | back to summary |
|---|---|
| public List. | |
| overFontColor | back to summary |
|---|---|
| public Color overFontColor
| |
| scrollStyle | back to summary |
|---|---|
| public ScrollPane. | |
| SelectBoxStyle | back to summary |
|---|---|
| public SelectBoxStyle() | |
| SelectBoxStyle | back to summary |
|---|---|
| public SelectBoxStyle(BitmapFont font, Color fontColor, Drawable background, ScrollPane. | |
| SelectBoxStyle | back to summary |
|---|---|
| public SelectBoxStyle(SelectBox. | |