Skip to content

class_optionbutton

reduz edited this page Feb 23, 2014 · 9 revisions

OptionButton

####Inherits: Button ####Category: Core

Brief Description

Button control that provides selectable options when pressed.

Member Functions

Signals

  • item&#95selected ( int ID )

Description

OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text.

Member Function Description

  • void add&#95item ( String label, int id=-1 )

Add an item, with text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.

Add an item, with a "texture" icon, text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.

  • void set&#95item&#95text ( int idx, String text )

Set the text of an item at index "idx".

  • void set&#95item&#95icon ( int idx, Texture texture )

Set the icon of an item at index "idx".

  • void set&#95item&#95ID ( int idx, int id )

Set the ID of an item at index "idx".

  • String get&#95item&#95text ( int idx ) const

Return the text of the item at index "idx".

Return the icon of the item at index "idx".

  • int get&#95item&#95ID ( int idx ) const

Return the ID of the item at index "idx".

  • int get&#95item&#95count ( ) const

Return the amount of items in the OptionButton.

  • void add&#95separator ( )

Add a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end.

  • void clear ( )

Clear all the items in the OptionButton.

  • void select ( int arg0 )

Select an item by index and make it the current item.

  • int get&#95selected ( ) const

Return the current item index

Clone this wiki locally