Visit Mozilla.org

XUL:panel

z Mozilla Developer Center, polskiego centrum programistów Mozilli.

Ten artykuł obejmuje funkcje wprowadzone w Firefoksie 3

« Dokumentacja XUL    [ Przykłady | Atrybuty | Własności | Metody | Podobne ]

UWAGA: Tłumaczenie tej strony nie zostało zakończone.
Może być ona niekompletna lub wymagać korekty.
Chcesz pomóc? | Dokończ tłumaczenie | Sprawdź ortografię | Więcej takich stron...

A panel is a popup window that may contain any type of content. It does not have any window decorations. When open, it floats above the window and may extend outside the border of the main window. Typically, it will be attached to an element using the popup attribute so that when the element is clicked with the left mouse button, the panel will be displayed. A panel may also be open via a script using the openPopup method.

The panel will be closed when the user clicks outside the panel or when the panel's hidePopup method is called.

Atrybuty
ignorekeys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top
Własności
accessible, popupBoxObject, popup
Metody
hidePopup, moveTo, openPopup, openPopupAtScreen, sizeTo

[edytuj] Przykłady

The following example shows how a panel may be attached to an label.

<panel id="thepanel">
  <hbox align="start">
    <image src="warning.png"/>
    <vbox>
      <description value="You have 6 new messages."/>
      <hbox>
        <button label="Read Mail"/>
        <button label="New Message"/>
      </hbox>
    </vbox>
  </hbox>
</panel>
<description value="6 New Messages" popup="thepanel"/>

[edytuj] Atrybuty

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

ignorekeys
Typ: boolean
Jeśli true, poruszanie się za pomocą klawiatury pomiędzy różnymi pozycjami w okienku popup jest wyłączone.


left
Typ: integer
Przesłania poziome położenie określonego okienka popup poprzez metodę showPopup.

onpopuphidden
Typ: kod skryptu
To zdarzenie jest wysyłane do okienka popup po tym jak zostało ukryte.

onpopuphiding
Typ: kod skryptu
To zdarzenie jest wysyłane do okienka popup, kiedy jest ono ukrywane.

onpopupshowing
Typ: kod skryptu
To zdarzenie wysyła do okienka popup tylko przed jego otwarciem. Uchwyt zazwyczaj jest stosowany do ustawień dynamicznych zawartości, kiedy użytkownik wnioskuje o jego wyświetlenie. Zwraca false z tego uchwytu zdarzenia zapobiegając okienko popup przed pojawieniem się.

onpopupshown
Typ: kod skryptu
To jest zdarzenie wysyłane do okienka popup, po tym jak zostało otwarte, bardzo podobne do zdarzenia onload wysyłanego do okna, kiedy jest otwierane.

position
Typ: jedna z poniższych wartości
Atrybut position określa (determines) gdzie okienko dialogowe popup pojawi się relatywnie do elementu, który nacisną użytkownik invoke the popup. Pozwala nam na umieszczenie okienka popup, po jednej ze stron przycisku.
  • after_start: Okienko dialogowe popup underneath the element with the popup's upper-left corner aligned with the lower-left corner of the element. The left edges of the element and the popup are aligned. This is typically used for drop-down menus.
  • after_end: Okienko popup pojawia się underneath the element with the popup's upper-right corner aligned with the lower-right corner of the element. The right edges of the element and the popup are aligned.
  • before_start: The popup appears above the element with the popup's lower-left corner aligned with the upper-left corner of the element. The left edges of the element and the popup are aligned.
  • before_end: The popup appears above the element with the popup's lower-right corner aligned with the upper-right corner of the element. The right edges of the element and the popup are aligned.
  • end_after: The popup appears to the right of the element with the popup's lower-left corner aligned with the lower-right corner of the element. The bottom edges of the element and the popup are aligned.
  • end_before: Okienko dialogowe jest wyświetlane do prawej strony elementu z with the popup's upper-left corner aligned with the upper-right corner of the element. The top edges of the element and the popup are aligned.
  • start_after: The popup appears to the left of the element with the popup's lower-right corner aligned with the lower-left corner of the element. The bottom edges of the element and the popup are aligned.
  • start_before: The popup appears to the left of the element with the popup's upper-right corner aligned with the upper-left corner of the element. The top edges of the element and the popup are aligned.
  • overlap: The popup appears over top of the element with the upper-left corners aligned.
  • at_pointer: The popup appears at the same position as the mouse pointer.
  • after_pointer: The popup appears at the same horizontal position as the mouse pointer, but vertically, it is placed just below the element.

top
Typ: integer
Przesłania pionowe położenie okienka popup określone poprzez metodę showPopup.

[edytuj] Własności

Dziedziczy z elementu XUL
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Dziedziczy z elementu DOM
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

accessible
Typ: nsIAccessible
Zwraca obiekt dostępności dla elementu.

popupBoxObject
Typ: nsIPopupBoxObject
To jest własność tylko do odczytu podtrzymująca nsIPopupBoxObject, który implementuje popup. Normalnie, ta własność nie jest nam potrzebna do użycia jak są dostępne wszystkie jej funkcje via popup.

position
Typ: string
Pobiera i ustawia wartość atrybutu position.

[edytuj] Metody

Dziedziczy z elementu XUL
blur, click, doCommand, focus, getElementsByAttribute

Dziedziczy z elementu DOM
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

hidePopup ()
Zwraca typ: nie zwraca wartości
Natychmiast zamyka wyskakujące okienko.




moveTo ( x, y )
Zwraca typ: nie zwraca wartości
Przenosi wyskakujące okienko do nowej lokalizacji.

openPopup ( anchor , position , x , y , isContextMenu, attributesOverride ) Nowość w Firefoksie 3
Zwraca typ: nie zwraca wartości

Open the popup relative to a specified node at a specific location.

The popup may be either anchored to another node or opened freely. To anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored.

Possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, after_pointer

The anchor node does not need to be in the same document as the popup.

If the attributesOverride argument is true, the position attribute on the popup node overrides the position value argument. If attributesOverride is false, the attribute is only used if the position argument is empty.

For an anchored popup, the x and y arguments may be used to offset the popup from its anchored position by some number, measured in CSS pixels.

Unanchored popups may be created by supplying null as the anchor node. An unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. In case, the position and attributesOverride arguments are ignored.

openPopupAtScreen ( x, y, isContextMenu ) Nowość w Firefoksie 3
Zwraca typ: nie zwraca wartości

Open the popup at a specific screen position specified by x and y. This position may be adjusted if it would cause the popup to be off of the screen. The x and y coordinates are measured in CSS pixels.

sizeTo ( width, height )
Zwraca typ: nie zwraca wartości
Zmienia aktualny rozmiar wyskakującego okienka, zostaje nadana nowa szerokość (width) oraz wysokość (height).



[edytuj] Podobne

Interfejsy
nsIAccessibleProvider, nsIDOMXULPopupElement