Menu

An element, much like a button, that is placed on a menu bar. When the user clicks the menu element, the child menupopup of the menu will be displayed. This element is also used to create submenus.

More information about menu

メニューバーに配置される、ボタンと同様な要素。ユーザがメニューをクリックすると、 menu 要素の menupopup 子要素が表示される。この要素はサブメニューの作成にも利用される。

menu の追加情報

属性:

acceltext accesskey allowevents crop disabled
key label menuactive open sizetopopup
value

プロパティとメソッド:

value

属性:

XUL Element から継承:

align
allowevents
allownegativeassertions
class
coalesceduplicatearcs
collapsed
container
containment
context
contextmenu
datasources
debug
dir
empty
equalsize
flags
flex
height
hidden
id
insertafter
insertbefore
left
maxheight
maxwidth
menu
minheight
minwidth
mousethrough
observes
ordinal
orient
pack
persist
popup
position
ref
removeelement
sortDirection
sortResource
sortResource2
statustext
style
template
tooltip
tooltiptext
top
uri
wait-cursor
width

acceltext

Type: string

Text that appears beside beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command. If this value is set, it overrides an assigned key set in the key attribute. This attribute does not apply to menus directly on the menubar.

型 : string

コマンドを実行するのに使用するショートカットキー (アクセラレータキー) を指定するため、メニューラベルの横に表示するテキスト。この値を設定すると、key 属性で割り当てたキー設定を上書きする。この属性は、メニューバーのメニューには直接には適用されない。

accesskey

Type: character

This should be set to a letter that is used as a shortcut key. This letter should be one of the characters that appears in the label text for the menu. This letter will typically be drawn underlined, although this behavior will be platform and theme specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the menu will be activated from anywhere in the window. Although the value is case insensitive, a letter with the case matching the accesskey attribute will used if both cases exist in the label.

型 : character

ショートカットキーとして使う文字に設定する。この文字は、menu のラベルテキストに現れる文字の一つである必要がある。この文字は一般に下線付きで表示される。一方、その振る舞いはプロットフォームやテーマに依存する。ユーザが ALT (またはプラットフォームによる同様のキー) とアクセスキーを押すと、ウィンドウのどこからでも menu は起動される。この値は文字の大小には関しないが、ラベルに両方がある場合には、 accesskey 属性にマッチする方の文字が使用される。

allowevents

Type: boolean

If true, events are passed to children of the menu. Otherwise, events are passed to the menu only.

型 : boolean

true のとき、イベントはメニューの子要素に渡される。true でないときは、イベントはメニューにのみ渡される。

crop

Type: one of the values below

If the label of the menu is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.

  • start: The text will be cropped on its left side.
  • end: The text will be cropped on its right side.
  • left: (Deprecated) The text will be cropped on its left side.
  • right: (Deprecated) The text will be cropped on its right side.
  • center: The text will be cropped on both sides.
  • none: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.

型 : 以下の値の一つ

与えられたスペースが小さくて menu のラベルがその場所に合わないとき、crop 属性で指定した側にテキストは切り取られる。切り取られたテキストの位置には、省略記号が用いられる。ボックスの方向が逆のときは、切り取りも逆になる。

  • start: テキストの左側が切り取られる。
  • end: テキストの右側が切り取られる。
  • left: (非推奨) テキストの左側が切り取られる。
  • right: (非推奨) テキストの右側が切り取られる。
  • center: テキストの両側が切り取られる。
  • none: テキストの切り取りに省略記号が用いられない。テキストが非常に大きいときには、単に切られるだけである。側は CSS のテキスト配置 (alignment) に依存する。
disabled

Type: boolean

Indicates whether the menu is disabled or not. If this attribute is set to true, the menu is disabled. This is usually drawn with the text in grey. If the menu is disabled, it does not respond to user actions. The element cannot be focused and the command event will not fire. The element will still respond to mouse events. To enable the menu, leave the attribute out entirely as opposed to setting the value to false.

型 : boolean

