True WYSIWYG LaTeX System
Windows     Mac     Linux  

BaKoMa TeX
Toolbars Customization

This description is for BaKoMa TeX 11.0 or later.

NOTE: Toolbar customisation was introduced in version 10.80.
However, some styles has been added in V 11.0. So that some styles in this description will be undefined in V 10.80.

Toolbars

Before making own toolbars take attention that you can add/remove any button in User Toolbar.

Toolbar folders

Beginning from BaKoMa TeX 10.80 main programs (TeXWord, TeXCode/Centaur, DVIEW) download definitions of advanced toolbars from Toolbars subfolders. To add own toolbar user can just drop toolbar defintion into such folders:

PROGRAMDIRECTORY
TeXWord $TEXDIR/BaKoMa/TeXWord/Toolbars
TeXCode/Centaur $TEXDIR/BaKoMa/TeXCode/Toolbars
DVIEW $TEXDIR/BaKoMa/DVIEW/Toolbars

Where $TEXDIR is BaKoMa TeX installation folder.

OPERATING SYSTEM $TEXDIR Value
Windows C:\BaKoMa TeX (may be changed at install)
MacOS /Applications/BaKoMa TeX/.bakoma
Linux /opt/bakoma

Toolbar definition

Toolbar is defined as PostScript dictionary with following keys:

KEYTYPEVALUE/DESCRIPTION
/TypeName /Toolbar
/NameName uniqual key identifying toolbar.
/LabelString the label which will be appeared in 'Window' menu to show/hide toolbar.
/ShowBoolean[Optional] defines default state (Shown/Hidden) of the toolbar.
/StyleInteger[Optional] /WXAUI_{ flags } Flags (See wxWidgets/wxAuiToolBar)
/Size[Int Int][Optional] Currently ignored, used to set typical size of tool bitmap
/ChildsArray array of tools or controls, whose will be appeared on toolbar
/ExtensionArray [Optional] array of tools, whose will be appeared in toolbar menu

Values of WXAUI_ flags (for /Style key of previous table):

FLAGDECRIPTION
TB_TEXT Shows the text in the toolbar buttons; by default only icons are shown.
TB_NO_TOOLTIPSDon't show tooltips on wxAuiToolBar items.
TB_NO_AUTORESIZEDo not auto-resize the wxAuiToolBar
TB_GRIPPERShows a gripper on the wxAuiToolBar.
TB_OVERFLOWThe wxAuiToolBar can contain overflow items.
TB_VERTICALUsing this style forces the toolbar to be vertical and be only dockable to the left or right sides of the window whereas by default it can be horizontal or vertical and be docked anywhere.
TB_HORZ_LAYOUTShows the text and the icons alongside, not vertically stacked. This style must be used with TB_TEXT
TB_HORIZONTALAnalogous to TB_VERTICAL, but forces the toolbar to be horizontal, docking to the top or bottom of the window.
TB_PLAIN_BACKGROUNDDraw a plain background (based on parent) instead of the default gradient background.

/Extension

Extension is array of following elements:

KindTYPEVALUE/DESCRIPTION
SeparatorName/SEPARATOR
ToolDictionarySee description below

/Childs

Childs is array of following elements:

KindTYPEVALUE/DESCRIPTION
SeparatorName/SEPARATOR - separator
LabelString any string adds label on toolbar.
SpacingInteger any integer adds space, value >= 1000 - stretchable space.
ToolDictionaryWhen '/Type' key is missed or defined as '/Tool' it is assumed to be tool.
ControlDictionaryControl Dictionary must include '/Type' key which defines type of control.

Tool Dictionary
Tool is special form of Control which is more flexible and may be adjusted by toolbar flags.

KEYTYPEVALUE/DESCRIPTION
/ID integer which will be passed to handler (keep them uniqual for all tools and controls in one toolbar)
/Icon string icon name.
/Label string [Optional] text which will be shown below icon when proper style of toolbar.
/Tip string [Optional] tooltip which will be displayed when mouse is over tool icon.
/Action proc|name [Optional] it is command attached to tool (see Actions)

Control Dictionary

