Recent Changes - Search:

WikiDoc

Categories

The [floatMenu] command

Commands.FloatMenuCommand History

Hide minor edits - Show changes to markup

October 22, 2009, at 06:26 AM by bd - Page layout
Changed lines 151-190 from:
  • the -dynamic option lets you specify whether the floating

menu should be updated automatically whenever the corresponding menu is modified. The possible values are 0 and 1 (which is the default). If this option is set to 0, you can still update the float menu programmatically using the [floatMenu refresh] command.

  • the -height option lets you specify the height of the items in

the float. If it is not specified or if it is equal to -1, the height for eacg item is automatically set to the best value based on the text and font used to draw the item. The default value is -1.

  • the -interspace option lets you specify an extra horizontal

margin which will be inserted to separate the items from each other. The default value is 0.

  • the -justify option lets you specify the alignment of the

menu items in the floating window: the possible values are left, center or right. The default value is left.

  • the -left and -top options let you specify the

position (left and top) of the upper-left corner of the float in screen coordinates. The default values for these options is 0.

  • the -menu option lets you specify the token of the menu which

will be turned into a floating palette. Its value is a token corresponding to a valid already existing menu: typically this menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page). With the [floatMenu create] command, this argument is required.

  • the -name option lets you specify a name for the floating

window. It is written in the title bar of the window. If this option is not specified when the floating menu is created, the name of the menu is used as a default. In order to have no title in the title bar, specify an empty string.

  • the -sidebar option lets you specify a vertical orientation

for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).

  • the -visible option lets you get or set the visibility of the

floating menu. By default, a floating menu is made visible when it is created: this can be changed with the -visible option set to 0 in the [floatMenu create] command.

  • the -width option lets you specify the width of the float. If

it is not specified or if it is equal to -1, the width of the float is adjusted to the widest item in the menu. The default value is -1.

to:
  • the -dynamic option lets you specify whether the floating menu should be updated automatically whenever the corresponding menu is modified. The possible values are 0 and 1 (which is the default). If this option is set to 0, you can still update the float menu programmatically using the [floatMenu refresh] command.
  • the -height option lets you specify the height of the items in the float. If it is not specified or if it is equal to -1, the height for eacg item is automatically set to the best value based on the text and font used to draw the item. The default value is -1.
  • the -interspace option lets you specify an extra horizontal margin which will be inserted to separate the items from each other. The default value is 0.
  • the -justify option lets you specify the alignment of the menu items in the floating window: the possible values are left, center or right. The default value is left.
  • the -left and -top options let you specify the position (left and top) of the upper-left corner of the float in screen coordinates. The default values for these options is 0.
  • the -menu option lets you specify the token of the menu which will be turned into a floating palette. Its value is a token corresponding to a valid already existing menu: typically this menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page). With the [floatMenu create] command, this argument is required.
  • the -name option lets you specify a name for the floating window. It is written in the title bar of the window. If this option is not specified when the floating menu is created, the name of the menu is used as a default. In order to have no title in the title bar, specify an empty string.
  • the -sidebar option lets you specify a vertical orientation for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).
  • the -visible option lets you get or set the visibility of the floating menu. By default, a floating menu is made visible when it is created: this can be changed with the -visible option set to 0 in the [floatMenu create] command.
  • the -width option lets you specify the width of the float. If it is not specified or if it is equal to -1, the width of the float is adjusted to the widest item in the menu. The default value is -1.
October 22, 2009, at 06:22 AM by bd - Document the -dynamic option and refresh subcmd
Changed lines 2-3 from:
This file documents the [floatMenu] command introduced in version 8.1 of AlphaX.
to:

(:title The [floatMenu] command:)

This file documents the [floatMenu] command as of version 8.2b15 of AlphaX.
Changed lines 13-18 from:
to:
Changed lines 24-25 from:

menus in Alpha.

to:

menus in Alpha. It was introduced in version 8.1 of AlphaX

Changed lines 46-47 from:
 floatMenu create -menu menuToken [(-height|-width|-left|-top|-interspace) val]           [-name winname] [-justify (left|center|right)] [-sidebar (0|1)]
to:
     floatMenu create -menu menuToken [(-height|-width|-left|-top|-interspace) val]           [-name winname] [-justify (left|center|right)] [-sidebar (0|1)]  		 [-dynamic (0|1)]
