Integration with SmartCAM User Interface

There are several ways to integrate your custom macros or panels into SmartCAM. The macro or panel can be assigned to a hotkey, such as SHIFT+F7 or ALT+F4; it can be associated with an icon on the Toolbar; it can be added to a special User main menu selection; or it can be integrated into existing Create, Edit, or Process menus.

Hotkeys

Entries in the application .INI file associate a macro or panel with a hotkey. Complete the following to associate a macro, panel, or SWEL command with a hotkey.

Note: A Custom PCB Panel cannot be assigned to a Hotkey unless associated with a SmartCAM main menu entry. Assigning PCB panels to menus is discussed later.

It is not recommended that SmartCAM hotkeys be replaced with custom hotkeys.

Iconbar.Def

The ASCII text file, ICONBAR.DEF, is used to configure the panels, buttons, and icons that can be added to your Toolbar. This is a SmartCAM maintained file, which includes the button definitions for the functionality that ships with SmartCAM.

Do not make changes to this file. This file is overwritten during updates and new product installations.

However, the button definition code and formatting in the ICONBAR.DEF can be manually added to your personal custom Toolbar button configuration files. This allows you to add your custom panels and macros to your Toolbars. For most purposes, this is never required. You can use the Edit Toolbar functionality to add built-in or custom macro icons to your Toolbar.

The file is located in the SmartCAM SHARED\ICON directory. By default, this path would be in your versioned files folder:

SmartCAM\SmartCAMv#\Shared\Icon\

The format for an entry in this file is:

BUTTON "Display Name"
EVENT <command> <path or name>
ICON "<icon name>"
HELPLINE "Optional single line help text"
ICNTXTONE "Toolbar button text line one"
ICNTXTTWO "Toolbar button text line two"

The first line establishes this is a BUTTON definition. The "Display Name" is the name associated with this functionality. This is the name displayed in the Predefined Buttons list of the Edit Toolbar window.

Note: There is also a BTNBIN button type. This is a special type of toggle button. You can include Toolbar icons based on the BTNBIN events, but can not create your own. The BTNBIN buttons stay active until unselected or overridden, such as many of the buttons on the Group Toolbar.

The EVENT line specifies the action to be taken when BUTTON is triggered. The syntax is the same as the syntax used to assign a macro or panel to a hotkey.

The ICON entry sets which icon is displayed when the macro or panel is associated with the icon-based Toolbar, or when a custom PCB panel is displayed. The icon name is the filename for the icon file, without the .ico extension.

SmartCAM will check two locations for your icon file. First, it will look in the SHARED\ICON folder, which is the same folder that contains the ICONBAR.DEF file. If not found there, it will check the folder where the associated macro resides. If found in neither location, a blank button will be created. You should place your custom icon files in the same folders as their related macro files.

The HELPLINE is optional. When creating an entry for a custom PCB panel, this line is unnecessary, as the status bar help is stored with the panel. Adding a single-line help message is a good idea when working with a macro definition. The text entered here is displayed in the SmartCAM status bar or tooltip, depending upon how the SmartCAM application is configured.

The ICNTXTONE and ICNTXTTWO are used to enter two short lines of text. This text is displayed on the Toolbar when you configure your Toolbar to display button text.

As an example, the following is the Path Length custom PCB panel entry.

BUTTON "Path Length"
EVENT panel "Path Length"
ICON "PathLen"
HELPLINE "Find length of profile"
ICNTXTONE "Path"
ICNTXTTWO "Length"

This assumes an existing icon, with the filename PathLen.ico, is located in the same folder as the macro called by the Path Length dialog.

Icon

SmartCAM uses the original Windows icon format (not XP or Vista), saved in a ICO format with an .ICO extension. The applications support up to 256 color icons. The icons must use the Windows BMP format for storing the image, PNG format images are not supported.

SmartCAM's Toolbar can be displayed in three sizes: Small, Medium, and Large. So three icons are needed for the various sizes; if a required size is missing, SmartCAM will attempt to rescale the existing icon image; however, the resize results are not optimal. The three sizes for icons needed are: 19x19, 24x24, and 32x32 pixels.

