Class fvaswing.components.FvInputComponentDialog

Description

Opens a dialog with a custom component as input controller.

Example using a FvSliderInput component.
Use FvInputComponentDialog singleton design.

 
   var input : FvSliderInput = new FvSliderInput( true ); // rounded bounded range enabled.
   input.setMinimum( 1900 );
   input.setMaximum( 2100 );
   input.setValue( ( new Date() ).getFullYear() );
   
   FvInputComponentDialog.show( input, "Choose your year", this, _onInputResult );
 

or with classic instanciation :

 
   var input : FvSliderInput = new FvSliderInput( true ); // rounded bounded range enabled.
   input.setMinimum( 1900 );
   input.setMaximum( 2100 );
   input.setValue( ( new Date() ).getFullYear() );
   
   var dialog : FvInputComponentDialog = new FvInputComponentDialog( input );
   dialog.open( "Choose your year", this, _onInputResult );
 

Field Index

buttonWidth, onInputResultEVENT

Method Index

new FvInputComponentDialog()
getInput(), open(), show()

Constructor Detail

FvInputComponentDialog

public function FvInputComponentDialog(input:FvInputComponent)

Constructor.

Field Detail

onInputResultEVENT

static public onInputResultEVENT:EventType
Event type broadcasted when user click on submit button.

buttonWidth

static public buttonWidth:Number
Width of each button, in pixels.

Method Detail

show

static public function show(input:FvInputComponent, label:String, listener, f:Function):FvInputComponentDialog

Uses always same FvInputComponentDialog instance swapping input component with passed-in input one.

Parameters

inputFvInputComponent component
labelText label do display
listenerListener or callback context

getInput

public function getInput():FvInputComponent

Returns current input component.

open

public function open(label:String, listener, f:Function):Void

Opens the input dialog.

Various way to open an input dialog :

  • FvInputDialog.getInstance().open( "What is your name ?", this, _onResult );
  • FvInputDialog.getInstance().open( "What is your name ?", this, _onResult, "param" );
  • FvInputDialog.getInstance().open( "What is your name ?", this );
  • FvInputDialog.getInstance().open( "What is your name ?", Delegate.create( this, _onResult ) );
  • FvInputDialog.getInstance().open( "What is your name ?", Delegate.create( this, _onResult, "param" ) );

Parameters

labelMessage to indicate which type of information we want
listenerListener object
f( optional ) listener callback to activate on result.

If omitted, listener must have a onInputResultEVENT event handler.