u_toolbar


Ancestor UserObject

Hierarchy
  • u_toolbar
    • UserObject
Author None

Library toolbar.pbl

Description The toolbar can build itself from the menu properties of the window it is placed up or can be programmed to generate specific toolbar buttons.

Usage

Model
u_toolbar
//
Private:
window iwindow // points to the window this is on.
// A count and an array of toolbuttons
integer ii_buttonTotal = 0
u_toolbutton itbn_toolbutton[]

//
integer ii_pixelBarHeight = 28
integer ii_pixelButtonHeight = 22
integer ii_pixelButtonWidth = 23

integer ii_pixelPictureHeight = 16
integer ii_pixelPictureWidth = 16

string is_prefix

// Everything following here is Rui's tooltip stuff

// Misc Constants
CONSTANT string TOOLTIPS_CLASS = 'tooltips_class32'
CONSTANT ulong CW_USEDEFAULT = 2147483648
CONSTANT long WM_USER = 1024
CONSTANT long WS_EX_TOPMOST = 8
CONSTANT long WM_SETFONT = 48

// ToolTip Messages
CONSTANT long TTM_ADDTOOL = WM_USER + 4
CONSTANT long TTM_NEWTOOLRECT = WM_USER + 6
CONSTANT long TTM_RELAYEVENT = WM_USER + 7
CONSTANT long TTM_UPDATETIPTEXT = WM_USER + 12
CONSTANT long TTM_TRACKACTIVATE = WM_USER + 17
CONSTANT long TTM_TRACKPOSITION = WM_USER + 18

// Public variables and constants
Public:
long hWndTT // Tooltip control window handle
long ToolID = 1 // Tooltip internal ID

// Tooltip flags
CONSTANT integer TTF_CENTERTIP = 2
CONSTANT integer TTF_RTLREADING = 4
CONSTANT integer TTF_SUBCLASS = 16
CONSTANT integer TTF_TRACK = 32
CONSTANT integer TTF_ABSOLUTE = 128
CONSTANT integer TTF_TRANSPARENT = 256
CONSTANT integer TTF_DI_SETITEM = 32768
of_tb_addButton (as_name, as_bitmap, as_tooltip, ai_position) returns u_toolbutton
of_tb_addButton (as_name, as_bitmap, as_tooltip, ai_position, ab_enabled, ab_visible, ab_checked, ai_spacebefore) returns u_toolbutton
of_tb_draw () returns (none)
of_tb_getChecked (as_name) returns boolean
of_tb_getEnabled (as_name) returns boolean
of_tb_getFilePrefix () returns string
of_tb_getMouseOffExtension () returns string
of_tb_getSpaceBefore (as_name) returns integer
of_tb_getVisible (as_name) returns boolean
of_tb_getWindow () returns window
of_tb_readFromMenu () returns (none)
of_tb_setBitmap (amenu, as_filename) returns (none)
of_tb_setButtonStyle (ai_buttonpixelwidth, ai_buttonpixelheight, ai_picturepixelwidth, ai_picturepixelheight, as_prefix) returns (none)
of_tb_setChecked (amenu, ab_checked) returns (none)
of_tb_setChecked (as_name, ab_checked) returns (none)
of_tb_setEnabled (amenu, ab_enabled) returns (none)
of_tb_setEnabled (as_name, ab_enabled) returns (none)
of_tb_setmouseoffextension (as_mouseoffextension) returns (none)
of_tb_setRedraw (ab_redraw) returns (none)
of_tb_setSpacebefore (amenu, ai_spacebefore) returns (none)
of_tb_setSpacebefore (as_name, ai_spacebefore) returns (none)
of_tb_setvisible (amenu, ab_visible) returns (none)
of_tb_setVisible (as_name, ab_visible) returns (none)
pf_menuToToolbar (menu amenu) returns (none)
pf_positionButtons () returns (none)
pf_sizebuttons () returns (none)

Functions

of_tb_addButton

Description Add a toolbar button to the toolbar with enabled and visible defaulting to true, checked defaulting to false and spacebefore defaulting to zero.
Return u_toolbutton
The toolbutton object created by this function.
Access public
Arguments
Argument DataType Description
as_name string An identifying string for the toolbar button
as_bitmap string The full filename for the standard size enabled butmap to display on the toolbutton
as_tooltip string The popup tooltip to display when the mouse is over this button.
ai_position integer The left to right order in which the button is to be placed on the toolbar.

Usage None

of_tb_addButton

Description Add a toolbar button to the toolbar with enabled and visible defaulting to true, checked defaulting to false and spacebefore defaulting to zero.
Return u_toolbutton
The toolbutton object created by this function.
Access public
Arguments
Argument DataType Description
as_name string An identifying string for the toolbar button
as_bitmap string The full filename for the standard size enabled butmap to display on the toolbutton
as_tooltip string The popup tooltip to display when the mouse is over this button.
ai_position integer The left to right order in which the button is to be placed on the toolbar.
ab_enabled boolean Indicates if the button is to available on creation.
ab_visible boolean Indicates if the button is to visible on creation.
ab_checked boolean Indicates if the button is to checked down on creation.
ai_spacebefore integer Indicates the amount of space to appear between the previous button and the new button created.

Usage None

of_tb_draw

Description Draw the toolbar together with all the buttons. Before this function is called, the buttons must first be created using of_tb_readFromMenu() or of_tb_addButton()
Return (none)
Access public
Arguments None
Usage None

of_tb_getChecked

Description Determine if a toolbar button is currently checked
Return boolean
TRUE if the toolbar button is currently checked
Access public
Arguments
Argument DataType Description
as_name string The identifying string of the toolbar button to test

Usage None

of_tb_getEnabled

