»»»Home «««
»»»TELL «««
»»»Toped «««
»»»Ifaces «««
|
Table of Contents 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. 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.
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. 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 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.
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. 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 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.
|