Changed lines 55-56 from:

The possible options are described in the Floating menu options section below. By default, a floating window is made visible when it is created unless the -visible option was specified with value 0.

to:

The possible options are described in the Floating menu options section below. By default, a floating window is made visible when it is created unless the -visible option was specified with value 0.

Changed lines 99-101 from:

The [set] subcommand

This subcommand lets you get or set several properties attached to a menu item. The syntax can take two forms:

to:

The [refresh] subcommand

This subcommand lets you refresh the buttons of an already built floating menu. The syntax is:

Changed lines 103-104 from:
     floatMenu set token option
     floatMenu set token option value ?option value...?
to:
     floatMenu refresh [-remake] token
Added lines 105-115:

If the -remake option is specified, the floating menu buttons will be entirely rebuilt. Otherwise, only the contents of the existing buttons will be refreshed in order to reflect the current properties of the coresponding menu item (name, icon, etc.).

The [set] subcommand

This subcommand lets you get or set several properties attached to a menu item. The syntax can take two forms:

 
     floatMenu set token option
     floatMenu set token option value ?option value...?

Changed line 126 from:

The [show] subcommand

to:

The [show] subcommand

Changed line 134 from:

The [top] subcommand

to:

The [top] subcommand

Changed line 145 from:

Floating menu options

to:

Floating menu options

Changed lines 151-171 from:
  • the -menu option lets you specify the token of the menu which will be turned into a floating palette. Its value is a token corresponding to a valid already existing menu: typically this menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page). With the [floatMenu create] command, this argument is required.

  • the -name option lets you specify a name for the floating window. It is written in the title bar of the window. If this option is not specified when the floating menu is created, the name of the menu is used as a default. In order to have no title in the title bar, specify an empty string.

  • the -height option lets you specify the height of the items in the float. If it is not specified or if it is equal to -1, the height for eacg item is automatically set to the best value based on the text and font used to draw the item. The default value is -1.

  • the -interspace option lets you specify an extra horizontal margin which will be inserted to separate the items from each other. The default value is 0.

  • the -left and -top options let you specify the position (left and top) of the upper-left corner of the float in screen coordinates. The default values for these options is 0.

  • the -justify option lets you specify the alignment of the menu items in the floating window: the possible values are left, center or right. The default value is left.

  • the -sidebar option lets you specify a vertical orientation for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).

  • the -visible option lets you get or set the visibility of the floating menu. By default, a floating menu is made visible when it is

created: this can be changed with the -visible option set to 0 in the [floatMenu create] command.

  • the -width option lets you specify the width of the float. If it is not specified or if it is equal to -1, the width of the float is adjusted to the widest item in the menu. The default value is -1.

Hooks

to:
  • the -dynamic option lets you specify whether the floating

menu should be updated automatically whenever the corresponding menu is modified. The possible values are 0 and 1 (which is the default). If this option is set to 0, you can still update the float menu programmatically using the [floatMenu refresh] command.

  • the -height option lets you specify the height of the items in

the float. If it is not specified or if it is equal to -1, the height for eacg item is automatically set to the best value based on the text and font used to draw the item. The default value is -1.

  • the -interspace option lets you specify an extra horizontal

margin which will be inserted to separate the items from each other. The default value is 0.

  • the -justify option lets you specify the alignment of the

menu items in the floating window: the possible values are left, center or right. The default value is left.

  • the -left and -top options let you specify the

position (left and top) of the upper-left corner of the float in screen coordinates. The default values for these options is 0.

  • the -menu option lets you specify the token of the menu which

will be turned into a floating palette. Its value is a token corresponding to a valid already existing menu: typically this menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page). With the [floatMenu create] command, this argument is required.

  • the -name option lets you specify a name for the floating

window. It is written in the title bar of the window. If this option is not specified when the floating menu is created, the name of the menu is used as a default. In order to have no title in the title bar, specify an empty string.

  • the -sidebar option lets you specify a vertical orientation

for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).

  • the -visible option lets you get or set the visibility of the

floating menu. By default, a floating menu is made visible when it is created: this can be changed with the -visible option set to 0 in the [floatMenu create] command.

  • the -width option lets you specify the width of the float. If

