Programming with Reflection

image\rwnprg32.gif DefineToolbarButton method

 

Syntax object.DefineToolbarButton ToolbarName, Index, Separator, SmallPictureName, SmallPicIndex, LargePictureName, LargePicIndex, Label, Tip, Help, CommandType, Commands, [CommandArguments]

 

Description

Defines a button on the specified toolbar.

Arguments

ToolbarName Argument type: String
Required
The name of the toolbar you want to edit. Toolbar names are not case sensitive. The default toolbar names are:
 Standard
 File Transfer
 Visual Basic
 Setup

 Use NewToolbar to create a new toolbar.

Index Argument type: Integer
Required
Toolbar buttons are numbered using an index of 1 for the leftmost or top button, and so on. If you use an index value of 0, a new button is inserted at the beginning of the toolbar. If you use an index value greater than the number of existing buttons, a new button is inserted at the end of the toolbar. If you use an index value that corresponds to an existing button, the new button is inserted at this location and the existing button and all subsequent buttons are moved over one position.

Separator Argument type: Boolean
Required
If the value of this argument is True (-1), a separator is inserted between this button and the button to its left. If the value is False (0), no separator is used and the new button is grouped with the previous button.

SmallPictureName Argument type: String
Required
The name (and path) of a picture file. This picture appears on the button when small toolbar buttons are selected.

 If you don't want any picture on the button, use "" for this argument and zero (0) for SmallPicIndex.

SmallPicIndex Argument type: Enumeration
Required
Identifies one of Reflection's predefined button images. Click here for more information. If you don't want a picture on the button, use zero (0 or rcBmpNone) for this argument and an empty string ("") for SmallPictureFile.

LargePictureName Argument type: String
Required
The name (and path) of a picture file. This picture appears on the button when large toolbar buttons are selected. This string can be up to 260 characters long. If this value is an empty string (""), you can specify a predefined button image using LargePicIndex.

 If you don't want any picture on the button, use "" for this argument and zero (0 or rcBmpNone) for LargePicIndex.

LargePicIndex Argument type: Enumeration
Required
Identifies one of Reflection's predefined button images. Click here for more information. If you don't want a picture on the button, use zero (0 or rcBmpNone) for this argument and an empty string ("") for LargePictureFile.

Label Argument type: String
Required
The label text for this button. This argument can be up to 40 characters long. Reflection automatically resizes buttons to accomodate the label length.

Tip Argument type: String
Required
This text appears when you position the mouse pointer over this button. This argument can be up to 80 characters long.

Help Argument type: String
Required
This text is visible in the status bar or title bar when you hold down the left mouse button over this button. This string can be up to 120 characters long, although the number of characters actually visible is likely to be somewhat less, depending on the size of the window.

CommandType Argument Type: Enumeration
Required
Specifies what sort of command to attach to the keystroke. The possible values are:

 rcBuiltInFunction

 Maps the keystroke to one or more built-in functions.

 rcTransmitString

 Maps the keystroke to a string that is transmitted to the host when the keystroke is pressed. The string is assumed to be in the Windows character set, and is translated into the appropriate host character set as it is transmitted.

 rcVBCommand

 Maps the keystroke to a single Visual Basic statement. This statement can include Visual Basic functions and statements and/or Reflection methods and propertiers. Use doubled quotation marks for string values within literal strings, for example:

         rcVBCommand, "MsgBox ""Hello"" "

 rcVBMacro

 Maps the keystroke to a Reflection macro. Use the Commands argument to specify the macro's name. You can pass additional information to the MacroData property using CommandArguments. Note: If the macro is not present in the current settings file or a referenced file, you will see an error when you press the specified keystroke combination.

 rcRBScript

 Maps the keystroke to a Reflection Basic script. Use the Commands argument to specify the script's path and file name. You can pass arguments to the script using CommandArguments.

 rcRCLCommand

 Maps the keystroke to an RCL command or script.

Commands Argument Type: String
Required
Specifies the action to perform when the key is pressed. Depending on the value of CommandType this can be a built-in function, a string to transmit, a Visual Basic statement, a Reflection macro, a Reflection Basic script, an RCL command, or an RCL script.

CommandArguments Argument Type: String
Optional
This argument is valid when CommandType is rcVBMacro or rcRBScript. Use it to specify additional information to be passed to the macro or script.

 

 

image\jump.gif Example

image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command