All three icon sizes are stored in a single ICO file.

Important Information

Since the ICONBAR.DEF is a free-format ASCII text file the SmartCAM installation routine cannot update the file. Instead, it overwrites it on each new installation or upgrade. This means any changes to the file will be lost after a re-installation.

However, if you make the same changes in your custom Toolbar button configuration file, you will not have to worry about the file being overwritten.

You do not need to edit the Toolbar button files directly. Instead of manually adding the button configurations, right-click on the Toolbar. Then select Edit Toolbar from the pop-up menu. From the Edit Toolbar window, you can add, remove, and reorder the buttons on the Toolbar chosen.

Toolbar

The SmartCAM Toolbar uses an ASCII text file to select what icons are displayed and in what order. The file is saved with a .BGP19 extension and, by default, is kept in the same directory as the ICONBAR.DEF file described above. When reviewing documentation, the terms "Toolbar" and "Icon Bar" are the same; one is older terminology being phased out.

SmartCAM ships with several preconfigured Toolbar button files. You can modify the default shipping .BGP19 files, but like the ICONBAR.DEF files will be overwritten during new installations and updates. So, you will need to add your custom buttons back into the file after installing a new application version.

Two files control SmartCAM's Toolbars. There is a Button Group file (*.BGP19). The Button Group file contains a list of the buttons to display on a single Toolbar. When the Toolbar is visible, it will display the buttons configured in this file, in the order they appear in the file.

Then there is a Toolbar Set or Toolbar Configuration file. This file contains a list of all imported Toolbars (imported .BGP19 button group files), whether the Toolbar is displayed or not, the Toolbar's location and size, the size of the buttons, whether buttons are aligned to the left, right or center (top, bottom, or middle) of strip, and whether button text is displayed and where the text is displayed. In effect, it contains the layout of the Toolbars.

The Toolbar Configuration files are named with a .BFG19 extension.

Since the ICONBAR.DEF, *.BFG19, and *.BGP19 files, which ship with SmartCAM, can be overwritten by subsequent updates. If you want to make changes to these files, you should create your own files and modify them. If your files are not named the same as the SmartCAM files and in the same locations, they will not be affected by later installations.

SmartCAM installations create a common area, a folder tree where you can make your versions of these files and keep them readily available and safe from updates. This path is:

\ProgramData\SmartCAM\Common\

It is recommended that you create an ICON\ subfolder, under ..\Common\, to use when creating your Toolbar configuration and button group files.

Creating Button Group Files

If you want to modify a shipped Button Group file, it is recommended that you make a copy of the file and make changes to it instead. To do that, complete the following:

Now, any changes made to the Toolbar will be made to your copy.

Creating Toolbar Set Files

Like Toolbars, you can make and use a copy of the Toolbar Set file. Doing so it recommended to protect it from future updates.

To ensure that any changes to the Toolbars are reflected, after a product update or new version installation, the installation updates the applications to use the default Toolbar Set file. After the update, your changed custom Toolbars may not be displayed. You can easily switch back to your custom Toolbar Set file and your custom Toolbars using either Utility - Toolbar Sets - Choose and selecting your custom Set file.

It is recommended to review the What's New help topic and check the displayed shipping default Toolbars to see what changes have been made for this release. Depending on the change, it may affect your custom Toolbar configurations.

Macros and PCB Panels

Your custom macros can be added directly to your custom Toolbar, using the functionality on the Edit Toolbar dialog.

Your custom CTK panels must be configured as Toolbar buttons before being used. See the topic about the ICONBAR.DEF for information about how to create a BUTTON. This Button definition would be added directly to your Toolbar button configuration file in the order you would like the button to be presented.

Configure the Toolbar

How and where your Toolbar is displayed can be changed in several ways. Using Utility - Toolbar Sets - Configure opens the Configure Toolbar dialog box. You can right-click on the Main Menu bar and pick Configure from the pop-up menu.

