> Toolbars

Toolbars

Toolbars provide quick navigation to program functions in SYSPRO and are located at the top of the screen immediately under the program's description.

They are fully customizable and customizations can be performed at Operator or Role level. Some of the customization options available for these SYSPRO toolbars are as follows:

  • Add/remove buttons and commands

  • Change the text, icons and shortcut keys against toolbar items

  • Change the function that toolbar items perform (e.g. execute a VBScript against a toolbar control)

  • Add new items to existing toolbars

  • Add new toolbars

  • A toolbar tear-off option enables you to drag a toolbar to be a floating toolbar on top of the application

Customizing toolbars

Customize window

Right-click a toolbar and select the Customize option from the shortcut menu to perform a number of functions:

Tab Options available
Toolbars

Various options are available within this tab:

  • Add a New toolbar

  • Rename toolbars

  • Delete a toolbar

  • Reset the toolbar to its default state

    If you select the Reset button, both the toolbar and menu bar will revert to their default settings.

Commands

Add a command or commands to a toolbar.

Keyboard

Configure Commands, Key assignments, Shortcut keys.

Menus

Reset either Application Menus or Context Menus to their default state.

Options

Various options are available within this tab:

  • Indicate how you want to display full menus

  • Define the size of icons

  • Indicate if you want to show ScreenTips

  • Define Menu animations

Moving toolbars and menu bars

At the far left of toolbars and menu bars is a Gripper, which consists of four vertical dots. You can move a toolbar or menu bar to a new location by clicking on the gripper and dragging the bar to a new location. Once it is where you want it located, release the mouse button and the bar will remain in this location.

Alternatively you can drag it anywhere else on the screen and release it so that it becomes a floating menu/toolbar. The toolbar then disappears when the application is closed, and the next time you run the application, the floating toolbar appears in the last location from which the application was run.

To restore the toolbar/menu bar to its original location you can either, manually drag it back to its original position, or use the Reset option from the Customize screen. This option will undo all changes that have been made to the toolbar(s) and menu bar(s) in this program.

Creating new toolbars

When reducing the width of a program screen to below the original width of the toolbar, the buttons to the right are no longer visible. These can be seen in a dropdown box if you click on the Toolbar Options button.

If you prefer to see all of the buttons on this reduced width screen, you can create another toolbar and move some of the buttons from the original toolbar to the new one.

To create a new toolbar you need to be in the Customize mode. The available toolbars will be listed in the Toolbars tab of the Customize screen. In most cases there is a toolbar with the program description, and a menu bar.

Modifying a toolbar button

The name, action performed and other properties of an existing toolbar button can be changed.

While in Customize mode, right-click on the relevant button in the toolbar of the calling program to display a shortcut menu of additional functions that can be performed:

Field Description
Reset

Reset ONLY the highlighted toolbar item to its default setting.

Delete Remove the button from the toolbar.
Name

Enter the name (caption) you want to associate with the toolbar button.

The name is changed by overwriting the existing name and pressing the Enter key. The display of the button's properties will be closed, and the button name will be changed.

If you want to add a shortcut keystroke to the button, add an ampersand directly before the letter that is to be the shortcut. The shortcut keystroke will then invoke the action of this button.

Copy Button Image Copy the image of the currently selected toolbar button to your clipboard.
Paste Button Image Paste the image (currently in your clipboard) to the selected toolbar button.
Reset Button Image Reset the image of the toolbar button to its default.
Edit Button Image Maintain the image you want to associate with the toolbar button.
Change Button Image Change the image you want to associate with the toolbar button.
Default Style Display only the image for the toolbar button.
Text Only Display only the text for the toolbar button.
Image and Text Display both the text and the image for the toolbar button.
Begin a Group

Add a separator in front of the currently highlighted toolbar button.

(This creates a vertical line between the entries to separate them for ease of reading.)

Program

Enter the name of the SYSPRO program you want to call when the toolbar button is selected.

