Label act as a button.
Thanks to iiley for this class, you can retreive it in Aswing extension page
named XLabelButton :
http://www.aswing.org/display/AsWing/XLabelButton
FvLabelButton class is defined here to avoid mulitple different classes location.
Fever feature like :
var button : FvLabelButton = new FvLabelButton( "click me please" ); button.setSoundID( "click" ); button.setShortcut( new KeyCombo( Keyboard.onKeyCONTROL, Keyboard.onKeyO ) ); button.setToolTipText( "open file" ); button.addActionListener( _onClick, this );
You can use auto label shortcut definition too : ( passing null as
key argument :
var button : FvLabelButton = new FvLabelButton( "click &me please" ); button.setShortcut( null, "myKeyMap" ); button.setToolTipText( "open file" ); button.addActionListener( _onClick, this );
new FvLabelButton()public function FvLabelButton(caption, icon, horizontalAlignment:Number)
FvLabelButton( text : String, icon : Icon, horizontalAlignment : Number )
FvLabelButton( text : String, icon : Icon )
FvLabelButton( text : String, horizontalAlignment : Number)
FvLabelButton( text : String )
FvLabelButton( icon : Icon, horizontalAlignment : Number)
FvLabelButton( icon : Icon )
FvLabelButton()
public function setContent(caption:String, icon:Icon):VoidSets text and icon at one method here.
icon | the default icon for the label |
public function setText(caption:String):VoidSets button label.
Checks if passed-in caption contains SHORTCUT_CHAR.
If true automatically build a new shortcut for button.
caption | Button label |
public function getText():String
Returns button label.
Without any shortcut marker ( if present )
public function setSoundID(soundID:String):VoidSets sound id to play when user click on button.
Sounds id is searched in current AppSoundFactory factory.
public function addActionListener(fuc:Function, obj:Object):Object
addActionListener(fuc:Function, obj:Object)
addActionListener(fuc:Function)
Adds a action listener to this button. Buttons fire a action event when user released on it.
fuc | the listener function. |
the listener just added.
public function setNormalColor(color:ASColor):VoidSets foreground color for "normal" button state.
public function getNormalColor():ASColorReturns foreground color for "normal" button state.
public function setHightlightColor(color:ASColor):VoidSets foreground color for "hightlight" button state.
public function getHightlightColor():ASColorReturns foreground color for "hightlight" button state.
public function setDisabledColor(color:ASColor):VoidSets foreground color for "disabled" button state.
public function getDisabledColor():ASColorReturns foreground color for "disabled" button state.
public function setShortcut(key:KeyDefinition, keymapID:String):VoidSets new key shortcut to button.
Pass key == null to enable built-in label shortcut
definition.
public function setLocalisationID(nodeID:String):VoidConnects button to localisation API.
nodeID | Full qualified node path to translation node in local file |
public function setToolTipText(caption:String):VoidRegisters the text to display in a tool tip.
Take care if a shortcut is defined.
If true add '( shortcut name )' at the end of tooltip.