it is not specified or if it is equal to -1, the width of the float is adjusted to the widest item in the menu. The default value is -1.

Hooks

Changed line 204 from:

Examples

to:

Examples

Deleted line 225:

(add your comments here...)

July 11, 2007, at 07:40 AM by bd - Visibility on creation
Changed lines 52-53 from:

The possible options are described in the Floating menu options section below.

to:

The possible options are described in the Floating menu options section below. By default, a floating window is made visible when it is created unless the -visible option was specified with value 0.

Changed lines 151-152 from:
  • the -visible option lets you get or set the visibility of the floating menu. By default, a floating menu is not visible when it is created unless the -visible option was specified with value 1 in the [floatMenu create] command.
to:
  • the -visible option lets you get or set the visibility of the floating menu. By default, a floating menu is made visible when it is

created: this can be changed with the -visible option set to 0 in the [floatMenu create] command.

July 11, 2007, at 07:17 AM by bd - Added -visible arg and new [floatMenu find] command
Changed lines 8-16 from:
to:
Changed lines 31-32 from:

selecting the item in the menu.

to:

selecting the item in the menu. In the rest of this page, the expressions palette or floating menu are synonymous.

Changed lines 59-60 from:

The [hide] subcommand

This subcommand lets you hide a floating menu. The syntax is:

to:

The [find] subcommand

This subcommand lets you find the floating menu associated with a given menu. The syntax is:

Changed line 63 from:
     floatMenu hide token
to:
     floatMenu find menuToken
Changed lines 65-69 from:

The [list] subcommand

This subcommand returns a list of the tokens corresponding to the currently existing floating menus. Each time a new floating menu is created, its token is appended at the end of the list, so this list is ordered from the oldest to the newest float. The syntax is:

to:

If there is a floating palette associated with the menu specified in the menuToken argument, the command returns the palette's token. Otherwise it raises an error. This command can be useful to test the existence of a floating window.

The [hide] subcommand

This subcommand lets you hide a floating menu. The syntax is:

Changed line 72 from:
     floatMenu list
to:
 	floatMenu hide token
Changed lines 74-75 from:

The [move] subcommand

This subcommand lets you reposition a floating menu on the screen. The syntax is:

to:

This subcommand is a convenience: it is equivalent to [menu set] invoked with -visible 0 argument.

The [list] subcommand

This subcommand returns a list of the tokens corresponding to the currently existing floating menus. Each time a new floating menu is created, its token is appended at the end of the list, so this list is ordered from the oldest to the newest float. The syntax is:

Changed line 82 from:
     floatMenu move token left top
to:
     floatMenu list
Added lines 84-88:

The [move] subcommand

This subcommand lets you reposition a floating menu on the screen. The syntax is:

 
     floatMenu move token left top

Changed lines 91-93 from:

convenience: it is equivalent to the [menu set] command used with -left and -top arguments.

The [set] subcommand

to:

convenience: it is equivalent to the [menu set] command invoked with -left and -top arguments.

The [set] subcommand

Changed line 110 from:

The [show] subcommand

to:

The [show] subcommand

Changed lines 116-118 from:

The [top] subcommand

to:

This subcommand is a convenience: it is equivalent to [menu set] invoked with -visible 1 argument.

The [top] subcommand

Changed line 129 from:

Floating menu options

to:

Floating menu options

Added lines 150-151:
  • the -visible option lets you get or set the visibility of the floating menu. By default, a floating menu is not visible when it is created unless the -visible option was specified with value 1 in the [floatMenu create] command.
Changed line 154 from:

Hooks

to:

Hooks

Changed line 167 from:

Examples

to:

Examples

Changed line 189 from:

(add your comments here...)

to:

(add your comments here...)

