Button: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
:'''Classic                         jQuery Mobile'''
:'''Classic                         jQuery Mobile'''


'''Description'''
== Description ==


The Button is used to display a standard button object.
The Button is used to display a standard button object.
Line 18: Line 18:
</pre>
</pre>


'''Properties and Methods'''
== Properties and Methods ==


Standard [[properties and methods|properties]] are supported, plus:
Standard [[properties and methods|properties]] are supported, plus:
Line 34: Line 34:
|}
|}


'''Events'''
== Events ==


Standard [[events|events]] are supported. For this control, the onclick event will be most useful.
Standard [[events|events]] are supported. For this control, the onclick event will be most useful.


'''Example'''
== Example ==


<pre>
<pre>
REM Button Example
Rem Button Example
Function Button1_onclick()
Function Button1_onclick()
   Msgbox "Hello World"
   Msgbox "Hello World"
Line 47: Line 47:
</pre>
</pre>


'''Output'''
== Output ==


[[file:HelloWorld.jpg]]
[[file:HelloWorld.jpg]]
[[Category:Language Reference]]

Revision as of 04:42, 17 August 2012

Classic                         jQuery Mobile

Description

The Button is used to display a standard button object.

While a variety of different events are available, the usual response to clicking a Button is to call the function <buttonID>_onclick().

To add a button to your app, choose the Button icon in the Toolbar, then position it on the Design Screen. Use the Property Editor to set the properties you need, then add functions to your code to respond to the events that come from the button: usually, just onclick.

To change the text of a button at runtime, do one of the following:

  Button1.text = "New Value"                      'Classic
  $("#Button1 .ui-btn-text").text("New Value ")   'jQuery Mobile

Properties and Methods

Standard properties are supported, plus:

groupBegin If you have a group of buttons, set this to Yes on the first one. jQuery Mobile only.
groupEnd If you have a group of buttons, set this to Yes on the last one. jQuery Mobile only.
icon Set to false for no icon. You have a choice of 18 standard icons otherwise. jQuery Mobile only.
iconPos Position of the icon. Can be none, left, right, top, bottom or notext. jQuery Mobile only.
value The title of the button.

Events

Standard events are supported. For this control, the onclick event will be most useful.

Example

Rem Button Example
Function Button1_onclick()
  Msgbox "Hello World"
End Function

Output