FvButton class adds Fever features to basic
JButton class.
var button : FvButton = new FvButton( "click me please" ); button.setSoundID( "click" ); button.setShortcut( new KeyCombo( Keyboard.onKeyCONTROL, Keyboard.onKeyO ), "myKeyMap" ); button.setToolTipText( "open file" ); button.addActionListener( _onClick, this );
You can use auto label shortcut definition too : ( passing null as
key argument :
var button : FvButton = new FvButton( "click &me please" ); button.setShortcut( null, "myKeyMap" ); button.setToolTipText( "open file" ); button.addActionListener( _onClick, this );
static public DEFAULT_CLICK_SOUND:StringSound is not automatically added to button behaviour, use setSoundID() method to declare it.
Example
var b : FvButton = new FvButton( "simple button" ); b.setSoundID( FvButton.DEFAULT_CLICK_SOUND );
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 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.
public function getTooltipTextWithoutShortcut():StringReturns tooltips without shortcut caption.