Description Determine if a toolbar button is currently enabled
Return boolean
TRUE if the toolbar button is currently enabled
Access public
Arguments
Argument DataType Description
as_name string The identifying string of the toolbar button to test

Usage None

of_tb_getFilePrefix

Description Return the file prefix currently set for the toolbar. The file prefix is used to differentiate filenames for bitmaps if different syles of bitmap are available within the same application. For example if a file prefix of "large-" is currently set then "c:\mydoc\open.bmp" will be translated to "c:\mydoc\large-open.bmp" before the bitmap is loaded.
Return string
The current file prefix
Access public
Arguments None
Usage None

of_tb_getMouseOffExtension

Description Return the extension string currently appended to images not under the mouse
Return string
The filename extension string
Access public
Arguments None
Usage None

of_tb_getSpaceBefore

Description Determine the spacebefore value of a toolbar button
Return integer
The space before value
Access public
Arguments
Argument DataType Description
as_name string The identifying string of the toolbar button to test

Usage None

of_tb_getVisible

Description Determine if a toolbar button is currently visible
Return boolean
TRUE if the toolbar button is currently visible
Access public
Arguments
Argument DataType Description
as_name string The identifying string of the toolbar button to test

Usage None

of_tb_getWindow

Description Get a pointer to the window the toolbar is on
Return window
The window contining the toolbar
Access public
Arguments None
Usage None

of_tb_readFromMenu

Description Finds the menu attached to the window. For every menu item in the menu with a toolbar setup, a toolbar button is created on the window.
Return (none)
Access public
Arguments None
Usage None

of_tb_setBitmap

Description Change the standard bitmap of a toolbar button attached to a menu item.
Return (none)
Access public
Arguments
Argument DataType Description
amenu menu The menu item of the toolbar button to change.
as_filename string The new standard bitmap filename. The filename should always be supplied as the enabled bitmap regardless of any current style settings.

Usage None

of_tb_setButtonStyle

Description Set the style of bitmap to be drawn on the next of_tb_draw() call.
Return (none)
Access public
Arguments
Argument DataType Description
ai_buttonpixelwidth integer
ai_buttonpixelheight integer
ai_picturepixelwidth integer
ai_picturepixelheight integer
as_prefix string

Usage None

of_tb_setChecked

Description Change the checked status of a toolbar button and the menu item that the toolbar button represents.
Return (none)
Access public
Arguments
Argument DataType Description
amenu menu The menu item that the toolbar represents.
ab_checked boolean The new checked status.

Usage None

of_tb_setChecked

Description Change the checked status of a toolbar button not representing a menu item..
Return (none)
Access public
Arguments
Argument DataType Description
as_name string The identifying name of the toolbar button.
ab_checked boolean The new checked status.

Usage None

of_tb_setEnabled

Description Change the enabled status of a toolbar button and the menu item that the toolbar button represents.
Return (none)
Access public
Arguments
Argument DataType Description
amenu menu The menu item that the toolbar represents.
ab_enabled boolean The new enabled status.

Usage None

of_tb_setEnabled

Description Change the enabled status of a toolbar button not representing a menu item..
Return (none)
Access public
Arguments
Argument DataType Description
as_name string
ab_enabled boolean

Usage None

of_tb_setmouseoffextension

Description Change the enabled status of a toolbar button not representing a menu item..
Return (none)
Access public
Arguments
Argument DataType Description
as_mouseoffextension string

Usage None

of_tb_setRedraw

Description Call setredraw of all windows containing toolbars
Return (none)
Access public
Arguments
Argument DataType Description
ab_redraw boolean The redraw status to set.

Usage None

of_tb_setSpacebefore

Description Change the spacebefore property of a toolbar button and the menu item that the toolbar button represents.
Return (none)
Access public
Arguments
Argument DataType Description
amenu menu The menu item that the toolbar represents.
ai_spacebefore integer The new spacebefore value.

Usage None

of_tb_setSpacebefore

Description Change the spacebefore property of a toolbar button not representing a menu item..
Return (none)
Access public
Arguments
Argument DataType Description
as_name string The identifying name of the toolbar button.
ai_spacebefore integer The new spacebefore value.

Usage None

of_tb_setvisible

Description Change the visible status of a toolbar button and the menu item that the toolbar button represents.
Return (none)
Access public
Arguments
Argument DataType Description
amenu menu The menu item that the toolbar represents.
ab_visible boolean The new visible status.

Usage None

of_tb_setVisible

Description Change the visible status of a toolbar button not representing a menu item..
Return (none)
Access public
Arguments
Argument DataType Description
as_name string
ab_visible boolean

Usage None

pf_menuToToolbar

Description If the menu item passed has a toolbar picture then a u_toolbutton objects is created on the window. This function is recursive. A menu item has an array of menu items hanging from it. This function calls itself for each of these sub-menu items and so on and so on....
Return (none)
Access private
Arguments
Argument DataType Description
amenu menu A pointer to a base menu item from which to add pictures

Usage None

pf_positionButtons

Description When this function is called, all the toolbuttons exist as the correct size on the screen. The visible toolbuttons are positioned in their sequence number. Having sorted out the buttons then a border is drawn around the area taken up by the toolbar
Return (none)
Access public
Arguments None
Usage None

pf_sizebuttons

Description This sets all the toolbar buttons to the heights set in the instance variables ii_pixelButtonWidth and ii_pixelButtonHeight. Bitmaps within the buttons are set to ii_pixelPictureWidth and ii_PixelPictureHeight. The tooltip registry is amended for the new size.
Return (none)
Access public
Arguments None
Usage None
Events

constructor
Description Register the toolbar. Set a pointer to the window containg the toolbar. Create a tooltip window

destructor
Description None

ue_buttonover
Description None

See Also

Document Generated: 26/11/1999 16:47:59

Generated by PBDoc ( Unregistered Version )