(This overrides the original functionality implemented for the toolbar item.)

Application

Enter the name of the application you want to launch when the toolbar button is selected.

(This overrides the original functionality implemented for the toolbar item.)

VBScript function

Enter the name of a VBScript function to execute when the toolbar button is selected.

Tooltip The text you want to associate with the toolbar button when the mouse button hovers over it.
Add New Button

Enter a caption for your new button.

The button is added to the existing toolbar and can be further customized using VBScript.

Add or Remove buttons on a toolbar

On standard toolbars you can show or hide the standard buttons. If you click on the Toolbar Options button and select the Add or Remove Buttons function, a list of the standard toolbars for the program are displayed.

When one of these standard toolbar names is selected, a list of the standard buttons is displayed. The buttons that are currently displayed will have a check mark against them. When you uncheck one of the buttons, the matching button is hidden from the toolbar in real time. If you check one of the unchecked buttons, it is displayed on the toolbar.

If buttons are moved from their original toolbar to another, they will still appear in the original list but will be displayed unchecked. If their option is checked, then they will reappear on the original toolbar, as well as the other toolbar.

Buttons that were renamed appear in this list with their new names, and can be shown or hidden.

Buttons added by the Operator or Administrator appear in this list, but the option to show or hide them is disabled.

The Add or Remove Buttons option merely enables you to display or hide them from the toolbar. It does not add or remove the actual buttons from the toolbar. The toolbar's Customize mode must be used to physically add or remove buttons from the toolbar.

See also: Notes and warnings.

Mini toolbar

Mini toolbar functions

A mini toolbar is available from the context-sensitive menu of a listview or form and includes a number of functions available:

  • Increase/Decrease the listview font size
  • Expand/Collapse groups
  • Change the background and foreground colors
  • Call up the Find function (listview only)
  • Filter text (listview only)
  • Filter columns (listview only)

  • Apply a new font or theme (listview only)

  • Modify how data is visualized in a cell by using the XAML markup code feature (listview only)

Displaying the mini toolbar

There are a number of ways to display the mini toolbar:

  • Right-click on a column header inside a listview
  • Right-click on a field in a form
  • Double-click on any field in a form
  • Press Ctrl+F1 on a column header when a row is highlighted on the listview
  • Press Ctrl+F1 on a highlighted row on a form

Personalizing toolbars

You can define default settings for all toolbars using the Personalize program from the SYSPRO Ribbon bar.

Field Description
Toolbar options  
Toolbar theme Assign a theme to toolbars within SYSPRO.
[Note]

You cannot access this field if you selected to apply an overall theme for the user interface (Environment Options tab). The overall theme that was selected is displayed here.

Reset Toolbar Settings Reverts all toolbar settings to their default settings (this removes all Tbar_*.XML files from your \Base\Settings folder).
Preview Tests your selections before applying them throughout the system.

VBScript in Toolbars

You can use VBScript to control the behavior and properties of buttons on any toolbar using VBScript.

  • Hide or display a button.
  • Disable or enable a button.
  • Change the value of a button (if it is an editable control).
  • Cause a button to be 'executed' (i.e. behave as if you had clicked it).
  • Modify the behavior of a new toolbar button.

To control toolbar functions

  1. Launch the VBScript Editor.

  2. Select the ToolbarButton variable from within the SystemVariables (actions) section of the Variables pane.

    The Modify Toolbar Buttons window appears.

  3. Select the toolbar button you want to modify. The properties (Caption and ID) of that button will be displayed.

  4. Indicate the options you want to apply and select Add to List.

  5. When you have completed adding your buttons to the list, select Insert VBScript Code to insert an XML snippet of code into your VBScript code at the current insertion point in the editor.

  6. You can cause a button to be executed by selecting the Execute option from the Action dropdown list (equivalent to clicking on the button or pressing Enter on an edit control).

    If the button is an editable control then you can change the value of the button as well as execute it.

Creating a new toolbar button using VBScript

