Creating and Modifying Toolbars

In this Topic Hide

From version 5, SIMetrix allows the complete customisation of toolbars. You can modify the definitions of existing toolbars and buttons, as well as create new toolbars and new tool buttons. This section explains how.

Modifying Existing Toolbars and Buttons

You can rearrange the button layout of existing toolbars by modifying the 'Set' option variables that define them. In the case of the schematic component buttons, this can be done via a simple GUI. See menu View|Configure Toolbar... .

For other toolbars use the command Set to reassign the buttons. The following table shows the name of the 'Set' variable to use for each one.

'Set' Variable Name Toolbar
ComponentButtons SchematicComponents (non 'Micron' versions)
MicronComponentButtons SchematicComponents ('Micron'versions)
CommandShellMainButtons CommandShellMain
CommandShellMainNoSchemButtons CommandShellMain (if schematic disabled - OEM versions only)
SIMPLISComponentButtons SIMPLISComponents
SchematicMainButtons SchematicMain
SchematicFileButtons SchematicFile
GraphMainButtons GraphMain
The 'Set' variable should be set to a value consisting of a semi-colon delimited list of valid button names. For a list of pre-defined buttons, see Pre-defined Buttons.

For example, the following will add a 'New Schematic' button to the schematic file tool bar:

Set SchematicFileButtons="SchemNew;SchemOpen;SchemClose;SchemSave"
You can also use 'Unset' to restore a toolbar to its default setting. E.g.
Unset SchematicFileButtons
will restore the schematic file toolbar to just three buttons without the new schematic button.

To determine the current definition, use the GetOption function with the 'Set' variable name as described in the table above. For example:

Show GetOption('SchematicFileButtons')
will display in the message window the current definition for the SchematicFile tool bar.

Redefining Button Commands

You can change the command executed when a button is pressed using the command DefButton. This is useful if you want to change the symbol placed for one of the component buttons. For example if you wanted to change one of the NMOS buttons, you could do something like:

DefButton NMOS4 "inst /ne my_nmos"
redefines the four-terminal NMOS button to place a symbol with name my_nmos.

You can redefine any of the pre-defined buttons. SeePre-defined Buttons for a complete list.

Defining New Buttons and Editing Buttons

You can define completely new buttons with your own graphic design and add them to an existing toolbar. The same method can also be used to redefine the graphics for existing buttons.

This is done using the command CreateToolButton. These are the steps to take:

  1. Create a graphical image for the button. This should be in a windows bitmap (.bmp), portable network graphic (.png) or JPEG (.jpg) format. You can use almost any paint application to do this. But, if you want to define a mask - that is you wish to define transparent areas - then you must use an editor capable of creating 'portable network graphics' (PNG) images. However, this is rarely necessary in practice and none of the built in graphics define a mask. This is because SIMetrix will automatically create one that makes the area outside the perimeter of the image transparent. The result is usually satisfactory.

    You can make your graphic any size, but to be compatible with the built-in images, you should make them 16x16 pixels. The built-in graphics are all 16 colour, but you can use any colour depth supported by your system.

    When you have created your image, you should save or copy it to the images directory. This is located at simetrix-root/support/images, where simetrix-root is the top level directory in the SIMetrix tree.
  2. Execute the command CreateToolButton. As with menu and key definitions, the definitions created by this command are not persistent that is they will be lost when SIMetrix exits. To make permanent definitions, you should place the commands in the start up script. See Startup Script for more details.

    CreateToolButton will not add the button to any toolbar nor does it assign a command to be executed when it is pressed. These operations are described in the following steps.
  3. Define a command to be executed when this button is pressed. This is done using the command DefButton. Again, this should be place in your startup script.
  4. Add the button to a toolbar. See Modifying Existing Toolbars and Buttons to find out how to add this to an existing toolbar. If you wish to create a new toolbar for the new button, see Creating New Toolbars.
For example, suppose you created a symbol for a diffused resistor and wanted to assign this to a toolbar button that is distinct from the regular resistor button. These are the steps:
  1. First you would create a graphical image called, for example, diffres.png. Copy this to the images directory as described above.
  2. Execute (or place in startup script):
    CreateToolButton /class component diffres diffres.png
    "Place Diffused Resistor"
    (This must all be on one line)

    This will create a button called 'diffres' that we will refer to in the following steps. The switch /class component identifies the button as one that places a component and so will be listed in the GUI based system to edit component toolbars. (See schematic menu View|Configure Toolbar...) . This will make adding the button to a component toolbar a simple operation.
  3. Execute (or place in startup script):
    DefButton diffres "inst /ne diffressym"
    where diffressym is the name of the schematic symbol created for the diffused resistor.
  4. To add to the button to a component toolbar, simply select schematic menu View|Configure Toolbar... You should see 'Place Diffused Resistor' on the left hand side. Select and press Add to add to the toolbar, then use the up down buttons to choose a suitable position.