メニューが無効か有効かを表す。この属性を true に設定すると、menu は無効になる。通常、テキストが灰色で表示される。menu が無効の場合には、ユーザアクションに応答しない。要素にフォーカスできず、またコマンドイベントは起きない。マウスイベントにはまだ応答する。 menu を有効にするには、値を false に設定したことに対応するものとして、この属性を取り除く。

key

Type: key element id

The id of a key element that is used as the menu command's shortcut key. If used, text will be displayed beside the menu label to indicate which keys can be pressed to invoke the command. Normally, you would not set a key on a menu element.

型 : key element id

メニューコマンドのショートカットキーとして使用される key 要素の id。使用すると、どのキーを押すとコマンドを実行できるかを示すため、メニューラベルの横にテキストを表示する。通常は、menu 要素ではキーを設定しない。

label

Type: string

The label that will appear on the menu. If this is left out, no text appears.

型 : string

menu に表示するラベル。この属性がないと、テキストは表示されない。

menuactive

Type: boolean

This attribute is set on an item in a menu when it is being hovered over. Typcially, the theme will use this to highlight the item. A DOMMenuItemActive event will be sent to the item when the item is hovered over, and a DOMMenuItemInactive event will be sent to the item when the selection moves away.

型 : boolean

メニューのある項目の上にマウスがあるとき、その項目にこの属性が設定される。一般には、項目を強調するためにテーマで使用される。項目上にマウスがあれば DOMMenuItemActive イベントがその項目に送信され、その選択が外されると DOMMenuItemInactive イベントが項目に送信される。

open

Type: boolean

This attribute is set on the menu when it is open. To open the menu, call the showPopup method of the menupopup.

型 : boolean

メニューが開かれたとき、そのメニューでこの属性が設定される。メニューを開くには、 menupopup の the showPopup メソッドを呼び出す。

sizetopopup

Type: string

Indicates how the menu width and the popup width are determined. If the sizetopopup attribute is left out, the menu will be its preferred width and the popup may extend outside of this width, unaffected by the maximum width of the menu itself.

  • always: If set to always, the menu's width will be the same as that necessary for the menupopup. If the menu has a maximum width, the popup will also be this width.

型 : string

メニューの幅とポップアップの幅がどう決められるかを指定する。 sizetopopup 属性を取り除くと、メニューの幅が優先的に決まり、ポップアップの幅はその外側に拡張したものになる。これはメニュー自身の最大幅に制限されない。

  • always: always に設定すると、メニューの幅はメニューポップアップに必要なサイズと同サイズになる。メニューに最大幅があるときには、ポップアップもこの幅になる。
value

Type: string

A value associated with the menu. You may use it in a script for your own purposes.

型 : string

menu に関連する値。目的に応じてスクリプトで使うことができる。


プロパティとメソッド:

value

Type: string

A value associated with the menu. You may use it in a script for your own purposes.

型 : string

menu に関連する値。目的に応じてスクリプトで使うことができる。

XUL Element から継承:

align allowEvents blur boxObject boxObject.element
boxObject.getLookAndFeelMetric boxObject.height boxObject.screenX boxObject.screenY boxObject.width
boxObject.x boxObject.y builder className click
collapsed contextMenu controllers database datasources
dir doCommand flex focus getElementsByAttribute
height hidden id left maxHeight
maxWidth menu minHeight minWidth observes
ordinal orient pack persist ref
resource statusText style tooltip tooltipText
top width

Element から継承:

addEventListener
appendChild
attributes
childNodes
cloneNode
dispatchEvent
firstChild
getAttribute
getAttributeNS
getAttributeNode
getAttributeNodeNS
getElementsByTagName
getElementsByTagNameNS
hasAttribute
hasAttributeNS
hasAttributes
hasChildNodes
insertBefore
isSupported
lastChild
localName
namespaceURI
nextSibling
nodeName
nodeType
nodeValue
normalize
ownerDocument
parentNode
prefix
previousSibling
removeAttribute
removeAttributeNS
removeAttributeNode
removeChild
removeEventListener
replaceChild
setAttribute
setAttributeNS
setAttributeNode
setAttributeNodeNS
tagName

Copyright (C) 1999 - 2004 XulPlanet.com