A List allows the user to select one or more items from a list. Each list item contains a text string, a bitmap graphic, or both.
The following looks are available:
Standard Properties: class, enabled, height, left, look, parent, proto, sizeHControl, sizeVControl, top, version, visible, width.
list1.captions[list1.numItems] = "Last Minute Addition"
You may take advantage of this behavior to add several list items at a time:
list1.captions[list1.numItems + 9] = "Longstocking"
...would create 10 new list items, the first nine having blank captions,
the last one having the caption "Longstocking."
To add a new list item in the middle of the list, use the
Insert( ) action.
_changed( self AS component, index AS integer )
This event is generated when the user clicks on a list item, causing that list item to be selected or unselected. Not all clicks result in a change of selection--only those clicks that do will generate this event.
Clear( )
This action deletes all items from the List.
Nothing.
Delete( index AS integer )
This action deletes an item from the List.
If this deletes the selected item in an exclusive list (i.e., a list with behavior of 1), then the first list item, if any, will get the selection.
(To blank out a list item's string without deleting the item, set the appropriate element of the captions array to ".")
Insert( index AS integer, caption AS string )
This action inserts an item into the List. To add a new item to the end of the list, you can just use the captions property.
A Popup is a special sort of group. It has a collapsed state in which it doesn't show its children, but only its caption and/or graphic. The user can make the group "pop up" so that it shows its children.
A Picture displays a picture.
Standard Properties: classsizeHControl, sizeVControl: Only SIZE_AS_NEEDED and SIZE_AS_SPECIFIED are supported.
None.
None.
Only one look is supported.
Standard Properties: caption, children, enabled, height, left, look, numChildren, sizeHControl, sizeVControl, tile, tileHAlign, tileHInset, tileLayout, tileSpacing, tileVAlign, tileVInset, top, version, visible, width.
_aboutToClose( self AS popup )
This event is generated when the user has finished with the Popup, and the Popup is about to collapse.
_aboutToOpen( self AS popup )
This event is generated when the user has clicked on the Popup, and the Popup is about to open to reveal its children.
None.
The PrintControl provides a user interface component that creates a "Print..." button to initiate a default user print dialog.
None.
This action prints the current output. Sending this action is equivalent to pressing the print button in the print dialog.
This action initiates the print dialog.
This action cancels the current print job.
This action is sent by the output object (often during its _draw event) to specify that printing is complete.
Scrollbars are typically used to allow the user to scroll a window onto a document or control the data displayed by a table component.
No Scrollbar may be the child of a Clipper, nor the child of a child of a Clipper, etc.
There are two main ways that programs use Scrollbars:
A Scrollbar working with a Text or Table component, will use the concept of rows of cells or lines of text; the Scrollbar's value should reflect a row or line number. If the number of rows/lines changes, you'll probably want an event handler that looks something like the following handler for a text component's _numLinesChanged( ) event:
SUB text1_numLinesChanged( self AS text )
scrollbar1.maximum = self.numLines
scrollbar1.thumbSize = self.lastVisibleLine - self.firstVisibleLine + 1
END SUB
SUB scrollbar1_changed( self AS scrollbar, scrollType AS integer )
text1.firstVisibleLine = self.value
END SUB
A Scrollbar which vertically re-positions the child of a clipper would probably be set up something like this:
sub module_init( )
scrollbar1.maximum = childOfClipper.height
scrollbar1.thumbSize = clipper1.height
end sub
SUB scrollbar1_changed( self AS scrollbar, scrollType AS integer )
childOfClipper.top = -self.value
END SUB
The following looks are available:
Standard Properties: enabled, height, left, sizeHControl, sizeVControl, parent, proto, top, version, visible, width.
_changed( self AS component, scrollType AS integer )
This event is generated when the user interacts with the Scrollbar, either tapping a button, tapping the Scrollbar itself, or dragging the thumb (the part of the scrollbar which slides up and down). (If the notifyDrag property is 0, this event is generated when the user releases the thumb. If notifyDrag is 1, the event is generated with each movement of the thumb, but is not generated when the thumb is released.)
This event is only generated as the direct result of the user interacting with the Scrollbar--it won't be generated each time your BASIC code changes the Scrollbar's value property.
When this event is generated, the Scrollbar's value property will already reflect changes made by the user.
None.
The sound component allows your program to emit beeps and whistles. There is a sound component in the system module. To access it, do something like that shown in the following example:
system:sound!StandardSound( SS_ERROR )
Standard Properties: class, parent, proto, version.
None
StandardSound( standardSound AS integer )
This action plays a "standard sound," one of the standard error or warning beeps.
Any other value will sound like SS_ERROR.
The spacer does nothing more than occupy screen space, separating other components.
Standard Properties: class, height, left, look, parent, proto, sizeHControl, sizeVControl, top, version, visible, width.
None.
None.
The Sprite component gives the NewBASIC programmer the power to create vivid animations and video game quality motion. A sprite stores separate graphic images in a frame array of draw components.
None.
setframe(frameNum as integer, graphic as long) as integer
This action sets the given frame in the frame array to the given graphic.
getframe(frameNum as integer) as long
This action returns the frame at the given offset.
dim draw1 as component
draw1 = MakeComponent("draw","top")
draw1.start( )
draw1.moveto(0,3)
draw1.lineto(2,-2)
draw1.lineto(0,0)
draw1.lineto(-2,-2)
draw1.lineto(0,3)
draw1.stop( )
dim spriteWin as component
spriteWin = MakeComponent("spriteContent","top")
spriteWin.visible = 1
dim sprite1 as component
sprite1 = MakeComponent("sprite",spriteWin)
sprite1.imageCount = 1
sprite1.x = 10
sprite1.y = 10
sprite1.rotation = 2
sprite1.setframe(0,draw1)
spriteWin.start( )
The SpriteContent component acts as the parent to which sprite components are added. The component also controls game flow.
None.
None.
start( ) as integer
This action starts animation within a spriteContent.
pause( ) as integer
This action pauses animation within a spriteContent.