The Configure Toolbar dialog box allows you to change the name of the Toolbar. This is not the filename. It is the displayed name that you right-click on the Main Menu to hide and show Toolbars.

You can also change the location where the Toolbar is docked, whether it is visible, and make it a floating Toolbar (a floating window, not docked to the edge of the graphics view).

Since you did not select a Toolbar before opening Configure Toolbar, you will need to use the Bar drop-down menu selector to pick the Toolbar to modify.

Right-clicking on the Main Menu bar opens a pop-up menu that contains a list of the Toolbars associated with the open Set file. Clicking on an item enables and disables visibility. Toolbars that are displayed have a checkmark next to them.

Right-clicking on an individual Toolbar brings up a pop-up menu that allows specific changes to the selected Toolbar. The Position pull-right menu lets you set which side of the graphics view to dock the Toolbar, or whether to make it a floating Toolbar. The Size menu selects which size to use for icons: small, medium, or large.

The Text menu turns on or off descriptive text for the Toolbar icons. If enabled, it also lets you select where to display the text: above, below, to the left, or the right of the icon. Finally, the Alignment menu lets you set the alignment for the icons. They can be justified to the Top/Left (Top for vertical, left for horizontal Toolbars), Bottom/Right, or centered in middle of Toolbar.

Displaying a new Toolbar File

You can display multiple Toolbars in SmartCAM. To display a new shipped Toolbar or a custom Toolbar that you have created and are maintaining, do the following:

Adding to the Toolbar

Modifying Toolbar Icons

To change an existing Toolbar button, right-click on the Toolbar and from the pop-up menu select Edit Toolbar. From here, you can add new buttons, remove buttons, or change the order of the existing buttons.

To remove a button, highlight the button in the Active Buttons list, then use the arrow button (>) to remove the button from the active Toolbar and return it to the Predefined Buttons list.

Saving Changes

From the Edit Toolbar window, use Accept to save your changes or Cancel to leave the Toolbar unchanged.

Custom panels can be integrated directly into the SmartCAM main menu. Once integrated, a custom panel can be used just as if it were built-in functionality.

User Menu

The User menu is a special main menu entry. SmartCAMcnc does not use it; it exists solely for customers to use as a location to integrate their custom panels.

The User menu is not displayed until there is one or more custom PCB panel files associated with it. After which time, the menu heading will appear on the SmartCAM main menu.

When adding a name for the User menu, the first capital letter in the menu name is assigned as the Alt-key hotkey. However, if a menu to the left of the User Menu, on the menu bar, already uses that letter no shortcut will be assigned to the User menu. Additionally, if you use the same letter as a menu to the right, the menu to the right will lose its alt-key.

When assigning names to menu items, an ampersand (&) is used to prefix the letter that should be used for the menu Alt-key selection. This key is underlined in the menu, when the menu is displayed. The system will not prevent the same key from being used more than once, so be sure to use unique letters for each taskset.

For example, the taskset menu name: My &Tools will use the T as the alt-key.

Adding Custom PCB to User Menu

If a PCB file is missing or does not load, the menu items is dimmed and the warning "Could not file or load pcbfile. Toolbox toolboxname is not available" is displayed.

Create / Edit / Process Menus

Custom PCB panels can be integrated into selected existing SmartCAM main menu categories; these are the Create, Edit, and Process menus.

Adding custom panels to these existing SmartCAM menu items is very similar to the process required to create and update the User menu. Custom automations added to these menus are appended to the end of the menu.

When assigning names to menu items, an ampersand (&) is used to prefix the letter that should be used for the menu Alt-key selection. This key is underlined in the menu, when the menu is displayed. The system will not prevent the same key from being used more than once, so be sure to use unique letters for each taskset.

For example, the taskset menu name: My &Tools will use the T as the alt-key.

Adding Custom PCB to an Existing Menu

If a PCB file is missing or does not load, the menu items is dimmed and the warning "Could not file or load pcbfile. Toolbox toolboxname is not available" is displayed.

Related Topics

Debugging your Macros

Custom Control Panels

Creating a User Interface Overview

SmartCAM Automation Overview

Customizing SmartCAM