July 10, 2007, at 04:48 PM by bd - Remark about -menu option
Changed lines 120-121 from:
  • the -menu option lets you specify the token of the menu which will be turned into a floating palette. Its value is a token corresponding to a valid already existing menu: typically this menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page). ((nl With the [floatMenu create] command, this argument is required.
to:
  • the -menu option lets you specify the token of the menu which will be turned into a floating palette. Its value is a token corresponding to a valid already existing menu: typically this menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page). With the [floatMenu create] command, this argument is required.
Added line 123:
Added line 125:
Added line 127:
Added line 129:
Added line 131:
Added line 133:
Added line 135:
July 10, 2007, at 04:45 PM by bd - Remark about -menu option
Added lines 92-95:

Note that it is not possible to reset the menu attached to a floating palette, i-e the -menu option is not accepted in the second form of this subcommand.

July 10, 2007, at 03:07 PM by bd - New [floatMenu set] subcmd
Changed lines 90-91 from:

The possible options are described in the ((rf floatopts )) Floating menu options section below.

to:

The possible options are described in the Floating menu options section below.

July 10, 2007, at 03:05 PM by bd - New [floatMenu set] subcmd
Changed lines 2-3 from:
This file documents the [floatMenu] command introduced in version 8.1 of AlphaX.
to:
This file documents the [floatMenu] command introduced in version 8.1 of AlphaX.
Changed lines 11-14 from:
to:
Changed lines 21-23 from:

menus in Alpha. It is a replacement for the old (and now deprecated)

to:

menus in Alpha.

It is a replacement for the old (and now deprecated)

Changed lines 28-29 from:

any menu in Alpha: for any item in the menu there is a corresponding button in the floating menu, so that clicking on the button is equivalent to

to:

any menu in Alpha: for any item in the menu, there is a corresponding button in the floating palette, and clicking on the button is equivalent to

Changed line 43 from:
          [-name winname] [-justify (left|center|right)] [-vert (0|1)]
to:
          [-name winname] [-justify (left|center|right)] [-sidebar (0|1)]
Changed lines 50-55 from:

Here is the description of the various arguments:

  • the -menu argument is required. It lets you specify the token of the menu which will be turned into a floating palette. This must be a token corresponding to a valid menu already existing in Alpha: typically the menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page).
  • the -name option lets you specify a name for the floating window. It is written in the title bar of the window. If it is not specified, the name of the menu will be used instead.
  • the -height, -width, -left, -top, -interspace options let you specify the height and width of the float, the position (top and left) of the upper-left corner of the float in screen coordinates and an additional horizontal margin which will be inserted to separate the items from each other. If -height and -width are not specified, the size of the float will be adjusted to the widest item in the menu. The default values for the other three options is 0.
  • the -justify option lets you specify the alignment of the menu items in the floating window: the possible values are left, center or right. The default value is left.
  • the -vert option lets you specify a vertical orientation for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).
to:

The possible options are described in the Floating menu options section below.

Changed lines 76-79 from:

corner of the float in screen coordinates.

The [show] subcommand

This subcommand is the opposite of the [hide] subcommand. It lets you display an existing floating menu if it is hidden.

to:

corner of the float in screen coordinates. This subcommand is a convenience: it is equivalent to the [menu set] command used with -left and -top arguments.

The [set] subcommand

This subcommand lets you get or set several properties attached to a menu item. The syntax can take two forms:

Changed lines 83-84 from:
     floatMenu show token
to:
     floatMenu set token option
     floatMenu set token option value ?option value...?
Changed lines 86-88 from:

The [top] subcommand

This subcommand deals with the topmost floating menu. It can take two forms:

to:

In the first form the command returns the current value of the specified option. In the second form, it lets you set the value of one or several options.

The possible options are described in the ((rf floatopts )) Floating menu options section below.

The [show] subcommand

This subcommand is the opposite of the [hide] subcommand. It lets you display an existing floating menu if it is hidden.

Changed lines 96-97 from:
     floatMenu top
     floatMenu top token
to:
     floatMenu show token
Added lines 98-104:

The [top] subcommand

This subcommand deals with the topmost floating menu. It can take two forms:

 
     floatMenu top
     floatMenu top token

Changed lines 108-124 from:

Hooks

to:

Floating menu options

The [floatMenu create] and [floatMenu set] commands accept many options to set the attributes and parameters of the floating menus. All these properties are specified by an option starting with a dash.

