Search
»»»Home «««
Framework
Screenshots
FAQ
»»»TELL «««
Types
Operators
Functions
Example
»»»Toped «««
Database
Cells
Add
Select
Edit
Properties
Rendering
GUI
Miscellaneous
»»»Ifaces «««
GDSII
OASIS
CIF
DRC

Customising The User Interface

Toped allows different aspects of user interface to be customised. Currently this includes adding and removing items in the menus and toolbars. The former implies customisable hotkeys.

addmenu

Adds new menu item or replaces existing one. Allows creation of top menu item, menu item into existing menu hierarchy, or new menu hierarchy. Also binds this menu item with arbitrary TELL-function and hot-key combination.

[Tip]void addmenu(menupath, hotkey, tellfunction)
string menupath
Contains the menu hierarchy. Menu items are separated by / (see examples below)
string hotkey
Any combination of "CTRL", "ALT" and "SHIFT" strings (case doesn’t matter) separated by either - or + characters and followed by the accelerator itself. The accelerator could be any alphanumeric character or function key from F1 to F12.
string tellfunction
Any TELL-function with arbitrary arguments

Example 1. addmenu

   addmenu("Draw/MyBox", "CTRL-W", "addbox({0,0}, {10,10});");
   addmenu("Scripts/myscript", "F2", "myscript();");

Second function creates new top menu "Script" on the left of "Help" menu and adds menu item "myscript" into "Script". Hot key for myscript() will be F2.

top

Working with toolbars

There are four possible sizes for toolbars: 16x16, 24x24, 32x32, 48x48 pixels. The toolbar size can be changed using menu Settings→Toolbar Size or using toolbarsize function. All icons must be in png format.

Every toolbar in Toped has a name. Currently we have main toolbar that contains new cell, open cell, save design items, and edit toolbar with undo, add box etc. The function toolbaradditem allows you to add new items to an existing toolbar or (in case there is no such name) to a new one.

toolbaradditem

Add an item to the toolbar - insert or replace any item on a named toolbar. Icons can be 16x16, 24x24, 32x32, 48x48 pixels. If there is no icon with proper size Toped tries to select the nearest one. The size of icons for vertical and horizontal toolbars are managed independently.

[Tip]Tip

void toolbaradditem(toolbar_name, item)

void toolbaradditem(toolbar_name, item_list)

string toolbar_name
Name of existing or new toolbar:
strmap item
Map represented {"item_name", "Tell-function"} relation
strmap list item
list of strmap structures

Lets consider the first form. toolbar_name is the toolbar name described above. Item is a list consisting of two strings. First is the item name, second is the corresponding Tell function. The second form of the toolbaradditem function allows setting of several icons at once.

Example 2. toolbaradditem

   toolbaradditem("main",{"redo","redo();"})

Now near the save button a new button will appear. The toolbaritem function looks for icon files in $TPD_GLOBAL/icons directory. Files with names "redo16x16.png", "redo24x24.png", "redo32x32.png", "redo48x48.png" will be loaded. If there is no file for a particular icon size, Toped will use the nearest one.

Example 3. toolbaradditem

  toolbaradditem("my",{{"redo","redo();"},
      {"undo", "undo()"},
      {"zoom_all", "zoomall();"}});

Here we used a single function call to set several items using the second form of toolbaradditem

toolbarsize

Changes the icon size in the toolbars - allows to set any predefined icon size. If icons with certain size are not available Toped will use the nearest match. The icon sizes of the vertical and horizontal toolbars are managed independently.

[Tip]void toolbarsize(toolbar_direction, icon_size)
toolbar_direction
One of the predefined constants: _vertical or _horizontal
icon_size
One of the following predefined constants: _iconsize16 , _iconsize24, _iconsize32 or _iconsize48

Example 4. toolbarsize

   toolbarsize(_horizontal, _iconsize24);

toolbardeleteitem

Delete existing item - allows removal of an item from a selected toolbar.

[Tip]void toolbardeleteitem(toolbar_name, icon_name)
string toolbar_name
Name of existing toolbar
string icon_name
Name of toolbar item

Example 5. toolbardeleteitem

   toolbardeleteitem("my_toolbar", "my_item");