SMS messaging objects  Chapter 16: Managing the Database

Chapter 15: Working with Native Objects and Controls for Windows CE Devices

Toolbar control

Description

The Toolbar control lets you add picture buttons to a menu for your PocketBuilder applications.

Usage

You add a Toolbar control to a window or user object using the Insert>Control>Toolbar menu item, or by selecting the Toolbar icon in PainterBar1 and clicking inside the window or user object.

You can add toolbar items to the Toolbar control on the Items page of the Properties view for the control. You can also create ToolbarItem objects in script:

ToolbarItem myItem
Integer li_rtn

li_rtn = tlbr_myToolBar.AddPicture ("pic1.bmp")
li_rtn = tlbr_myToolBar.AddPicture ("addwatch!")
tlbr_myToolBar.visible = true
myitem.itemstate = 4myitem.itemgroup = 0myitem.itempictureindex = 1myitem.itemstyle = stylebutton!li_rtn = tlbr_mytoolbar.AddItem(myItem)
myitem.itempictureindex = 2myitem.itemstyle = stylecheck!li_rtn = tlbr_mytoolbar.AddItem(myItem)

Typically you would use the PocketBuilder UI to add a visual user object, because events that are associated with a visual user object are not available when the object is instantiated in script. Since there are no events on a ToolbarItem object, the only disadvantage to using script to add a toolbar item object is one of convenience; however, tapping an item in a Toolbar control triggers a Clicked event on the control. To take advantage of this Toolbar control event, you must create the Toolbar control in the UI, even if you add toolbar items in script.

For more information

Properties and functions of the Toolbar control and ToolbarItem objects are described in the PowerScript Reference and in the online Help.





Copyright © 2004. Sybase Inc. All rights reserved. Chapter 16: Managing the Database

View this book as PDF