Here is the description of the various options:

  • the -menu option lets you specify the token of the menu which will be turned into a floating palette. Its value is a token corresponding to a valid already existing menu: typically this menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page). ((nl With the [floatMenu create] command, this argument is required.
  • the -name option lets you specify a name for the floating window. It is written in the title bar of the window. If this option is not specified when the floating menu is created, the name of the menu is used as a default. In order to have no title in the title bar, specify an empty string.
  • the -height option lets you specify the height of the items in the float. If it is not specified or if it is equal to -1, the height for eacg item is automatically set to the best value based on the text and font used to draw the item. The default value is -1.
  • the -interspace option lets you specify an extra horizontal margin which will be inserted to separate the items from each other. The default value is 0.
  • the -left and -top options let you specify the position (left and top) of the upper-left corner of the float in screen coordinates. The default values for these options is 0.
  • the -justify option lets you specify the alignment of the menu items in the floating window: the possible values are left, center or right. The default value is left.
  • the -sidebar option lets you specify a vertical orientation for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).
  • the -width option lets you specify the width of the float. If it is not specified or if it is equal to -1, the width of the float is adjusted to the widest item in the menu. The default value is -1.

Hooks

Changed lines 127-133 from:

commands are invoked. The floatHook proc is invoked when the floating window has been created in memory but before it is attributed its token: so, at this point, the new float would not be listed by the [floatMenu list] command. The unfloatHook proc is invoked when the floating window has been disposed of. At this point, the floating menu token is not valid anymore.

Examples

to:

commands are invoked.

The floatHook proc is invoked when the floating window has been created in memory but before it is attributed its token: so, at this point, the new float would not be listed by the [floatMenu list] command.

The unfloatHook proc is invoked when the floating window has been disposed of. At this point, the floating menu token is not valid anymore.

Examples

Changed lines 142-143 from:
     «» set token1 [menuRef create -title Strings]
     «» set fm1 [floatMenu create -menu $token1]
to:
     «» set token1 $menu::core(Compare)
     «» set fm1 [floatMenu create -menu $token1 -name "Compare" -left 30 -top 50]
Changed line 149 from:
     «» set token2 [menuRef create -title Compare]
to:
     «» set token2 $menu::core(FileUtilities)
July 07, 2007, at 09:28 AM by bd - Floating menus expect menu tokens
Changed line 3 from:
This file documents the [floatMenu] command introduced in version 8.1 of AlphaX.
to:
This file documents the [floatMenu] command introduced in version 8.1 of AlphaX.
Changed lines 5-15 from:
  • Introduction
  • Synopsis
    • The [create] subcommand
    • The [delete] subcommand
    • The [hide] subcommand
    • The [list] subcommand
    • The [move] subcommand
    • The [show] subcommand
    • The [top] subcommand
  • Hooks
  • Examples
to:
Changed line 18 from:

Introduction

to:

Introduction

Changed lines 23-27 from:

Floating menus are like floating palettes which reproduce the contents of any menu in Alpha: to any item in the menu corresponds a button in the floating menu, so that clicking on the button is equivalent to selecting the item in the menu itself.

Synopsis

to:

Floating menus are like floating palettes which reproduce the contents of any menu in Alpha: for any item in the menu there is a corresponding button in the floating menu, so that clicking on the button is equivalent to selecting the item in the menu.

Synopsis

Changed lines 34-37 from:

various options can be additionally specified.

Note that for any subcommand which requires a token, an error will be thrown if the supplied token is not longer associated with an active palette, i.e. if it has been destroyed. You can wrap the command in a [catch], or use

to:

various options can be additionnally specified.

The [create] subcommand

This subcommand creates a floating menu from an existing menu. It accepts a wide variety of options. The complete syntax is:

Changed lines 39-40 from:
 	if {[lcontain [floatMenu list] $token]} {...
to:
 floatMenu create -menu menuToken [(-height|-width|-left|-top|-interspace) val]           [-name winname] [-justify (left|center|right)] [-vert (0|1)]
Changed lines 42-47 from:

to determine if the token is still valid.

The [create] subcommand

This subcommand creates a floating menu from an existing menu. It accepts a wide variety of options. The complete syntax is:

to:

The [floatMenu create] command returns a token used in the other subcommands to uniquely identify the floating menu. This token must not be confused with the token of the menu with which the floating palette is associated.

Here is the description of the various arguments:

  • the -menu argument is required. It lets you specify the token of the menu which will be turned into a floating palette. This must be a token corresponding to a valid menu already existing in Alpha: typically the menu token will have been obtained with the [menuRef create] command (see the MenuRefCommand page).
  • the -name option lets you specify a name for the floating window. It is written in the title bar of the window. If it is not specified, the name of the menu will be used instead.
  • the -height, -width, -left, -top, -interspace options let you specify the height and width of the float, the position (top and left) of the upper-left corner of the float in screen coordinates and an additional horizontal margin which will be inserted to separate the items from each other. If -height and -width are not specified, the size of the float will be adjusted to the widest item in the menu. The default values for the other three options is 0.
  • the -justify option lets you specify the alignment of the menu items in the floating window: the possible values are left, center or right. The default value is left.
  • the -vert option lets you specify a vertical orientation for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).

The [delete] subcommand

This subcommand lets you delete a floating menu. This is equivalent to closing the floating window with a mouse click in the Close box. The syntax is:

Changed lines 57-58 from:
 floatMenu create -menu menuname [(-height|-width|-left|-top|-interspace) val]           [-name winname] [-justify (left|center|right)] [-vert (0|1)]
to:
     floatMenu delete token
Changed lines 59-74 from:

The [floatMenu create] command returns a token used in the other subcommands to uniquely identify the floating menu.

Here is the description of the various options:

  • the -menu option lets you specify the name of the menu which will be turned in a floating menu. This must be a valid menu already existing in Alpha. This argument is required.
  • the -name option lets you specify a name for the floating window. It is written in the title bar of the window. If it is not specified, the name of the menu will be used instead.
  • the -height, -width, -left, -top, -interspace options let you specify the height and width of the float, the position (top and left) of the upper-left corner of the float in screen coordinates and an additional horizontal margin which will be inserted to separate the items from each other. If -height and -width are not specified, the size of the float will be adjusted to the widest item in the menu. The default values for the other three options is 0.
  • the -justify option lets you specify the alignment of the menu items in the floating window: the possible values are left, center or right. The default value is left.
  • the -vert option lets you specify a vertical orientation for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).

