Integration with SmartCAM User Interface

There are several different ways to integrate your custom macros or panels in to SmartCAM. The macro or panel can be assigned to a hotkey, such as F6 or Shift+F12; 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

The application .INI file is used to associate a macro or panel with a hotkey. To associate a macro, panel, or SWEL command to a hotkey, complete the following.

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

It is not recommended to replace SmartCAM hotkeys 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 file is a SmartCAM maintained file, that 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 format shown 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 all 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 you can not create your own. The BTNBIN buttons are buttons that stay active until unselected or overridden; such as many of the buttons on the Group toolbar.

The EVENT line establishes what will happen when this 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. This 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. It is recommended that you place your custom icon files in the same folder as their related macro file.

The HELPLINE is optional. When you are creating an entry for a custom PCB panel, this line is not needed, as the status bar help is stored with the panel. When working with a macro definition, adding a single-line help message is a good idea. The text entered here is displayed in the SmartCAM status bar or in a tool tip, 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 entry for the Path Length custom PCB panel.

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; 15-, 16-, 24-, 32-bit icon formats 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 needed size is missing SmartCAM will attempt to rescale the existing icon image however the results of the resize 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 made 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 selected toolbar.

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 thing; one is older terminology being phased out.

SmartCAM ships with a number of preconfigured toolbar button files. You can modify the default shipping .BGP19 files, but like the ICONBAR.DEF file, they 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 version of the application.

SmartCAM's toolbar are controlled by two files. 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 displayed, 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, that ship with SmartCAM, can be overwritten by subsequent updates, it is highly recommended that if you want to make changes to these files that you create your own files and modify them. As long as 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 create 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 own 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 themselves, you can make and use a copy of the Toolbar Set file. Doing so it recommended to protect it from future updates.

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 packaged as a toolbar buttons before they can be 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 where you would like the button to be presented.

Configure the Toolbar

The size and location of the toolbar is controlled by the Configure Toolbar dialog box.

Displaying a new Toolbar File

You can display multiple toolbars in SmartCAM. Open display a new shipped toolbar or a custom toolbar that you have created and are maintaining do the following:

Adding to the Toolbar

Built-in SmartCAM functionality or custom macros and panels can be added to the toolbar.

Modifying Toolbar Icons

To change an existing toolbar button, right-click on 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 is built-in functionality.

User Menu

The User menu is a special main menu entry. It is not used by SmartCAMcnc, 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 added 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