ChangeForm: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
ChangeForm(''newForm'')
ChangeForm(''newForm''[, ''hideEffect''[, ''showEffect[, speed]]])


== Description ==
== Description ==
''Visual effects added in AppStudio 5.''


ChangeForm hides the current form and shows ''newForm''. When the current form is hidden, its onhide() function is called. When the new form shows, its onshow() function is called. The global variable [[NSBCurrentForm]] is set to ''newForm''.
ChangeForm hides the current form and shows ''newForm''. When the current form is hidden, its onhide() function is called. When the new form shows, its onshow() function is called. The global variable [[NSBCurrentForm]] is set to ''newForm''.
''hideEffect'' is the effect to use to hide the old form. It can be 'fade' or 'slide'.
''showEffect'' is the effect to use to show the new form. It can be 'fade' or 'slide'. If ''showEffect'' is not specified, it will be the same as ''hideEffect''.
''speed'' is the time to perform the effect. It can be 'slow', 'fast' or number of milliseconds. If it is not supplied, it will take 400 milliseconds, just less than half a second.


== Example (Basic) ==
== Example (Basic) ==

Revision as of 12:57, 6 April 2015

ChangeForm(newForm[, hideEffect[, showEffect[, speed]]])

Description

Visual effects added in AppStudio 5.

ChangeForm hides the current form and shows newForm. When the current form is hidden, its onhide() function is called. When the new form shows, its onshow() function is called. The global variable NSBCurrentForm is set to newForm.

hideEffect is the effect to use to hide the old form. It can be 'fade' or 'slide'.

showEffect is the effect to use to show the new form. It can be 'fade' or 'slide'. If showEffect is not specified, it will be the same as hideEffect.

speed is the time to perform the effect. It can be 'slow', 'fast' or number of milliseconds. If it is not supplied, it will take 400 milliseconds, just less than half a second.

Example (Basic)

Rem ChangeForm sample call

ChangeForm(Form2)             

Function Form1_onhide()
  MsgBox "Old Form Hidden"
End Function

Function Form2_onshow()
  Msgbox "Show form " & NSBCurrentForm.id
End Function

Use a variable to change forms:

  ChangeForm(window["Form" & i])

Example (JavaScript)

//ChangeForm sample call

ChangeForm(Form2);

Form1.onhide = function() {
  alert("Old Form Hidden");
}

Form2.onshow = function() {
  alert("Show form " +  NSBCurrentForm.id);
}

Output

(msgbox showing "Old Form Hidden")

(msgbox showing "Show form Form2")

Related Items

Form