Package | gs.display.view |
Class | public class BaseFormView |
Inheritance | BaseFormView ![]() ![]() ![]() |
Subclasses | BaseErrorView |
Property | Defined by | ||
---|---|---|---|
cancelButton : MovieClip
A cancel button.
| BaseFormView | ||
confirmButton : MovieClip
A confirm button.
| BaseFormView | ||
![]() | controller : *
A controller for this view.
| BaseView | |
deleteButton : MovieClip
A delete button.
| BaseFormView | ||
errorViews : MovieClip
A container for BaseErrorView's to show and hide
during validation.
| BaseFormView | ||
noButton : MovieClip
A no button.
| BaseFormView | ||
okButton : MovieClip
An ok button.
| BaseFormView | ||
onCancel : Function
A function delegate you should use and call
when the user cancels the form operation and
any validation has passed.
| BaseFormView | ||
onConfirm : Function
A function delegate you should use and call
when the user confirms the form operation and
any validation has passed.
| BaseFormView | ||
onDelete : Function
A function delegate you should use and call
when the user agrees to delete (something) and
any validation has passed.
| BaseFormView | ||
onNo : Function
A function delegate you should use and call
when the user declines the form operation and
any validation has passed.
| BaseFormView | ||
onOK : Function
A function delegate you should use and
call when the user ok's a form operatoin
and any validation has passed.
| BaseFormView | ||
onYes : Function
A function delegate you should use and call
when the user agrees to the form operation and
any validation has passed.
| BaseFormView | ||
![]() | stage : Stage
StageRef.stage (gs.util.StageRef)
| GSClip | |
yesButton : MovieClip
A yes button.
| BaseFormView |
Method | Defined by | ||
---|---|---|---|
Constructor for CoreFormView instances.
| BaseFormView | ||
![]() |
dispose():void
Override this method and write your own dispose logic.
| BaseView | |
hide():void
Hide this form view - this calls removeKeyMappings()
and deselectField().
| BaseFormView | ||
hideButtons():void
Hide's any form buttons that are currently visible.
| BaseFormView | ||
onConfirmClick():void
Override this method, and use as the the click event
handler for a "confirm" button - validate this
form and then call the onConfirm delegate function.
| BaseFormView | ||
onDeleteClick():void
Override this method, and use as the the click event
handler for a "delete" button - validate this
form and then call the onDelete delegate function.
| BaseFormView | ||
onNoClick():void
Override this method, and use as the the click event
handler for a "no" button - validate this
form and then call the onNo delegate function.
| BaseFormView | ||
onOKClick():void
Override this method, and use as the click event
handler for an "ok" button - validate this
form and then call the onOK delegate function.
| BaseFormView | ||
onYesClick():void
Override this method, and use as the the click event
handler for a "yes" button - validate this
form and then call the onYes delegate function.
| BaseFormView | ||
show():void
Show this form view - this calls addKeyMappings()
and selectField().
| BaseFormView | ||
showButtons(buttons:uint):void
Show any button, (yes,no,confirm,delete,ok,cancel)
based off of what is or'ed (|) together - for each
button that is shown, it calls the appropriate
method (showOKButton, showYesButton, etc), which
you could override if needed.
| BaseFormView |
Method | Defined by | ||
---|---|---|---|
![]() |
addEventHandlers():void
Override this method, and use the event manager to add event handlers
on your objects.
| BaseView | |
addKeyMappings():void
Override this and add key event mappings with the
keyboard event manager.
| BaseFormView | ||
blockForInput():void
Override this method and implement a modal blocker,
which can then be called when a sub form view is shown
and this view needs to be blocked from interaction.
| BaseFormView | ||
deselectField():void
Override this and do some deselect logic for the form fields.
| BaseFormView | ||
hideCancelButton():void
Hides the cancel button.
| BaseFormView | ||
hideConfirmButton():void
Hides the confirm button.
| BaseFormView | ||
hideDeleteButton():void
Hides the delete button.
| BaseFormView | ||
hideNoButton():void
Hides the no button.
| BaseFormView | ||
hideOKButton():void
Hides the ok button.
| BaseFormView | ||
hideYesButton():void
Hides the yes button.
| BaseFormView | ||
![]() |
init():void
Initialize this view - called from the constructor.
| BaseView | |
![]() |
onActivate():void
Override this method to hook into the activate event.
| BaseView | |
![]() |
onAddedToStage():void
Override this method to hook into the added to stage event.
| BaseView | |
![]() |
onDeactive():void
Override this method to hook into the deactivate event.
| BaseView | |
![]() |
onMouseLeave():void
A method you can override to hook into the mouse
leve event.
| BaseView | |
![]() |
onRemovedFromStage():void
Override this method to hook into the removed from stage event.
| BaseView | |
![]() |
onResize():void
Override this method to hook into resize events from the stage.
| BaseView | |
![]() |
removeEventHandlers():void
Override this method, and remove events from objects that were registered
with the event manager.
| BaseView | |
removeKeyMappings():void
Override this and remove key event mappings with the
keyboard event manager.
| BaseFormView | ||
selectField():void
Override this and do some select/focus logic for the form field.
| BaseFormView | ||
showCancelButton():void
Shows the cancel button, (sets visible to true),
override to use something other than visible.
| BaseFormView | ||
showConfirmButton():void
Shows the confirm button, (sets visible to true),
override to use something other than visible.
| BaseFormView | ||
showDeleteButton():void
Shows the delete button, (sets visible to true),
override to use something other than visible.
| BaseFormView | ||
showNoButton():void
Shows the no button, (sets visible to true),
override to use something other than visible.
| BaseFormView | ||
showOKButton():void
Shows the ok button, (sets visible to true),
override to use something other than visible.
| BaseFormView | ||
showYesButton():void
Shows the yes button, (sets visible to true),
override to use something other than visible.
| BaseFormView | ||
unblockFromInput():void
Override this method, and disable a modal blocker.
| BaseFormView | ||
validate():Boolean
Override this and do some form validation.
| BaseFormView |
Constant | Defined by | ||
---|---|---|---|
CANCEL_BTN : int = 1 [static]
The mask that turns on the cancel button.
| BaseFormView | ||
CONFIRM_BTN : int = 4 [static]
The mask that turns on the confirm button.
| BaseFormView | ||
DELETE_BTN : int = 32 [static]
The mask that turns on the delete button.
| BaseFormView | ||
NO_BTN : int = 16 [static]
The mask that turns on the no button.
| BaseFormView | ||
OK_BTN : int = 2 [static]
The mask that turns on the ok button.
| BaseFormView | ||
YES_BTN : int = 8 [static]
The mask that turns on the yes button.
| BaseFormView |
cancelButton | property |
public var cancelButton:MovieClip
A cancel button.
confirmButton | property |
public var confirmButton:MovieClip
A confirm button.
deleteButton | property |
public var deleteButton:MovieClip
A delete button.
errorViews | property |
public var errorViews:MovieClip
A container for BaseErrorView's to show and hide during validation.
noButton | property |
public var noButton:MovieClip
A no button.
okButton | property |
public var okButton:MovieClip
An ok button.
onCancel | property |
public var onCancel:Function
A function delegate you should use and call when the user cancels the form operation and any validation has passed.
onConfirm | property |
public var onConfirm:Function
A function delegate you should use and call when the user confirms the form operation and any validation has passed.
onDelete | property |
public var onDelete:Function
A function delegate you should use and call when the user agrees to delete (something) and any validation has passed.
onNo | property |
public var onNo:Function
A function delegate you should use and call when the user declines the form operation and any validation has passed.
onOK | property |
public var onOK:Function
A function delegate you should use and call when the user ok's a form operatoin and any validation has passed.
onYes | property |
public var onYes:Function
A function delegate you should use and call when the user agrees to the form operation and any validation has passed.
yesButton | property |
public var yesButton:MovieClip
A yes button.
BaseFormView | () | constructor |
public function BaseFormView()
Constructor for CoreFormView instances.
addKeyMappings | () | method |
protected function addKeyMappings():void
Override this and add key event mappings with the keyboard event manager.
This is called when the view is shown.
blockForInput | () | method |
protected function blockForInput():void
Override this method and implement a modal blocker, which can then be called when a sub form view is shown and this view needs to be blocked from interaction.
deselectField | () | method |
protected function deselectField():void
Override this and do some deselect logic for the form fields.
This is called with the view is hidden.
hide | () | method |
public override function hide():void
Hide this form view - this calls removeKeyMappings() and deselectField().
hideButtons | () | method |
public function hideButtons():void
Hide's any form buttons that are currently visible.
hideCancelButton | () | method |
protected function hideCancelButton():void
Hides the cancel button.
hideConfirmButton | () | method |
protected function hideConfirmButton():void
Hides the confirm button.
hideDeleteButton | () | method |
protected function hideDeleteButton():void
Hides the delete button.
hideNoButton | () | method |
protected function hideNoButton():void
Hides the no button.
hideOKButton | () | method |
protected function hideOKButton():void
Hides the ok button.
hideYesButton | () | method |
protected function hideYesButton():void
Hides the yes button.
onConfirmClick | () | method |
public function onConfirmClick():void
Override this method, and use as the the click event handler for a "confirm" button - validate this form and then call the onConfirm delegate function.
public class MyFormView extends BaseFormView { public var confirm:MovieClip; public var email:TextField; public function MyFormView() { super(); } override protected function addEventHandlers():void { em.handleEvents(confirm,this,"onConfirm"); } override protected function removeEventHandlers():void { em.disposeEvents(confirm); } override protected function validate():Boolean { if(!utils.string.isemail(email.text)) { errorViews.badEmail.showAndHide(3000); //see BaseErrorView for showAndHide() return false; } return true; } override public function onConfirmClick():void { super.onConfirmClick(); //in this case, the delegate function (onConfirm) //would have to accept one parameter - an email. //This pattern is taken from apple's cocoa //framework. This type of pattern is extremly //useful, and leads to less bugs and good design. if(validate()) onConfirm(email.text); } }
onDeleteClick | () | method |
public function onDeleteClick():void
Override this method, and use as the the click event handler for a "delete" button - validate this form and then call the onDelete delegate function.
onNoClick | () | method |
public function onNoClick():void
Override this method, and use as the the click event handler for a "no" button - validate this form and then call the onNo delegate function.
onOKClick | () | method |
public function onOKClick():void
Override this method, and use as the click event handler for an "ok" button - validate this form and then call the onOK delegate function.
onYesClick | () | method |
public function onYesClick():void
Override this method, and use as the the click event handler for a "yes" button - validate this form and then call the onYes delegate function.
removeKeyMappings | () | method |
protected function removeKeyMappings():void
Override this and remove key event mappings with the keyboard event manager.
This is called when the view is hidden.
selectField | () | method |
protected function selectField():void
Override this and do some select/focus logic for the form field.
The is called when the view is shown.
show | () | method |
public override function show():void
Show this form view - this calls addKeyMappings() and selectField().
showButtons | () | method |
public function showButtons(buttons:uint):void
Show any button, (yes,no,confirm,delete,ok,cancel) based off of what is or'ed (|) together - for each button that is shown, it calls the appropriate method (showOKButton, showYesButton, etc), which you could override if needed.
Parametersbuttons:uint |
myView.showButtons(BaseFormView.OK_BTN|BaseFormView.CANCEL_BTN); myView.showButtons(BaseFormView.YES_BTN|BaseFormView.NO_BTN);
showCancelButton | () | method |
protected function showCancelButton():void
Shows the cancel button, (sets visible to true), override to use something other than visible.
showConfirmButton | () | method |
protected function showConfirmButton():void
Shows the confirm button, (sets visible to true), override to use something other than visible.
showDeleteButton | () | method |
protected function showDeleteButton():void
Shows the delete button, (sets visible to true), override to use something other than visible.
showNoButton | () | method |
protected function showNoButton():void
Shows the no button, (sets visible to true), override to use something other than visible.
showOKButton | () | method |
protected function showOKButton():void
Shows the ok button, (sets visible to true), override to use something other than visible.
showYesButton | () | method |
protected function showYesButton():void
Shows the yes button, (sets visible to true), override to use something other than visible.
unblockFromInput | () | method |
protected function unblockFromInput():void
Override this method, and disable a modal blocker.
validate | () | method |
protected function validate():Boolean
Override this and do some form validation.
ReturnsBoolean |
CANCEL_BTN | constant |
public static const CANCEL_BTN:int = 1
The mask that turns on the cancel button.
CONFIRM_BTN | constant |
public static const CONFIRM_BTN:int = 4
The mask that turns on the confirm button.
DELETE_BTN | constant |
public static const DELETE_BTN:int = 32
The mask that turns on the delete button.
NO_BTN | constant |
public static const NO_BTN:int = 16
The mask that turns on the no button.
OK_BTN | constant |
public static const OK_BTN:int = 2
The mask that turns on the ok button.
YES_BTN | constant |
public static const YES_BTN:int = 8
The mask that turns on the yes button.