Menulist

An element that can be used for drop-down choice lists. The user may select one of the elements displayed in the menulist. The currently selected choice is displayed on the menulist element. To create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements.

More information about menulist

選択肢をドロップダウンで表示するために利用される要素。利用者は menulist 要素で表示される要素のうちの一つを選択できる。現在選択中の項目が menulist 要素上に表示される。ドロップダウンを作成するには、各選択肢を表す menuitem 要素を持つ menupopup 要素を menulist 要素内に置く必要がある。

menulist の追加情報

属性:

accesskey crop disableautoselect disabled editable
focused image label open src
tabindex value

プロパティとメソッド:

accessible appendItem crop disableautoselect disabled
inputField insertItemAt label menuBoxObject menupopup
open removeAllItems removeItemAt select selectedIndex
selectedItem src 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

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 menulist. 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 menulist 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

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

crop

Type: one of the values below

If the label of the menulist 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.

型 : 以下の値の一つ

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

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

Type: boolean

If this attribute is true or omitted, the selected item on the menu will update to match what the user entered in the textbox. If the text does not match any of the items in the list, the menu selection is cleared. If this attribute is false, the selection is never updated to match the text box. This attribute applies only to editable menulists.

型 : boolean

この属性が true であるかまたは取り除かれているとき、ユーザがテキストボックスに入力したものとメニューの項目が合致すると、その項目は選択に更新される。テキストがリストのどの項目とも合致しないときには、メニューの選択はクリアされる。この属性を false にした場合、テキストボックスの値と合致しても選択は決して更新されません。この属性は編集可能 menulist にのみ適用される。

disabled

Type: boolean

Indicates whether the menulist is disabled or not. If this attribute is set to true, the menulist is disabled. This is usually drawn with the text in grey. If the menulist 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 menulist, leave the attribute out entirely as opposed to setting the value to false.

型 : boolean

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

editable

Type: boolean

Indicates that the value of the menulist can be modified by typing directly into the value field. This is rendered as a textbox with a drop-down arrow beside it. The user may enter text into the textbox or select one of the choices by clicking from the drop-down.

型 : boolean

value フィールドに直接タイプすることで menulist の値が変更されうることを示す。こうすると、横にドロップダウンの矢印を持つテキストフィールドとして描画される。ユーザはテキストボックスにテキストを入力したり、ドロップダウンしたものをクリックして選択肢の一つを選択したりすることができる。

focused

Type: boolean

This attribute is set to true if the menulist element is focused.

型 : boolean

menulist 要素がフォーカスされているときは、この属性は true に設定される。

image

Type: image URL

The URL of the image to appear on the menulist. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes.

型 : image URL

menulist に表示す画像の URL。この属性がないと、画像は表示されない。画像の位置は dir 属性と orient 属性で決定される。

label

Type: string

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

型 : string

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

open

Type: boolean

If true, the menu popup is showing. You can change this value to show or hide the popup.

型 : boolean

true のとき、メニューポップアップは表示されている。この値を変更することで、ポップアップを表示したり隠したりすることができる。

src

Type: image URL

The URL of the image to appear on the menulist. If this attribute is left out, no image appears.

型 : image URL

menulist に表示する画像の URL。この属性がないと、画像は表示されない。

tabindex

Type: integer

The tab order of the element. The tab order is the order in which the focus is moved when the user presses the Tab key. Elements with a higher tabindex are later in the tab order sequence.

型 : integer

要素のタブ順序。タブ順序は、ユーザがタブキーを押したときにフォーカスが移動する順番です。高い tabindex を持つ要素ほど、タブ順序の後のほうにくる。

value

Type: string

The value of the value property of the currently selected item in the menulist.

型 : string

menulist で現在選択中の項目の value プロパティの値。


プロパティとメソッド:

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

accessible

Type: nsIAccessible

Returns the accessibility object for the menulist.

型 : nsIAccessible

menulist 要素の accessibility オブジェクトを返す。

appendItem ( label , value )

Return Type: menuitem element

Creates a new menuitem element and adds it to the end of the menulist. You may optionally set a value. The function returns the new item.

戻り値の型 : menuitem element

新しい menuitem 要素を作成して menulist の末尾に追加する。オプションとして値を設定することができる。この関数は新しい項目を返す。

crop

Type: string

Gets and sets the value of the crop attribute.

型 : string

crop 属性の値を取得・設定する。

disableautoselect

Type: boolean

Gets and sets the value of the disableautoselect attribute.

型 : boolean

disableautoselect 属性の値を取得・設定する。

disabled

Type: boolean

Gets and sets the value of the disabled attribute.

型 : boolean

disabled 属性の値を取得・設定する。

inputField

Type: textbox element

A reference to the textbox element used for editable menu lists. This property is read only and applies to editable menulists only.

型 : textbox element

編集可能メニューリストで使用されている textbox 要素への参照。このプロパティは読み込み専用で、編集可能 menulist にのみ適用される。

insertItemAt ( index, label , value )

Return Type: menuitem element

Creates a new menuitem element and inserts it at a specific position in the menu. You may optionally set a value. The function returns the new item.

戻り値の型 : menuitem element

新しい menuitem 要素を作成し、メニューの指定した位置に挿入する。オプションとして値を設定することができる。この関数は新しい項目を返す。

label

Type: string

Gets and sets the value of the label attribute.

型 : string

label 属性の値を取得・設定する。

menuBoxObject    Moz1.3

Type: nsIMenuBoxObject

A reference to the nsIMenuBoxObject which implements the menu.

型 : nsIMenuBoxObject

メニューを実装している nsIMenuBoxObject への参照。

menupopup    Moz1.3

Type: menupopup element

A reference to the menupopup used by the menulist. This property is read-only.

型 : menupopup element

menulist 要素で使われている menupopup 要素への参照。このプロパティは読み込み専用である。

open

Type: boolean

Gets and sets the value of the open attribute.

型 : boolean

open 属性の値を取得・設定する。

removeAllItems ( )     Moz1.3

Return Type: no return value

Removes all of the items in the menu.

戻り値の型 : 戻り値なし

メニューの項目全てを削除する。

removeItemAt ( index )

Return Type: menuitem element

Removes the child item in the menu at the given index. The function returns the removed item.

戻り値の型 : menuitem element

メニューの指定したインデクスの子項目を削除する。この関数は削除した項目を返す。

select ( )     Moz1.3

Return Type: no return value

Select all the text in the menulist's textbox. This property applies to editable menulists only.

戻り値の型 : 戻り値なし

menulist のテキストボックスの全テキストを選択する。このプロパティは、編集可能な menulist にのみ適用される。

selectedIndex

Type: integer

Holds the index of the currently selected item in the menu. If no item is currently selected, this will be set to -1. You can select an item by setting this value.

型 : integer

メニューで現在選択中の項目のインデクスを持つ。現在どの要素も選択していないときは、-1 になる。この値を設定すると、その項目を選択することができる。

selectedItem

Type: menuitem element

Holds the element of the menu that is currently selected. If no element is currently selected, this will be null. Use selectedIndex to retrieve the position of the selected item in the menu.

型 : menuitem element

現在選択中のメニューの要素を持つ。現在どの要素も選択していないときは、null になる。メニューでの選択項目の位置を取得するには、 selectedIndex を使用する。

src

Type: image URL

Gets and sets the value of the src attribute.

型 : image URL

src 属性の値を取得・設定する。

value

Type: string

Gets and sets the value of the value attribute.

型 : string

value 属性の値を取得・設定する。


Copyright (C) 1999 - 2004 XulPlanet.com