KEYTYPEVALUE/DESCRIPTION
/TypeName defined kind of control, list of controls see below.
/IDInteger which will be passed to handler (keep them uniqual for all tools and controls in one toolbar)
/StyleInteger control dependent style.
/TipString [Optional] tooltip which will be displayed when mouse is over control.
/Size[Int Int] [Optional] [#width #height] - adjusts size of control.
/Actionproc|name|dict [Optional] it is command or option attached to control (See Actions)

Below is list of controls supported by toolbar:

TYPEDESCRIPTION, additional keys and styles
/Button Classical button with text specified by additional /Label key
/Label - string, text which will be shown on button.
/Style key accepts /WXBU_ flags:
  • LEFT - Left-justifies the label. Windows and GTK+ only.
  • TOP - Aligns the label to the top of the button. Windows and GTK+ only.
  • RIGHT - Right-justifies the bitmap label. Windows and GTK+ only.
  • BOTTOM - Aligns the label to the bottom of the button. Windows and GTK+ only.
  • EXACTFIT - By default, all buttons are made of at least the standard button size, even if their contents is small enough to fit into a smaller size. This is done for consistency as most platforms use buttons of the same size in the native dialogs, but can be overridden by specifying this flag. If it is given, the button will be made just big enough for its contents. Notice that under MSW the button will still have at least the standard height, even with this style, if it has a non-empty label.
  • NOTEXT - Disables the display of the text label in the button even if it has one or its id is one of the standard stock ids with an associated label: without using this style a button which is only supposed to show a bitmap but uses a standard id would display a label too.
  • BORDER_NONE - Creates a button without border.
/CheckBox is a labelled box which by default is either on (checkmark is visible) or off (no checkmark).
/Label - [Optional] string, label (comment) at right of checkbox.
/Style key accepts /WXCHK_ flags:
  • 2STATE - Create a 2-state checkbox. This is the default.
  • 3STATE - Create a 3-state checkbox. Not implemented in wxGTK built against GTK+ 1.2.
  • ALLOW_3RD_STATE_FOR_USER - By default a user can't set a 3-state checkbox to the third state. It can only be done from code. Using this flags allows the user to set the checkbox to the third state by clicking.
  • ALIGN_RIGHT -Makes the text appear on the left of the checkbox.
NOTE: It should be used together with /Action pointing on BooleanOption
/TextCtrl A text control allows text to be displayed and edited. (wxTextCTrl)
/Label - [Optional] string, text which will be inside control at creating.
/Style key accepts /WXTE_ flags (suitable for toolbar):
  • READONLY - The text will not be user-editable.
  • PASSWORD - The text will be echoed as asterisks.
  • LEFT - The text in the control will be left-justified (default).
  • CENTRE - The text in the control will be centered (currently wxMSW and wxGTK2 only).
  • RIGHT - The text in the control will be right-justified (currently wxMSW and wxGTK2 only).
NOTE: It should be used together with /Action pointing on StringOption
/Choice A choice control is used to select one of a list of strings. (wxChoice)
/Label - string, will be treated by the control in special way.
/Style key accepts /WXCB_ flags:
  • SORT - Sorts the entries alphabetically
NOTE: It should be used together with /Action pointing on ListOption
Following controls has no reasonable meaning on toolbars, but may be used to provide special appearance.
/BitmapButton Bitmap button with image specified by additional /Icon key
/Icon - string, name of icon which will be displayed on button.
NOTE: Use tool instead it, but Style may change view of button.
/Style key accepts /WXBU_ flags:
  • LEFT - Left-justifies the bitmap label.
  • TOP - Aligns the bitmap label to the top of the button.
  • RIGHT - Right-justifies the bitmap label.
  • BOTTOM - Aligns the bitmap label to the bottom of the button.
Note: that the EXACTFIT style supported by Button is not used by this class.
/StaticText A static text control displays one or more lines of read-only text.
/Label - string, text which will be shown.
NOTE: Use String instead it, but Style may change view of string.
/StaticBitmap A static bitmap control displays a bitmap.
/Icon - string, name of icon which will be displayed.
/HyperLink Label looking like to hyperlink, at click automatically open Url page.
/Label - string, shown string.
/Url - string, URL which will be opened at clicking on the control.
Unuseful or difficult to use insde toolbars.
/StaticBox /Label - string, text which will mark the box at left top corner.
/BKMButton /Label - string, will be treated by the control in special way.
/RadioButton /Label - [Optional] string, label (comment) at right of radiobutton.
/ComboBox /Label - [Optional] string, text which will be inside control at creating.

Actions

'Action' key in tool or control may specify some action which should be peforming after clicking by mouse.

In case of Tool, Button, BitmapButton it may be postscript procedure or name referred on a procedure.

In case of CheckBox it may be BooleanOption, which will be correctly associated with control.

In case of TextCtrl it may be StringOption, which will be correctly associated with control.

In case of Choice it may be ListOption, which will be correctly associated with control.

Every program have own set of commands whose may be shown in dialog opened by menu command: Help / Keyboard (F1).
To see all commands change view in left bottom corner of the dialog.

Samples

Centaur (TeXCode) has two special toolbars (may be found in $TEXDIR/BaKoMa/TeXCode/Toolbars)

Search.Toolbar - set of commands to search and replace
TeX.Toolbar - set of commands to run TeX and utilities

For example search toolbar looks like following:

<</Type /Toolbar
  /Childs [
    (Search:) 4 % There is label and spacer
    <</ID 4 /Type /TextCtrl /Size [128 10] /Action /SearchString /Tip (Current string for search)>> 
    6 % Small space between TextCtrl and CheckBox will look nice.
    <</ID 5 /Type /CheckBox /Action /MatchCase /Tip (Selects searching with case matching)>>
    <</ID 6 /Type /CheckBox /Action MatchWholeWord /Tip (Selects searching only whole words)>>
    /SEPARATOR
    <</ID 7 /Icon (edit-find;opt-previous) /Label (Search Backward) /Action /SearchBackward 
		/Tip (Searches again backward)>>
    <</ID 8 /Icon (edit-find;opt-next)     /Label (Search Forward)  /Action /SearchForward 
		/Tip (Searches again forward)>>
    /SEPARATOR
    <</ID 10 /Icon (edit-find-replace) /Label (Replace) /Action /Replace 
		/Tip (Replaces currently found string by `Replacement Text' and searches again)>>
    <</ID 11 /Type /TextCtrl /Size [128 10] /Action ReplacementString 
		/Tip (Replacement Text) >>
    <</ID 12 /Icon (edit-find-replace;opt-all)  /Label (Replace All) /Action /ReplaceAll 
		/Tip (Replaces every matched substring (beginning from cursor) by `Replacement Text')>>
    /SEPARATOR
    <</ID 14 /Icon (bookmark-edit) /Action /ManageBookmarks... /Label (Manage Bookmarks) 
		/Tip (Manages source text Bookmarks in the current file)>>
  ]
  /Extension [
    /SEPARATOR
    <</ID 1 /Label (Help) /Icon(Help) /Action { (.BKM.edit-Search-Replace) MetaHelp } 
		/Tip (About this Toolbar ...) >>
  ]
>>