Its a little harder to edit non-component toolbars as there is currently no GUI to perform the operation in step 4 above. For pre-defined toolbars you can obtain the current specification using the GetOption function and then add your new button to the resulting value at an appropriate location. Then use the Set command to redefine the toolbar. See Modifying Existing Toolbars and Buttons for more details.

Creating New Toolbars

To create a completely new toolbar, use the command CreateToolBar. This will create an empty toolbar.

To add buttons to a new toolbar, you must use the command DefineToolBar. You can add both pre-defined and user-defined buttons to a custom toolbar.

Pre-defined Buttons

The following table lists all the buttons that are pre-defined. All of these buttons may be redefined if required.

The bitmaps are embedded in the SIMetrix binary, but can also be found on the install CD in the directory script/images.

Button name Description Bitmap
AddCurve Add Curve newcurve.bmp
AddFourier Fourier... newfourier.bmp
BiasV Place Bias Marker biasv.bmp
CalcAveragePower Display Average Power/Cycle avg.bmp
CalcFall Display Fall Time falltime.bmp
CalcHighPass3db Display -3dB Point (High Pass) 3dbhighpass.bmp
CalcLowPass3db Display -3dB Point (Low Pass) 3dblowpass.bmp
CalcRise Display Rise Time risetime.bmp
CalcRMS Display RMS/Cycle rms.bmp
Capacitor Place Capacitor cap.bmp
Copy Duplicate copy.bmp
Delete Cut erase.bmp
DeleteAxis Delete Axis/Grid delgrid.bmp
DeleteCurve Delete Curve delete.bmp
Diode Place Diode diode.bmp
Flip Flip flip.bmp
GraphClose Close Graph fileclose.bmp
GraphOpen Open Graph fileopen.bmp
GraphSave Save Graph filesave.bmp
Ground Place Ground gnd.bmp
HideCurves Hide Selected Curves hide.bmp
IGBT Place IGBT igbt.bmp
Inductor Place Inductor ind.bmp
IProbe Place Current Probe iprobe.bmp
ISource Place Current Source isource.bmp
Mirror Mirror mirror.bmp
MoveCurve Move Curve to Selected Axis/Grid movecurve.bmp
NewAxis New Axis newaxis.bmp
NewGrid New Grid newgrid.bmp
NJFET Place N-channel JFET njfet.bmp
NMOS Place N-channel MOSFET nmos.bmp
NMOS3IC Place 3 term Nchannel MOSFET nmos_ic3.bmp
NMOS4 Place 4 term Nchannel MOSFET nmos_ic.bmp
NPN Place NPN Transistor npn.bmp
Opamp Place Opamp opamp.bmp
Options Options options.bmp
PJFET Place P-channel JFET pjfet.bmp
PMOS Place P-channel MOSFET pmos.bmp
PMOS3IC Place 3 term Pchannel MOSFET pmos_ic3.bmp
PMOS4 Place 4 term Pchannel MOSFET pmos_ic.bmp
PNP Place PNP Transistor pnp.bmp
Print Print print.bmp
PSU Place PSU psu.bmp
Resistor Place Resistor (Box shape) res.bmp
ResistorZ Place Resistor (Z shape) resz.bmp
Rotate Rotate rotate.bmp
SatInd Place Saturable Inductor sat_ind.bmp
SatTx Place Saturable Transformer tx_sat.bmp
SchemClose Close Schematic fileclose.bmp
SchemNew New Schematic newschem.bmp
SchemOpen Open Schematic fileopen.bmp
SchemSave Save Schematic filesave.bmp
SchemSaveAll Save All Schematics saveall.bmp
SCR Place Thyristor scr.bmp
ShowCurves Show Selected Curves show.bmp
SimPause Pause Simulation pause.bmp
SimRunNetlist Run Netlist run.bmp
SimRunSchem Run Schematic run.bmp
SymbolNew New Symbol newsymbol.bmp
TitleCurve Change Curve Name curvetitle.bmp
TL Place Transmission Line tl.bmp
Tx Place Transformer tx.bmp
Undo Undo undo.bmp
UndoZoom Undo Zoom undo.bmp
VProbe Place Voltage Probe vprobe.bmp
VSource Place Voltage Source vsource.bmp
Waveform Place Waveform Generator vsig.bmp
Wire Wire Mode pencil.bmp
Zener Place Zener Diode zener.bmp
ZoomFull Fit Window zoomfull.bmp
ZoomIn Zoom In zoomin.bmp
ZoomOut Zoom Out zoomout.bmp
ZoomRect Zoom Box zoomrect.bmp
ZoomXAuto Fit Width zoomwidth.bmp
ZoomYAuto Fit Height zoomheight.bmp