The [delete] subcommand

This command lets you delete a floating menu. This is equivalent to closing the floating window with a mouse click in the Close box. The syntax is:

to:

The [hide] subcommand

This subcommand lets you hide a floating menu. The syntax is:

Changed line 62 from:
 	floatMenu delete token
to:
     floatMenu hide token
Changed lines 64-67 from:

The [hide] subcommand

This command lets you hide a floating menu. The syntax is:

to:

The [list] subcommand

This subcommand returns a list of the tokens corresponding to the currently existing floating menus. Each time a new floating menu is created, its token is appended at the end of the list, so this list is ordered from the oldest to the newest float. The syntax is:

Changed line 70 from:
 	floatMenu hide token
to:
     floatMenu list
Changed lines 72-78 from:

The [list] subcommand

This command returns a list of the tokens corresponding to the currently existing floating menus. Each time a new floating menu is created, its token is appended at the end of the list, so this list is ordered from the oldest to the newest float. The syntax is:

to:

The [move] subcommand

This subcommand lets you reposition a floating menu on the screen. The syntax is:

Changed line 75 from:
 	floatMenu list
to:
     floatMenu move token left top
Deleted lines 76-81:

The [move] subcommand

This subcommand lets you reposition a floating menu on the screen. The syntax is:

 
 	floatMenu move token left top

Changed lines 79-80 from:

The [show] subcommand

to:

The [show] subcommand

Deleted line 81:
Changed line 85 from:

The [top] subcommand

to:

The [top] subcommand

Changed lines 89-90 from:
 	floatMenu top
 	floatMenu top token
to:
     floatMenu top
     floatMenu top token
Changed lines 95-96 from:

Hooks

to:

Hooks

Changed lines 104-105 from:

Examples

to:

Examples

Deleted line 106:
Changed lines 109-110 from:
     «» set fm1 [floatMenu create -menu Strings]
to:
     «» set token1 [menuRef create -title Strings]
     «» set fm1 [floatMenu create -menu $token1]
Changed lines 116-117 from:
     «» set fm2 [floatMenu create -menu "compare" -height 25 -width 130 -name ""]
to:
     «» set token2 [menuRef create -title Compare]
     «» set fm2 [floatMenu create -menu $token2 -height 25 -width 130 -name ""]
Changed lines 126-129 from:

(add your comments here...)


