NavBar: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
No edit summary
Brendon (talk | contribs)
No edit summary
Line 1: Line 1:
[[file:NavBar.jpg]]
[[file:NavBar.jpg]]


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


The Navbar control puts up to 5 buttons anyplace on the form. Buttons can be text, an icon or both. When clicked, <NavBarID>_onclick(''choice'') is called. The name of the button which is called is in ''choice''.
The Navbar control puts up to 5 buttons anyplace on the form. Buttons can be text, an icon or both. When clicked, <NavBarID>_onclick(''choice'') is called. The name of the button which is called is in ''choice''.
Line 7: Line 7:
To add a control to your app, choose the control’s 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 control: usually, just onclick.
To add a control to your app, choose the control’s 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 control: usually, just onclick.


'''Properties'''
== Properties ==


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


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


Standard [[events]] are supported. However, events are not usually associated with the control.
Standard [[events]] are supported. However, events are not usually associated with the control.


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


<pre>
<pre>
Line 32: Line 32:
</pre>
</pre>


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


<pre>
<pre>
(message box showing “Button pressed: 1”)
(message box showing “Button pressed: 1”)
</pre>
</pre>
[[Category:Language Reference]]

Revision as of 16:48, 17 August 2012

Description

The Navbar control puts up to 5 buttons anyplace on the form. Buttons can be text, an icon or both. When clicked, <NavBarID>_onclick(choice) is called. The name of the button which is called is in choice.

To add a control to your app, choose the control’s 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 control: usually, just onclick.

Properties

Standard properties are supported, plus:

items A list of names for the buttons, comma separated.
iconPos The position of the icon. Can be none, top, bottom, left, right or notext.
icons Names of icons for each button. 18 to choose from: alert, arrow-d, arrow-l ,arrow-r, arrow-u ,back, check, delete, forward, gear, grid, home, info, minus, plus, refresh, search, star.

Events

Standard events are supported. However, events are not usually associated with the control.

Example

Function NavBar_jqm1_onclick(choice)
  If TypeName(choice)="object" Then Exit Function
  MsgBox "Button pressed: " & choice
End Function

Output

(message box showing “Button pressed: 1”)