The simplest way to add new buttons to an existing toolbar is by copying an existing button. This is done while in Customize mode:

  1. Hold down the Ctrl key on the keyboard.

  2. Click on the button you want to copy.

  3. Drag the button to another location on the toolbar.

    As you hover over the toolbar, an area will be highlighted with a black vertical bar. This shows where the button will be placed if you release the mouse button.

  4. Release the button and a duplicate of the selected button will be added to the toolbar.

  5. Change the name and functionality of the button by right-clicking on it while in Customize mode.

A new button can also be added to a toolbar when in Customize mode by right-clicking on a toolbar button to display its properties. At the Add New Button: option enter the name you want to assign to the button and press Enter. The new button is created, but is completely blank apart from the assigned name.

Configuring toolbar buttons to run a VBScript function

There are two parts to configuring a toolbar button to call a VBScript function:

  • Specify the name of the VBScript function against the button.

    While in Customize mode, right-click the button to display its properties. Enter the name against the VBScript function field within the properties list.

    When you press Enter, the button's properties will be closed and the name shall be saved against the VBScript function.

    Exit the Customize mode by clicking on the Close button on the Customize screen.

  • Create the function in the VBScript Editor

    To supply the code for a function using the VBScript Editor program, exit the Customize mode. Right-click the toolbar and select Macro for:xxxxxxxx to launch the VBScript Editor.

    The function must be manually created by clicking on the Edit VBScript button, which loads the VBScript for: screen, where you add your VBScript code.

    The first line of code to enter is the Option Explicit statement, which forces you to explicitly declare variables before you can use them.

    The next line of code will be the start of the function itself. The name of the function is the same as supplied to the toolbar, but with the spaces removed (as function names cannot contain spaces).

    The line of code to open the function is (assuming that the name of the VBScript function is My VB Script Code):

    Function MyVBScriptCode()

    The rest of the code to perform the function must then be entered, followed by the End Function statement.

    Below is a sample of code that displays the stock code description on a toolbar which is part of the Inventory Query program.

    Option Explicit
    Function MyVBScriptCode() 
    MyVBScriptCode = false
    msgbox StockCodeDetails.CodeObject.Description,, "Stock Description" 
    End function

    The first line of code within the function doesn't need to be present in this case, because the button containing the VBScript function name was created from scratch.

    This line of code [MyVBScriptCode = false] is useful when you have copied a button to create this one, as it prevents the new button from performing its original task (or a task that was linked to the original button when it was copied).

    When the function has been entered, exit the VBScript for: program. At the VBScript Editor screen, click on the Save button. You will be returned to the program containing the button.

Notes and warnings

Customization considerations

  • You can remove all toolbar customizations for your own operator code using the Personalize program.

  • If your operator is a member of a role, then the ability to access the toolbar's Customize mode is disabled, unless you are in Design Role Layout mode before calling up the program containing the toolbar.

    This is configured using the Role layout design option checkbox in the Options tab of the Operators program.

File and folder considerations

  • When you customize a toolbar for a program in SYSPRO, a file is created in the \Settings folder (supports roaming users) or on the application server (if you are using roles).

    The name of the file is generated according to a specific structure, with a slight variation if your language code is not English and/or you are using roles.

Sample usage

  • The following example indicates the file that will be created for a customized toolbar relating to the Operators program (IMPPMP).

    \Settings\TBar_OperatorName_IMPPMPT1.XML

  • The following example appends the language code for French (FR) to the customized toolbar file that is generated.

    \Settings\TBar_OperatorName_IMPPMPT1_FR.XML

  • The following example indicates the additional folder that is created for the customized toolbar file. The folder name is derived from the id assigned to the role.

    \Settings\Role_001\TBar_OperatorName_IMPPMPT1.XML

Activity considerations

  • Operator access to the following activities within this program can be restricted. You configure this using the Operators program.

    Activity Description
    Toolbars - Customization by operator Controls whether an operator can customize toolbars within SYSPRO.