Last updated 2006-06-13 18:46:22

to:

(add your comments here...)

January 11, 2007, at 08:06 PM by bd -
Added lines 1-2:

(:title The [floatMenu] command:)

June 14, 2006, at 10:29 PM by cbu - added [lcontain [floatMenu list] $token] instructions
Changed lines 32-35 from:

The [create] subcommand

This subcommand creates a floating menu from an existing menu. It accepts a wide variety of options. The complete syntax is:

to:

Note that for any subcommand which requires a token, an error will be thrown if the supplied token is not longer associated with an active palette, i.e. if it has been destroyed. You can wrap the command in a [catch], or use

Changed lines 36-37 from:
 floatMenu create -menu menuname [(-height|-width|-left|-top|-interspace) val]           [-name winname] [-justify (left|center|right)] [-vert (0|1)]
to:
 	if {[lcontain [floatMenu list] $token]} {...
Changed lines 38-48 from:
to:

to determine if the token is still valid.

The [create] subcommand

This subcommand creates a floating menu from an existing menu. It accepts a wide variety of options. The complete syntax is:

 
 floatMenu create -menu menuname [(-height|-width|-left|-top|-interspace) val] \
          [-name winname] [-justify (left|center|right)] [-vert (0|1)]

Added line 59:
June 14, 2006, at 08:35 AM by bd - New [top] and [move] subcommands
Added line 9:
  • The [move] subcommand
Added line 11:
  • The [top] subcommand
Changed lines 76-79 from:

The [show] subcommand

This subcommand is the opposite of the [hide] subcommand. It lets you display an existing floating menu if it is hidden.

to:

The [move] subcommand

This subcommand lets you reposition a floating menu on the screen. The syntax is:

Changed line 79 from:
     floatMenu show token
to:
 	floatMenu move token left top
Changed lines 81-101 from:
to:

where left and top designate the position of the upper left corner of the float in screen coordinates.

The [show] subcommand

This subcommand is the opposite of the [hide] subcommand. It lets you display an existing floating menu if it is hidden.

 
     floatMenu show token

The [top] subcommand

This subcommand deals with the topmost floating menu. It can take two forms:

 
 	floatMenu top
 	floatMenu top token

The first form returns the token corresponding to the topmost float. The second form brings the float corresponding to the token argument on top of the others.

June 14, 2006, at 06:51 AM by bd - Doc about the float hooks
Added line 10:
  • Hooks
Added lines 82-91:

Hooks

There are two hooks named floatHook and unfloatHook which are called respectively when the [floatMenu create] and [floatMenu delete] commands are invoked. The floatHook proc is invoked when the floating window has been created in memory but before it is attributed its token: so, at this point, the new float would not be listed by the [floatMenu list] command. The unfloatHook proc is invoked when the floating window has been disposed of. At this point, the floating menu token is not valid anymore.

June 13, 2006, at 10:59 PM by bd - Typos again
Changed line 30 from:

This subcommands creates a floating menu from an existing menu. It accepts

to:

This subcommand creates a floating menu from an existing menu. It accepts

Changed line 87 from:
     «MacOS» set fm1 [floatMenu create -menu Strings]
to:
     «» set fm1 [floatMenu create -menu Strings]
Changed lines 89-91 from:
     «MacOS» floatMenu show $fm1
     «MacOS» floatMenu hide $fm1
     «MacOS» floatMenu list
to:
     «» floatMenu show $fm1
     «» floatMenu hide $fm1
     «» floatMenu list
Changed line 93 from:
     «MacOS» set fm2 [floatMenu create -menu "Compare"  -height 25 -width 130 -name ""]
to:
     «» set fm2 [floatMenu create -menu "compare" -height 25 -width 130 -name ""]
Changed line 95 from:
     «MacOS» floatMenu list
to:
     «» floatMenu list
Changed lines 97-98 from:
     «MacOS» floatMenu delete $fm1
     «MacOS» floatMenu list
to:
     «» floatMenu delete $fm1
     «» floatMenu list
June 13, 2006, at 05:03 PM by cbu - corrected minor typos
Deleted line 0:
Changed line 28 from:

various options can be additionnally specified.

to:

various options can be additionally specified.

Added line 32:
Added line 37:
Changed lines 42-43 from:
  • the -menu option lets you specify the name of the menu which will be turned in a floating menu. This must be a valid menu already existing in Alpha. This arguent is required.
to:
  • the -menu option lets you specify the name of the menu which will be turned in a floating menu. This must be a valid menu already existing in Alpha. This argument is required.
Added line 51:
Added line 55:
Added line 58:
Added line 62:
Added line 68:
Added line 72:
Added line 76:
Added line 80:
Added line 84:
June 13, 2006, at 04:50 PM by bd - Documenting the floatMenu command
Added lines 1-94:
This file documents the [floatMenu] command introduced in version 8.1 of AlphaX.

  • Introduction
  • Synopsis
    • The [create] subcommand
    • The [delete] subcommand
    • The [hide] subcommand
    • The [list] subcommand
    • The [show] subcommand
  • Examples

Introduction

The [floatMenu] command lets you create and manipulate floating menus in Alpha. It is a replacement for the old (and now deprecated) [closeFloat], [float], [floatShowHide], and [unfloat] commands. Floating menus are like floating palettes which reproduce the contents of any menu in Alpha: to any item in the menu corresponds a button in the floating menu, so that clicking on the button is equivalent to selecting the item in the menu itself.

Synopsis

The formal syntax of the [floatMenu] command is:

floatMenu subcommand ?options?

The possible subcommands are described below. Depending on the subcommand, various options can be additionnally specified.

The [create] subcommand

This subcommands creates a floating menu from an existing menu. It accepts a wide variety of options. The complete syntax is:

 
 floatMenu create -menu menuname [(-height|-width|-left|-top|-interspace) val] \
          [-name winname] [-justify (left|center|right)] [-vert (0|1)]

The [floatMenu create] command returns a token used in the other subcommands to uniquely identify the floating menu.

Here is the description of the various options:

  • the -menu option lets you specify the name of the menu which will be turned in a floating menu. This must be a valid menu already existing in Alpha. This arguent is required.
  • the -name option lets you specify a name for the floating window. It is written in the title bar of the window. If it is not specified, the name of the menu will be used instead.
  • the -height, -width, -left, -top, -interspace options let you specify the height and width of the float, the position (top and left) of the upper-left corner of the float in screen coordinates and an additional horizontal margin which will be inserted to separate the items from each other. If -height and -width are not specified, the size of the float will be adjusted to the widest item in the menu. The default values for the other three options is 0.
  • the -justify option lets you specify the alignment of the menu items in the floating window: the possible values are left, center or right. The default value is left.
  • the -vert option lets you specify a vertical orientation for the titlebar. The possible values are 0 (which is the default and corresponds to a horizontal title bar) and 1 (which corresponds to a vertical sidebar along the left side).

The [delete] subcommand

This command lets you delete a floating menu. This is equivalent to closing the floating window with a mouse click in the Close box. The syntax is:

 
 	floatMenu delete token

The [hide] subcommand

This command lets you hide a floating menu. The syntax is:

 
 	floatMenu hide token

The [list] subcommand

This command returns a list of the tokens corresponding to the currently existing floating menus. Each time a new floating menu is created, its token is appended at the end of the list, so this list is ordered from the oldest to the newest float. The syntax is:

 
 	floatMenu list

The [show] subcommand

This subcommand is the opposite of the [hide] subcommand. It lets you display an existing floating menu if it is hidden.

 
     floatMenu show token

Examples

Here are a few basic examples which can be executed from the Tcl shell in AlphaX:

 
     Welcome to AlphaX's AlphaTcl shell.
     «MacOS» set fm1 [floatMenu create -menu Strings]
     floatmenu1
     «MacOS» floatMenu show $fm1
     «MacOS» floatMenu hide $fm1
     «MacOS» floatMenu list
     floatmenu1
     «MacOS» set fm2 [floatMenu create -menu "Compare"  -height 25 -width 130 -name ""]
     floatmenu2
     «MacOS» floatMenu list
     floatmenu1 floatmenu2
     «MacOS» floatMenu delete $fm1
     «MacOS» floatMenu list
     floatmenu2


(add your comments here...)


Last updated 2006-06-13 18:46:22

Page last modified on October 22, 2009, at 06:26 AM
Hosted on SourceForge.net Logo