|
WikiDoc |
ToolbarCommandCommands.ToolbarCommand HistoryHide minor edits - Show changes to markup February 05, 2009, at 01:45 PM
by - More about 8,2b8 version
Added line 1:
Changed line 130 from:
to:
Changed lines 217-218 from:
toolbar new ?-autosave (0|1)? ?-locked (0|1)? to:
toolbar new ?-autosave (0|1)? ?-locked (0|1)? ?-allowed list? ?-default list? Changed lines 221-222 from:
The -autosave and -lock options have the same meaning as with the [toolbar configure] command. to:
The -autosave and -lock options have the same meaning as with the [toolbar configure] command: Changed lines 225-238 from:
These options be modified later with the [toolbar configure] command. to:
These options can be modified later with the [toolbar configure] command. The -allowed option lets you specify a list of tokens of allowed items: these are the items which will be displayed in the customization dialog and which the user can choose to insert in the toolbar or not. If this option is not specified, AlphaX will use all the currently known toolbar items. The -default option lets you specify a list of tokens of default items: these are the items which constitute the default layout of the toolbar, used if the user has not yet customized the toolbar. They are displayed as a block at the bottom of the customization dialog. If this option is not specified, AlphaX provides a default layout containing the popup menus, and the "customize" and "print" items. Changed lines 323-325 from:
to:
Added lines 330-338:
When the -enable, -canRemove and -select properties are set globally on the toolbar, the possible values for these options are 0 or 1 (to unset or set the property respectively). When these options are used per-window (with the -w option), the possible values are 0, 1 or -1 with the following meaning:
Added line 396:
Changed line 521 from:
core commands support a -toolbar option which lets you specify the to:
core commands support a -bar option which lets you specify the Changed line 524 from:
If the -toolbar option is not specified, the window is created with to:
If the -bar option is not specified, the window is created with Changed line 611 from:
new -n "some window" -toolbar $tbar to:
new -n "some window" -bar $tbar Changed line 615 from:
edit -toolbar $tbar $someFile to:
edit -bar $tbar $someFile Added line 633:
February 05, 2009, at 01:24 PM
by - New features in 8,2b8
Deleted line 0:
Added line 89:
Added line 217:
February 05, 2009, at 01:22 PM
by - New features in 8,2b8
Changed lines 1-3 from:
noletocadom (:title The [toolbar] command:) to:
Changed lines 10-24 from:
to:
Changed line 34 from:
The [toolbar] command lets you interact with the Toolbar object located at to:
The [toolbar] command lets you interact with the toolbar located at Changed lines 36-43 from:
of this toolbar, to show or hide it and also to create new custom toolbar items. It is also possible to create programmatically, from a Tcl script, simple custom items to insert in the toolbar. These items work as an ordinary clickable toolbar button. Different options let you customize the appearance of the button (label, icon) and the Tcl proc to execute when the item is clicked. to:
of this toolbar, to show or hide it, to modify its contents by adding or removing items, to modify the properties of each item, etc. AlphaX provides some predefined toolbar items (print button, search field, separators, etc.) but it is also possible to create programmatically (i-e from a Tcl script) new custom items to insert in the toolbar. These items work as ordinary clickable toolbar buttons. Different options let you customize the appearance of an item (label, icon, help string) and the Tcl proc to execute when this item is clicked. AlphaX provides a default toolbar but, since version 8.2b8, it is also possible, with the [toolbar] command, to create new toolbars and attach them to some windows instead of the default toobar. Changed lines 60-63 from:
subcommand, various arguments and options can be specified additionnally. Many of the subcommands take a token argument. This is either the token returned by the [toolbar create] command if it refers to a custom item, or the symbolic name of a built-in item. to:
subcommand, various arguments and options can be additionnally specified. Many of the subcommands take a token argument to designate a toolbar item. This is either the token returned by the [toolbar create] command if it refers to a custom item, or the symbolic name of a built-in item. New toolbars are also identified by a unique token which is attributed by the [token new] command. Some of the subcommands accept a -bar option to specify on which toolbar they operate. If this option is not specified, the subcommand will apply to the default toolbar. The documentation, in the following sections, takes care of using different terms (itemToken and toolbarToken respectively) to clearly make the distinction between the two kinds of tokens. Changed lines 77-80 from:
toolbar add token ?-index value? Possible options are:
to:
toolbar add itemToken ?-index value? ?-bar toolbarToken? Here is the meaning of the possible options:
Changed lines 87-89 from:
toolbar configure option toolbar configure option value ?option value...? to:
toolbar configure ?-bar toolbarToken? option toolbar configure ?-bar toolbarToken? option value ?option value...? Added line 94:
Changed line 106 from:
to:
Changed line 115 from:
toolbar count to:
toolbar count ?-bar toolbarToken? Changed line 124 from:
Possible options are: to:
Here is the meaning of the possible options: Changed line 129 from:
to:
Changed lines 142-149 from:
to:
The [customize] subcommandThis command displays the sheet dialog which lets the user modify the layout and the contents of the toolbar. The syntax is: toolbar customize ?-w win? If the -w option is not specified, the command applies to the frontmost window. If there is no window, the command returns silently. The [delete] subcommandChanged lines 153-154 from:
toolbar delete token to:
toolbar delete itemToken Changed line 164 from:
The [hide] subcommandto:
Changed lines 171-173 from:
If the -w option is not specified, the command applies to the topmost document window. The [index] subcommandto:
If the -w option is not specified, the command applies to the frontmost document window. If there is no window, the command returns silently. The [index] subcommandChanged lines 177-178 from:
toolbar index token to:
toolbar index itemToken ?-bar toolbarToken? ?-all? Changed line 182 from:
If the item designated by token is not currently present in to:
If the item designated by itemToken is not currently present in Changed lines 185-190 from:
The [items] subcommandto:
In case the toolbar item has multiple instances in the toolbar and the option -all is specified, the command returns the list of all the matching indices. Otherwise only the first index found is returned. For instance, there could be multiple space or separator items. The [items] subcommandChanged lines 193-201 from:
toolbar items Only custom toolbar items created with the [toolbar add] command are included in this list. All the existing custom items are reported in the list, no matter whether they are inserted in the toolbar or not. The built-in items are not present in the list because they are always defined by the core and cannot be deleted. The [present] subcommandThis command returns whether a toolbar item is present in the toolbar. The to:
toolbar items ?-bar toolbarToken? ?-all? With the -all option the command returns a list of tokens for all the registered toolbar items: built-in items as well a custom items created with the [toolbar add] command are included in this list. All the existing items are reported in the list, no matter whether they are inserted in the toolbar or not. The tokens are in creation order. Otherwise, this command returns a list of tokens corresponding to the current layout of the toolbar specified by the -bar option or the default toolbar is there is no -bar option. This is the list of items inserted in the toolbar in the left to right order. The -bar option is irrelevant when the -all option is specified. The [list] subcommandThis command returns the list of all the existing toolbar tokens. The syntax is: toolbar list The default toolbar always corresponds to the first token of the list. The [new] subcommandThis command lets you create a new toolbar. The syntax is: toolbar new ?-autosave (0|1)? ?-locked (0|1)? It returns a unique token for the toolbar which can be used as the value of the -bar option supported by other subcommands. The -autosave and -lock options have the same meaning as with the [toolbar configure] command.
These options be modified later with the [toolbar configure] command. The [present] subcommandThis command tells whether a toolbar item is present in a toolbar. The Changed lines 228-230 from:
toolbar present token The [toolbar index] command applies to both built-in items and to:
toolbar present itemToken ?-bar toolbarToken? If the item designated by itemToken is not currently present in the toolbar, the command returns 0. Otherwise it returns 1. The [toolbar present] command applies to both built-in items and Changed lines 237-240 from:
If the item designated by token is not currently present in the toolbar, the command returns 0. Otherwise it returns 1. The [remove] subcommandto:
Changed lines 240-243 from:
toolbar remove token toolbar remove -index num to:
toolbar remove itemToken ?-bar toolbarToken? toolbar remove -index num ?-bar toolbarToken? Changed lines 254-258 from:
the -remove option had been used with value 1 to make the item non removable. The -remove option is intended to make an item non removable for the user: the item can still be removed programmatically by the [toolbar remove] command. The [search] subcommandto:
the -canRemove option had been specified with value 1 to make the item non removable. The -canRemove option is intended to make an item non removable for the user: the item can still be removed programmatically by the [toolbar remove] command. The [search] subcommandChanged line 283 from:
The [set] subcommandto:
Changed lines 289-292 from:
toolbar set token option toolbar set token option value ?option value...? to:
toolbar set itemToken ?-w win? ?-bar toolbarToken? option toolbar set itemToken ?-w win? ?-bar toolbarToken? option value ?option value...? Changed line 295 from:
item: only the -help, -label, -enabled, and -remove options to:
item: only the -help, -label, -enabled, and -canRemove options Added lines 303-304:
Changed lines 309-310 from:
to:
Changed lines 312-323 from:
The [show] subcommandto:
The -command and the -icon options cannot be set on built-in items. When both the -bar and the -w options are specified, they must correspond to each other, i-e the toolbar must be attached to this specific window, otherwise the command raises an error. If only the -w option is specified, the toolbar will be, by default, this window's toolbar: if the window has no toolbar, the command returns an error. If neither the -bar option, nor the -w option are specified, the command applies to the default toolbar and affects the item in all the windows containing this toolbar. The [show] subcommandChanged lines 330-331 from:
topmost document window. The [visible] subcommandto:
frontmost document window. If there is no window, the command returns silently. The [visible] subcommandChanged line 339 from:
topmost document window. If the window does not have a toolbar or if no to:
frontmost document window. If the window does not have a toolbar or if no Added lines 341-357:
The [which] subcommandThis subcommand is the opposite of the [hide] subcommand. It lets you display the toolbar if it is hidden. toolbar which ?-w win? ?toolbarToken? If the -w option is not specified, the command applies to the frontmost document window. If there is no window, the command returns silently. If the last argument toolbarToken is not specified, the command returns the token of the toolbar currently attached to the window or an empty string if there is no toolbar. If toolbarToken is specified and is the token of an existing toolbar, the toolbar currently attached to the window (if any) is removed and replaced by the new one. As a special case, one can specify an empty string for the toolbarToken argument in order to just detach the current toolbar from the window. Changed line 359 from:
Built-in toolbar itemsto:
Changed lines 361-365 from:
They are referred to a built-in toolbar items because they are not created programmatically with the [toolbar create] command. They all have a symbolic name to use in place of the token argument expected by some toolbar subcommands. Here is the list of symbolic names: to:
They are referred to as built-in toolbar items because they are not created programmatically with the [toolbar create] command. They all have a symbolic name to use in place of the itemToken argument expected by some toolbar subcommands. Here is the list of symbolic names: Added line 371:
Changed lines 375-377 from:
The browse, print, and search items are linked to the toolbar::doBrowse, toolbar::doPrint, and toolbar::doSearch Tcl procs respectively. These procs are defined by AlphaTcl in the file Tcl/SystemCode/toolbar.tcl. to:
The browse, print, and search items have predefined commands which cannot be modified with [toolbar set]. The corresponding procs are respectively toolbar::doBrowse, toolbar::doPrint, and toolbar::doSearch. These procs are defined by AlphaTcl in the file Tcl/SystemCode/toolbar.tcl. Changed line 384 from:
Icon codesto:
Changed line 391 from:
Registered custom codesto:
Changed lines 397-398 from:
available in the IconrefCommand page on this wiki. Predefined codesto:
Changed lines 494-519 from:
Examplesto:
Attaching a toolbarSince version 8.2b8 of AlphaX, the [new] and the [openFile] core commands support a -toolbar option which lets you specify the token of a toolbar to attach to the window they create. This option is also available with the [edit] proc. If the -toolbar option is not specified, the window is created with the default toolbar defined by AlphaX, unless there is an -attr option containing the No Toolbar attribute (see the WindowAttributes page). Toolbar visibilityThe Toolbar Visible global preference lets you specify if the toolbar attached to a window should be initially visible. If this preference is set to 0, a newly created window will not display the toolbar: in order to make the toolbar visible, one must click on the oval button located at the right of the title bar of the window. The Toolbar Visible preference can be found in the Window panel of the preferences dialog displayed by the AlphaX >Preferences > Global Preferences command. The oval button can be used to hide or display the toolbar attached to a window. Pressing the option key while clicking in this button toggles the tollbar's visibility for all the windows and not only for the current one. Pressing the command key while clicking in this button lets you modify the size and the display mode of the toolbar. Programmatically, it is also possible to create windows which do not have a toolbar at all. See the WindowAttributes page. ExamplesChanged lines 529-530 from:
toolbar configure -mode label toolbar configure -mode default to:
toolbar configure -mode label
toolbar configure -mode default
Changed lines 532-534 from:
toolbar configure -autosave
toolbar configure -autosave 1
toolbar configure -autosave 0
to:
toolbar configure -locked
toolbar configure -locked 1
toolbar configure -locked 0
Deleted lines 535-538:
toolbar configure -lock
toolbar configure -lock 1
toolbar configure -lock 0
Added line 542:
toolbar customize -w $w Added lines 577-608:
To create a new toolbar and add a few toolbar items to it:
set tbar [toolbar new]
toolbar add browse -bar $tbar
toolbar add flexible -bar $tbar
toolbar add print -bar $tbar
To create a new window with this toolbar:
new -n "some window" -toolbar $tbar
To edit a file in a window with the new toolbar:
edit -toolbar $tbar $someFile
To disable the "print" toolbar item only in a given window:
toolbar set print -w $someWindow -enable 0
To prevent the "search" field to be removed from a toolbar which contains it:
toolbar set search -canRemove 0
If this property must be set only on a particular window:
toolbar set search -canRemove 0 -w $someWindow
November 05, 2007, at 05:52 AM
by -
Added line 1:
noletocadom October 19, 2007, at 05:13 AM
by - spam cleanup
Deleted line 0:
oloccvar October 19, 2007, at 12:07 AM
by -
Added line 1:
oloccvar January 11, 2007, at 08:08 PM
by - Fixed a link
Changed line 304 from:
available in the [Commands.IconrefCommand] page on this wiki. to:
available in the IconrefCommand page on this wiki. January 11, 2007, at 08:01 PM
by - Title
Added lines 1-2:
(:title The [toolbar] command:) December 18, 2006, at 12:59 PM
by - Doc for [toolbar search]
Changed line 214 from:
to:
Changed lines 216-217 from:
to:
December 18, 2006, at 12:57 PM
by - Doc for [toolbar search]
Deleted line 0:
Changed lines 202-204 from:
properties of the Search Field toolbar item. It assumes that the search field item is present in the toolbar otherwise it raises an error. to:
properties of the Search Field toolbar item. Changed line 214 from:
to:
Changed lines 216-217 from:
to:
December 18, 2006, at 12:54 PM
by - Doc for [toolbar search]
Added line 1:
Changed lines 16-23 from:
to:
Changed lines 201-204 from:
The [set] subcommandThe [toolbar set] command lets you get or set the value of certain properties of a custom toolbar item previously created by a [toolbar add] command. to:
The [search] subcommandThe [toolbar search] command lets you get or set the value of certain properties of the Search Field toolbar item. It assumes that the search field item is present in the toolbar otherwise it raises an error. Changed lines 208-218 from:
toolbar set token option toolbar set token option value ?option value...? The [toolbar set] command applies to both built-in items and custom items but not all options are supported when applied to a built-in item: only the -help, -label, -enabled, and -remove options can be set for built-in items; the -icon and -command options are ignored. The first form returns the value of the option specified as the fourth to:
toolbar search option toolbar search option value ?option value...? The first form returns the value of the option specified as the third Added lines 216-246:
When an item is selected in the menu attached to the search field, the [toolbar::searchMenuProc] proc is invoked with the index of the selected item as argument. To reset the menu, just pass an empty list like this:
toolbar search -menu {}
The [set] subcommandThe [toolbar set] command lets you get or set the value of certain properties of a custom toolbar item previously created by a [toolbar add] command. There are two forms for the syntax of this subcommand: toolbar set token option toolbar set token option value ?option value...? The [toolbar set] command applies to both built-in items and custom items but not all options are supported when applied to a built-in item: only the -help, -label, -enabled, and -remove options can be set for built-in items; the -icon and -command options are ignored. The first form returns the value of the option specified as the fourth argument. The second form lets you set the value of various options. Here is the description of the currently available options: Changed line 253 from:
The [show] subcommandto:
The [show] subcommandChanged line 261 from:
The [visible] subcommandto:
The [visible] subcommandChanged lines 263-265 from:
visible. If the window has no toolbar, or if no window is open, 0 is returned. to:
visible. If the window has no toolbar, false is returned. Changed lines 268-269 from:
topmost document window. to:
topmost document window. If the window does not have a toolbar or if no window is open, the command returns 0. Changed line 271 from:
Built-in toolbar itemsto:
Built-in toolbar itemsChanged line 291 from:
Icon codesto:
Icon codesChanged line 298 from:
Registered custom codesto:
Registered custom codesChanged line 305 from:
Predefined codesto:
Predefined codesChanged line 401 from:
Examplesto:
ExamplesDecember 15, 2006, at 06:04 AM
by - Added [toolbar visible]
Deleted line 0:
Changed lines 235-236 from:
visible. If the window has no toolbar, false is returned. to:
visible. If the window has no toolbar, or if no window is open, 0 is returned. Changed lines 241-242 from:
topmost document window. If the window does not have a toolbar or if no window is open, the command returns 0. to:
topmost document window. December 15, 2006, at 06:02 AM
by - Added [toolbar visible]
Changed lines 18-22 from:
to:
Added lines 234-242:
The [visible] subcommandThis subcommand returns whether the toolbar (if any) attached to a window is visible. If the window has no toolbar, false is returned. toolbar visible ?-w win? If the -w option is not specified, the command applies to the topmost document window. If the window does not have a toolbar or if no window is open, the command returns 0. Changed line 244 from:
Built-in toolbar itemsto:
Built-in toolbar itemsChanged line 264 from:
Icon codesto:
Icon codesChanged line 271 from:
Registered custom codesto:
Registered custom codesChanged line 278 from:
Predefined codesto:
Predefined codesChanged line 374 from:
Examplesto:
ExamplesDecember 08, 2006, at 09:22 AM
by - Doc about built-in items.
Added line 1:
Changed lines 4-16 from:
to:
Changed line 25 from:
Introductionto:
Changed lines 34-35 from:
(label, icon) and the Tcl proc to execute when the item is clicked. The AlphaTcl library takes advantage of the techniques explained below in its always-on toolbar package: more info about this in the ToolbarPackage page. Synopsisto:
(label, icon) and the Tcl proc to execute when the item is clicked. There are two kinds of toolbar items:
Both kinds of toolbar items can be added to or removed from the toolbar. SynopsisChanged lines 45-47 from:
The possible subcommands are described below. Depending on the subcommand, various arguments and options can be specified additionnally. The [add] subcommandto:
The possible subcommands are described below. Depending on the subcommand, various arguments and options can be specified additionnally. Many of the subcommands take a token argument. This is either the token returned by the [toolbar create] command if it refers to a custom item, or the symbolic name of a built-in item. The [add] subcommandChanged lines 61-64 from:
The token argument is the value returned by the '''[toolbar create]''' command. The [configure] subcommandto:
The [toolbar add] command applies to both built-in items and custom items. The [configure] subcommandChanged lines 75-76 from:
to:
Changed lines 88-94 from:
The [create] subcommandto:
The [count] subcommandThis command returns the number of items currently installed in the toolbar, including spaces, flexible spaces and separators. The syntax is: toolbar count The [create] subcommandChanged line 120 from:
The [delete] subcommandto:
The [delete] subcommandChanged lines 133-135 from:
The [hide] subcommandto:
Built-in toolbar items cannot be deleted with [toolbar delete]. The [hide] subcommandChanged lines 144-155 from:
The [items] subcommandto:
The [index] subcommandThis command returns the index of a toolbar item in the toolbar. The syntax is: toolbar index token The [toolbar index] command applies to both built-in items and custom items. If the item designated by token is not currently present in the toolbar, the command returns -1. Otherwise it returns the position of the item in the left to right order. The leftmost position is at index 0. The [items] subcommandChanged lines 160-166 from:
Only custom toolbar items created with the [toolbar add] command are included in this list. The [remove] subcommandThis command removes an item inserted in the toolbar. Its unique argument is the token designating the toolbar item (and which was returned by the [toolbar create] command). The syntax is: to:
Only custom toolbar items created with the [toolbar add] command are included in this list. All the existing custom items are reported in the list, no matter whether they are inserted in the toolbar or not. The built-in items are not present in the list because they are always defined by the core and cannot be deleted. The [present] subcommandThis command returns whether a toolbar item is present in the toolbar. The syntax is: toolbar present token The [toolbar index] command applies to both built-in items and custom items. The item could have been removed from the toolbar programmatically with the [toolbar remove] command, or manually by the user. If the item designated by token is not currently present in the toolbar, the command returns 0. Otherwise it returns 1. The [remove] subcommandThis command removes an item inserted in the toolbar. The syntax has two forms: Added lines 183-193:
toolbar remove -index num The first form uses the token of the item. The second one lets you remove an item at a specified index: the index is the position of the item in the toolbar in the left to right order. The leftmost item is at index 0. This can be useful in order to remove a separator, a space or a flexible space, since these items do not have a token. The [toolbar remove] command applies to both built-in items and custom items. Changed line 199 from:
The [set] subcommandto:
The [set] subcommandChanged lines 209-210 from:
The token argument is the token returned by the [toolbar add] command when the toolbar item was created. to:
The [toolbar set] command applies to both built-in items and custom items but not all options are supported when applied to a built-in item: only the -help, -label, -enabled, and -remove options can be set for built-in items; the -icon and -command options are ignored. Changed line 225 from:
The [show] subcommandto:
The [show] subcommandChanged lines 233-241 from:
Icon codesThe four char codes corresponding to the various system icons which can be used with the -iconref in the [toolbar add] command are defined in the header file Icons.h found in the HIServices framework. For convenience, here is a list of the main icons with the corresponding code. Note that the single quotes are not part of the code and should not be passed to the -iconref option. to:
Built-in toolbar itemsThe AlphaX application provides several useful toolbar items. They are referred to a built-in toolbar items because they are not created programmatically with the [toolbar create] command. They all have a symbolic name to use in place of the token argument expected by some toolbar subcommands. Here is the list of symbolic names: Added lines 242-274:
The browse, print, and search items are linked to the toolbar::doBrowse, toolbar::doPrint, and toolbar::doSearch Tcl procs respectively. These procs are defined by AlphaTcl in the file Tcl/SystemCode/toolbar.tcl. Icon codesThe -iconref option available in the [toolbar create] and [toolbar set] commands to attach an icon to a toolbar item expects a four character code as its value. One can use one of the predefined icon codes provided by the system: the most common ones are given in the table below. Additionnally, AlphaTcl packages have the possibility of declaring new types using the [iconref] command as explained in the next section. Registered custom codesThere is a new [iconref] command introduced in Alpha 8.1 which lets you register custom icons to use with the -iconref option. This command is used to declare and register a new type with the Icon Services. Once it is registered, one can use this type in any command supporting an -iconref option. More info about the [iconref] command is available in the [Commands.IconrefCommand] page on this wiki. Predefined codesThe predefined four character codes provided by the system are defined in the header file Icons.h found in the HIServices framework. For convenience, here is a list of the main icons with their corresponding code. Note that the single quotes are not part of the code and should not be passed to the -iconref option. Changed line 295 from:
to:
Changed line 364 from:
Examplesto:
ExamplesChanged lines 374-375 from:
toolbar configure -mode label
toolbar configure -mode default
to:
toolbar configure -mode label toolbar configure -mode default Added lines 377-380:
toolbar configure -autosave
toolbar configure -autosave 1
toolbar configure -autosave 0
Deleted lines 424-433:
Here are two instructions which will create two custom toolbar items. They are associated respectively with some hypothetical tb::doquery and file::revealDesktop Tcl procs which must be defined somewhere. set tbi1 [toolbar create -label "Query" -icon "help" -command tb::doquery] toolbar add $tbi1 set tbi1 [toolbar create -label "Desktop" -icon "desk" -command file::revealDesktop] toolbar add $tbi2 The result is shown on the image below: http://alphatcl.sourceforge.net/wiki/pub/images/tollbarItems.png December 04, 2006, at 03:02 PM
by - Misaligned list items
Changed line 60 from:
** iconlabel indicates to display the image as well as the label of the toolbar items to:
Changed line 66 from:
** normal indicates to use a larger text and icon size to:
June 24, 2006, at 04:44 PM
by - Leftovers of old syntax
Changed line 201 from:
to:
Changed lines 280-281 from:
toolbar configure -mode label toolbar configure -mode default to:
toolbar configure -mode label
toolbar configure -mode default
Deleted lines 282-285:
toolbar configure -autosave
toolbar configure -autosave 1
toolbar configure -autosave 0
June 24, 2006, at 04:40 PM
by - Leftovers of old syntax
Changed lines 334-335 from:
toolbar add -label "Query" -icon "help" -command tb::doquery toolbar add -label "Desktop" -icon "desk" -command file::revealDesktop to:
set tbi1 [toolbar create -label "Query" -icon "help" -command tb::doquery] toolbar add $tbi1 set tbi1 [toolbar create -label "Desktop" -icon "desk" -command file::revealDesktop] toolbar add $tbi2 June 19, 2006, at 08:12 AM
by - Added link to Development/ToolbarPackage
Changed line 27 from:
(label, icon) and the Tcl proc to execute when the item is clicked. to:
(label, icon) and the Tcl proc to execute when the item is clicked. The AlphaTcl library takes advantage of the techniques explained below in its always-on toolbar package: more info about this in the ToolbarPackage page. June 11, 2006, at 05:19 AM
by - Enhanced [toolbar] command (8.1a4d4)
Added lines 7-8:
Changed lines 24-27 from:
If you are looking for basic information about the toolbar graphic interface and user interaction, see the AlphaToolbar page on this Wiki. to:
It is also possible to create programmatically, from a Tcl script, simple custom items to insert in the toolbar. These items work as an ordinary clickable toolbar button. Different options let you customize the appearance of the button (label, icon) and the Tcl proc to execute when the item is clicked. Changed line 34 from:
various options can be specified additionnally. to:
various arguments and options can be specified additionnally. Changed lines 36-40 from:
It is possible to create programmatically from a Tcl script simple custom items to insert in the toolbar. These items work as an ordinary clickable toolbar button. Different options let you customize the appearance of the button (label, icon) and the Tcl proc to execute when the item is clicked. to:
This command lets you instantiate an item previously created with the [toolbar create] command. It is equivalent to choosing this item from the customization sheet and dragging it to the toolbar. Changed lines 42-43 from:
toolbar add ?option value? ?option value...? to:
toolbar add token ?-index value? Changed lines 45-58 from:
The [toolbar add] command returns a token which can be used later in other commands, such as the [toolbar remove] and the [toolbar set] commands. Note that these custom toolbar items cannot be removed from the toolbar by the user using the Remove Item command in the contextual menu: you can remove them only programmatically with the [toolbar remove] command. to:
The token argument is the value returned by the '''[toolbar create]''' command. Deleted line 54:
Changed line 60 from:
to:
** iconlabel indicates to display the image as well as the label of the toolbar items Changed line 66 from:
to:
** normal indicates to use a larger text and icon size Changed lines 69-70 from:
to:
The [toolbar configure] command concerns properties of the toolbar object itself: to modify the properties of a particular item in the toolbar, use the [toolbar set] command instead. The [create] subcommandThis is the command used to declare a new toolbar item and to set its initial properties. The general syntax of this subcommand is: toolbar create ?option value? ?option value...? Possible options are:
The [toolbar create] command returns a token which can be used later in other commands, such as the [toolbar add], the [toolbar remove] or the [toolbar set] commands. Note that this command does not insert the toolbar item in the toolbar. It just declares a new type of custom toolbar item. To insert one in the toolbar one must use the [toolbar add] command with the token returned by the [toolbar create] command. All the items created with the [toolbar create] command are displayed in the customization dialog so that an user can insert them manually into the toolbar. The [delete] subcommandThis command deletes an item previously created with the [toolbar create] command). The syntax is: toolbar delete token Once deleted this item will not be displayed in the customization dialog anymore and the token associated with it will not be valid anymore. If an instance of the item has been previously inserted in the toolbar (for instance with the [toolbar add] command or as a result of an user action), it will be removed from the toolbar. If you only want to remove an item from the toolbar, use the [toolbar remove] command instead of [toolbar delete]. Changed lines 132-133 from:
[toolbar add] command). The syntax is: to:
[toolbar create] command). The syntax is: Changed lines 136-137 from:
Only toolbar items created with the [toolbar add] command can be removed. The info menus and position indicators are not removeable. to:
Note that this command will remove an item from the toolbor even if the -remove option had been used with value 1 to make the item non removable. The -remove option is intended to make an item non removable for the user: the item can still be removed programmatically by the [toolbar remove] command. Changed lines 161-165 from:
Note that these custom toolbar items cannot be removed from the toolbar by the user using the Remove Item command in the contextual menu: you can remove them only programmatically with the [toolbar remove] command. to:
Changed lines 169-170 from:
If the -w option is not specified, the command applies to the topmost document window. to:
If the -w option is not specified, the command applies to the topmost document window. Added lines 272-332:
toolbar configure -size
toolbar configure -size small
toolbar configure -size default
toolbar configure -mode
toolbar configure -mode iconlabel
toolbar configure -mode icon
toolbar configure -mode label
toolbar configure -mode default
toolbar configure -autosave
toolbar configure -autosave 1
toolbar configure -autosave 0
toolbar configure -lock
toolbar configure -lock 1
toolbar configure -lock 0
toolbar hide
toolbar show
set w "some window"
toolbar hide -w $w
toolbar show -w $w
To create a new toolbar item:
set tbi [toolbar create -label "Desktop" -help "Reveal the desktop" \
-icon "desk" -command file::revealDesktop]
The tbi variable contains the token designating the new toolbar item. At this point, this item is displayed in the customization sheet (invoked by clicking on the Customize toolbar item or by invoking the ''Customize toolbar'' command in the contextual menu associated with the toolbar). It can be inserted in the toolbar manually by dragging it from the customization dialog and dropping it on the toolbar, or programmatically like this:
toolbar add $tbi
One can modify certain properties of a toolbar item using the ''[toolbar set]'' command. The following example modifies both the label and the icon of the previous item:
toolbar set $tbi -label "Finder" -icon "help"
To remove the item from the toolbar:
toolbar remove $tbi
To reinsert it, use [toolbar add $tbi] again. To destroy it entirely:
toolbar delete $tbi
After a [toolbar delete] command, the $tbi token is not valid anymore and the item will not show anymore in the customization sheet. Here are two instructions which will create two custom toolbar items. They are associated respectively with some hypothetical tb::doquery and file::revealDesktop Tcl procs which must be defined somewhere. Changed lines 334-357 from:
toolbar configure -size toolbar configure -size small toolbar configure -size default toolbar configure -mode toolbar configure -mode iconlabel toolbar configure -mode icon toolbar configure -mode label toolbar configure -mode default toolbar configure -autoconfig toolbar configure -autoconfig 1 toolbar configure -autoconfig 0 toolbar configure -lock toolbar configure -lock 1 toolbar configure -lock 0 toolbar hide toolbar show set w "some window" toolbar hide -w $w toolbar show -w $w to:
toolbar add -label "Query" -icon "help" -command tb::doquery toolbar add -label "Desktop" -icon "desk" -command file::revealDesktop Deleted lines 336-340:
Here are two instructions which will create two custom toolbar items. They are associated respectively with some hypothetical tb::doquery and file::revealDesktop Tcl procs which must be defined somewhere. toolbar add -label "Query" -help "Call the query info dialog" -iconref "help" -command tb::doquery toolbar add -label "Desktop" -help "kDesktopIcon" -iconref "desk" -command file::revealDesktop May 25, 2006, at 11:24 PM
by - Fixed indentation of list items
Added line 61:
Changed line 67 from:
** iconlabel indicates to display the image as well as the label of the toolbar items to:
Changed line 73 from:
** normal indicates to use a larger text and icon size to:
May 18, 2006, at 08:40 AM
by - Added image to illustrate code snippet
Changed line 262 from:
[@ to:
[@
May 18, 2006, at 08:39 AM
by - Added image to illustrate code snippet
Changed line 261 from:
Here are two instructions which will create two custom toolbar items. They are associated respectively with some hypothetical tb::doquery and file::revealDesktop Tcl procs which must be defined somewhere. to:
Here are two instructions which will create two custom toolbar items. They are associated respectively with some hypothetical tb::doquery and file::revealDesktop Tcl procs which must be defined somewhere. May 18, 2006, at 08:37 AM
by - Added image to illustrate code snippet
Deleted lines 259-262:
toolbar add -label "Query" -help "Call the query info dialog" -iconref "qery" -command tb::doquery toolbar add -label "Desktop" -help "kDesktopIcon" -iconref "desk" -command file::revealDesktop Added lines 261-267:
Here are two instructions which will create two custom toolbar items. They are associated respectively with some hypothetical tb::doquery and file::revealDesktop Tcl procs which must be defined somewhere. toolbar add -label "Query" -help "Call the query info dialog" -iconref "help" -command tb::doquery toolbar add -label "Desktop" -help "kDesktopIcon" -iconref "desk" -command file::revealDesktop The result is shown on the image below: http://alphatcl.sourceforge.net/wiki/pub/images/tollbarItems.png May 11, 2006, at 02:23 PM
by - Link to Interface/AlphaToolbar
Added lines 21-22:
If you are looking for basic information about the toolbar graphic interface and user interaction, see the AlphaToolbar page on this Wiki. April 24, 2006, at 08:03 AM
by -
Changed line 233 from:
[= to:
[@
Changed line 262 from:
=] to:
@] April 23, 2006, at 08:55 AM
by -
Changed lines 120-121 from:
to:
April 23, 2006, at 08:54 AM
by -
Changed lines 120-121 from:
to:
April 23, 2006, at 08:50 AM
by -
Deleted line 0:
Added line 232:
Here is a list a short commands which can be executed from the Tcl shell in AlphaX: Changed lines 234-261 from:
toolbar configure -size
toolbar configure -size small
toolbar configure -size default
toolbar configure -mode
toolbar configure -mode iconlabel
toolbar configure -mode icon
toolbar configure -mode label
toolbar configure -mode default
toolbar configure -autoconfig
toolbar configure -autoconfig 1
toolbar configure -autoconfig 0
toolbar configure -lock
toolbar configure -lock 1
toolbar configure -lock 0
toolbar hide
toolbar show
set w "some window"
toolbar hide -w $w
toolbar show -w $w
toolbar add -label "Query" -help "Call the query info dialog" -iconref "qery" -command tb::doquery
toolbar add -label "Desktop" -help "kDesktopIcon" -iconref "desk" -command file::revealDesktop
to:
toolbar configure -size toolbar configure -size small toolbar configure -size default toolbar configure -mode toolbar configure -mode iconlabel toolbar configure -mode icon toolbar configure -mode label toolbar configure -mode default toolbar configure -autoconfig toolbar configure -autoconfig 1 toolbar configure -autoconfig 0 toolbar configure -lock toolbar configure -lock 1 toolbar configure -lock 0 toolbar hide toolbar show set w "some window" toolbar hide -w $w toolbar show -w $w toolbar add -label "Query" -help "Call the query info dialog" -iconref "qery" -command tb::doquery toolbar add -label "Desktop" -help "kDesktopIcon" -iconref "desk" -command file::revealDesktop April 23, 2006, at 08:48 AM
by -
Added lines 1-262:
IntroductionThe [toolbar] command lets you interact with the Toolbar object located at the top of the document windows. It is possible to modify the attributes of this toolbar, to show or hide it and also to create new custom toolbar items. SynopsisThe formal syntax of the [toolbar] command is: toolbar subcommand ?options? The possible subcommands are described below. Depending on the subcommand, various options can be specified additionnally. The [add] subcommandIt is possible to create programmatically from a Tcl script simple custom items to insert in the toolbar. These items work as an ordinary clickable toolbar button. Different options let you customize the appearance of the button (label, icon) and the Tcl proc to execute when the item is clicked. The general syntax of this subcommand is: toolbar add ?option value? ?option value...? Possible options are:
The [toolbar add] command returns a token which can be used later in other commands, such as the [toolbar remove] and the [toolbar set] commands. Note that these custom toolbar items cannot be removed from the toolbar by the user using the Remove Item command in the contextual menu: you can remove them only programmatically with the [toolbar remove] command. The [configure] subcommandThere are two forms for the syntax of this subcommand: toolbar configure option toolbar configure option value ?option value...? The first form returns the value of the option specified as the third argument. The second form lets you set the value of different options. Here is the description of the currently available options:
** iconlabel indicates to display the image as well as the label of the toolbar items
** normal indicates to use a larger text and icon size
The [hide] subcommandThis command lets you hide the toolbar for a particular window. This is the same as clicking on the top right oval button located in the titlebar (not toolbar) of the window. The syntax is: toolbar hide ?-w win? If the -w option is not specified, the command applies to the topmost document window. The [items] subcommandThis command returns the list of the custom toolbar items. The syntax is: toolbar items Only custom toolbar items created with the [toolbar add] command are included in this list. The [remove] subcommandThis command removes an item inserted in the toolbar. Its unique argument is the token designating the toolbar item (and which was returned by the [toolbar add] command). The syntax is: toolbar remove token Only toolbar items created with the [toolbar add] command can be removed. The info menus and position indicators are not removeable. The [set] subcommandThe [toolbar set] command lets you get or set the value of certain properties of a custom toolbar item previously created by a [toolbar add] command. There are two forms for the syntax of this subcommand: toolbar set token option toolbar set token option value ?option value...? The token argument is the token returned by the [toolbar add] command when the toolbar item was created. The first form returns the value of the option specified as the fourth argument. The second form lets you set the value of various options. Here is the description of the currently available options:
Note that these custom toolbar items cannot be removed from the toolbar by the user using the Remove Item command in the contextual menu: you can remove them only programmatically with the [toolbar remove] command. The [show] subcommandThis subcommand is the opposite of the [hide] subcommand. It lets you display the toolbar if it is hidden. toolbar show ?-w win? If the -w option is not specified, the command applies to the topmost document window. Icon codesThe four char codes corresponding to the various system icons which can be used with the -iconref in the [toolbar add] command are defined in the header file Icons.h found in the HIServices framework. For convenience, here is a list of the main icons with the corresponding code. Note that the single quotes are not part of the code and should not be passed to the -iconref option.
Examples
toolbar configure -size
toolbar configure -size small
toolbar configure -size default
toolbar configure -mode
toolbar configure -mode iconlabel
toolbar configure -mode icon
toolbar configure -mode label
toolbar configure -mode default
toolbar configure -autoconfig
toolbar configure -autoconfig 1
toolbar configure -autoconfig 0
toolbar configure -lock
toolbar configure -lock 1
toolbar configure -lock 0
toolbar hide
toolbar show
set w "some window"
toolbar hide -w $w
toolbar show -w $w
toolbar add -label "Query" -help "Call the query info dialog" -iconref "qery" -command tb::doquery
toolbar add -label "Desktop" -help "kDesktopIcon" -iconref "desk" -command file::revealDesktop
|
|
Edit -
History -
Print -
Recent Changes -
Search
Page last modified on February 05, 2009, at 01:45 PM
|
Hosted on
|