Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Atrybuty elementu XUL

« Dokumentacja XUL Następujące atrybuty są zwykle stosowane do wszystkich elementów XUL:

align
Typ: jedna z wartości poniżej
Atrybut align określa jak elementy potomne pudełka są rozmieszczone kiedy rozmiar pudełka jest większy, niż wszystkie rozmiary razem dzieci elementu. Dla pudełek, które posiadają poziomą orientację, to określa jak jego dzieci będą rozmieszczone pionowo. Atrybut pack jest podobny do rozmieszczenia, lecz jest stosowany do określenia pozycji w przeciwnych kierunkach. Możemy także określić wartość rozmieszczenia stosując własność stylu -moz-box-align.
  • start: Elementy potomne są rozmieszczone od początku lewego lub górnego brzegu pudełka. Jeśli pudełko jest większe, niż cały rozmiar dziecka, to dodatkowa przestrzeń jest umieszczona w prawej lub dolnej stronie.
  • center: Extra space is split equally along each side of the child elements, resulting the children being placed in the center of the box.
  • end: Child elements are placed on the right or bottom edge of the box. If the box is larger than the total size of the children, the extra space is placed on the left or top side.
  • baseline: This value applies to horizontally oriented boxes only. It causes the child elements to be aligned so that their text labels are lined up.
  • stretch: The child elements are stretched to fit the size of the box. For a horizontal box, the children are stretched to be the height of the box. For a vertical box, the children are stretched to be the width of the box. If the size of the box changes, the children stretch to fit. Use the flex attribute to create elements that stretch in the opposite direction.
  • left: Elementy są rozmieszczone na ich lewych brzegach.
  • center: Elementy są wyśrodkowane poziomo.
  • right: Elementy są rozmieszczone na ich prawych brzegach.
allowevents
Typ: boolean
Jeśli true, zdarzenia przechodzą do dziecka elementu. Inaczej, zdarzenia są przypasowane do tego tylko elementu.

allownegativeassertions
Typ: boolean
Jakikolwiek poprawny element, który posiada atrybut źródła danych. Kiedy wiele źródeł danych jest użytych, jedno może przesłaniać twierdzenie drugiego. Ten atrybut, jeśli jest prawdą, która jest domyślnym ustawieniem, pozwala danym źródłowym na negację wcześniejszego twierdzenia.



class
Typ: string
Definiuje klasę stylu dla elementu. Wiele klas może być określanych przez oddzielenie ich spacją.


coalesceduplicatearcs
Typ: boolean
Jakikolwiek poprawny element, który posiada atrybut źródła danych. Kiedy wiele źródeł danych jest użytych, jedno może przesłaniać twierdzenie drugiego. Ten atrybut, jeśli jest prawdą, która jest domyślnym ustawieniem, pozwala danym źródłowym na negację wcześniejszego twierdzenia.



collapsed
Typ: boolean
Jeśli true, to element jest zawinięty i nie będzie wyświetlony. Jest równoważny do ustawienia widoczności własności CSS 'collapse'.
container
Typ: boolean
Ustaw na true, jeśli element spełnia funkcję jako kontener, który posiada elementy potomne. Będzie ustawiony jako potrzebny w kreatorze szablonów.
containment
Typ: URI predykatu RDF
Ten atrybut określa własności RDF, które sygnalizują, że źródło jest kontenerem. Kiedy generujemy zawartość z szablonu to jest stosowany do określenia, które zasoby z bazy danych są kontenerami i w ten sposób posiada węzły potomne i które nie są kontenerami.
Ten atrybut powinien zostać umieszczony w tym samym elemencie, w którym są źródła danych i atrybuty ref. Może być ustawiona jedna spacja przerwy w liście własności RDF lub źródeł.
context
Typ: id elementu popup
Should be set to the value of the id of the popup element that should appear when the user context-clicks on the element. A context-click varies on each platform. Usually it will be a right click. You can use the special value '_child' to indicate the first menupopup child of the element.
contextmenu
Typ: id elementu popup
Alternatywna nazwa dla atrybutu context, jednakże odpowiada również własności skryptu 'contextmenu'.



datasources
Typ: lista źródeł danych adresów URI oddzielona spacją
A space-separated list of datasources that an element's template will use for content generation. These can be either internal datasources such as rdf:bookmarks or a URL of an RDF file. The datasources attribute may be placed on most elements, although it will usually be found on trees and menupopups. The element should have a template element as a child.
The specified datasources are combined into a single composite datasource which holds the data from all of the datasources. This composite datasource is accesssible via a script through the database property.
If you plan on adding a datasource to an element but don't want one to be added right away, set this attribute to 'rdf:null'. This will make the element so that its contents can be generated from a datasource. Otherwise, you cannot add one later.

dir
Typ: jedna z wartości poniżej
Kierunek, w którym umieszczane są elementy potomne danego elementu.
  • normal: Elementy są umieszczane od lewej do prawej lub od góry do dołu, w kodzie XUL.
  • reverse: Elementy są umieszczane od prawej do lewej lub od dołu do góry. Jest to odwrotność porządku, w którym zostały one umieszczone w kodzie XUL.
empty
Typ: boolean
Ustawia true, jeśli element jest kontenerem bez elementu potomnego. Zostanie ustawiony poprzez kreator szablonów jako potrzebny.



equalsize
Typ: jedna z wartości poniżej
Ten atrybut potrafi tworzyć dziecko elementu o takim samym rozmiarze.
  • always: Dla elementów zorientowanych poziomo, będzie tworzone dziecko ze wszystkich posiadanych szerokości potomka. Dla elementów zorientowanych pionowo będzie tworzone jego dziecko wszystkich posiadanych wysokości najwyższego potomka.
  • never: Wszystkie dzieci są wyświetlone w rozmiarze żądanym przez zawartość lub określone poprzez atrybut szerokości i wysokości lub poprzez własność szerokości i wysokości CSS.



flags
Typ: lista wartości znajdujących się poniżej oddzielonych spacją
Ustawia flagi użyte dla różnych celów. Dwie flagi są definiowane, które mogą być wartościami tego atrybutu.
  • dont-test-empty: Dla szablonu generowanej zawartości kompilator nie sprawdzi czy kontener jest pusty.
  • dont-build-content: Ta flaga może być użyta na drzewie by wskazać, że elementy zawartości nie powinny być generowane. Poprawia to wprawdzie wydajność, lecz uniemożliwia korzystanie z funkcji DOM to pobierania wierszy drzewa.



flex
Typ: string (reprezentujący integer)

Określa elastyczność elementu, co oznacza w jaki sposób kontener dystrybuuje dostępną przestrzeń pomiędzy swoimi potomkami. Elementy elastyczne powiększają się i zmniejszają wypełniając całą dostępną przestrzeń. Elementy posiadające wyższą wartość tego atrybutu powiększają się bardziej niż elementy z niższymi wartościami, proporcjonalnie do podanych wartości. Konkretna wartość nie jest brana pod uwagę jeśli nie ma więcej elementów elastycznych w danym kontenerze.  W chwili gdy domyślny rozmiar elementów w pudełku jest już obliczony, elementom przydzielana jest pozostała wolna przestrzeń w zależności od ich współczynnika elastyczności.

 

height
Typ: string (reprezentujący integer)
Wysokość elementu w pikselach. Zalecane jest stosowanie zamiast wysokości - własność wysokości CSS.


hidden
Typ: boolean
Jeśli jest ustawiony na true, element jest nie wyświetlane. Jest to podobne do ustawienia wyświetlania własności CSS na none.


id
Typ: id elementu, musi być unikatowym identyfikatorem w oknie
Unikatowy identyfikator, który będzie identyfikował się z elementem. Możemy go zastosować jako parametr do getElementById() i innych funkcji DOM oraz jako odniesienie do elementu w arkuszach stylu.
insertafter
Typ: id elementu
Kiedy element jest w overlay, to atrybut insertafter określa id elementu w bazowym oknie, który element powinien zostać później wyświetlony. Ten atrybut przesłania atrybut insertbefore. Ta wartość może być listą składającą się z poszczególnych id oddzielonych przecinkiem, które są skanowane i pierwszy znaleziony w oknie jest użyty.



insertbefore
Typ: id elementu
Kiedy element jest w overlay, to atrybut insertbefore określa id elementu w bazowym oknie, który element powinien zostać wyświetlony wcześniej. Ta wartość może być listą składającą się z poszczególnych id oddzielonych przecinkiem, które są skanowane i pierwszy znaleziony w oknie jest użyty.



left
Typ: string (reprezentujący integer)
Dla elementów umieszczonych wewnątrz stosu (stack), określa pozycje elementu od lewego brzegu.


maxheight
Typ: string (reprezentujący integer)
Maksymalna wysokość elementu. Przesyła własność CSS max-height.
maxwidth
Typ: string (reprezentujący integer)
Maksymalna szerokość elementu. Przesyła własność CSS max-width.


menu
Typ: id elementu popup
Alternatywna nazwa dla atrybutu popup, lecz także przesyła do skryptu własność 'menu'.
minheight
Typ: string (reprezentujący integer)
Minimalna wysokość elementu. Przesyła własność CSS min-height.


minwidth
Typ: string (reprezentujący integer)
Minimalna szerokość elementu. Jest przesyłana do własności CSS min-width.
mousethrough
Typ: jedna z wartości poniżej
Determines whether mouse events are passed to the element or not. If this attribute is not specified, the value is inherited from the parent of the element.
  • always: Mouse events are transparent to the element. This means that the element will not receive any mouse events due to either clicking or movement. Child elements may still receive mouse events if they specify mousethrough="never".
  • never: Mouse events are passed to the element as normal.
observes
Typ: id elementu broadcaster
Ustawia id elementu broadcaster, który jest obserwowany poprzez ten element. Jeśli atrybut zostanie zmieniony w rozgłaszaczu, to będzie on także zmieniony w obserwatorze.
ordinal
Typ: string (reprezentujący integer)
An integer which specifies the position of the element within its parent. By default, elements appear in the order they appear in the XUL code. The ordinal attribute can be used to change the order. Note the default ordinal for elements is 1. You can retrieve the displayed order by using the properties of the boxObject of the container.
orient
Typ: jedna z wartości poniżej
Wykorzystywany do określenia, czy elementy potomne danego elementu zorientowane są poziomo czy pionowo. Domyślna wartość zależy od danego elementu. Można także skorzystać z własności stylu -moz-box-orient.
  • horizontal: Elementy potomne elementu są umieszczane jeden obok drugiego w kolejności zgodnej z kolejnością w kodzie źródłowym XUL.
  • vertical: Elementy potomne elementu są umieszczane jeden pod drugim w kolejności zgodnej z kolejnością w kodzie źródłowym XUL.
pack
Typ: jedna z wartości poniżej
Atrybut pack określa gdzie elementy potomne box są umieszczone, kiedy pudełko jest większe niż rozmiar dziecka. Dla pudełek z orientacją poziomą jest użyty to sygnalizowania pozycji dziecka poziomo. Dla pudełek z orientacją pionową jest stosowany dla pozycji poziomej dziecka. Atrybut align jest stosowany do określenia pozycji w przeciwnych kierunkach. Możemy także określić wartość pack stosując własność stylu -moz-box-pack.
  • start: Child elements are placed starting from the left or top edge of the box. If the box is larger than the total size of the children, the extra space is placed on the right or bottom side.
  • center: Extra space is split equally along each side of the child elements, resulting the children being placed in the center of the box.
  • end: Child elements are placed on the right or bottom edge of the box. If the box is larger than the total size of the children, the extra space is placed on the left or top side.

Zobacz także

Więcej informacji znajduje się w kursie XUL

persist
Typ: space-separated list of attribute names
A space-separated list of attributes that are maintained when the window is closed. When the window is re-opened, the values of persistent attributes are restored. In Mozilla, persistent attributes are stored in the per-profile file localstore.rdf. Persistence can also be stored using the document.persist function. In order for persistence to work, the element must also have an id.

 

popup
Typ: id elementu popup
Powinien być ustawiony na wartość id elementu popup, który powinien się wyświetlić, gdy użytkownik kliknie w ten element.
position
Typ: string (representing an integer)
When an element is in an overlay, the position is an index where the child is inserted. The position is one-based, so use a value of 1 to place the element at the beginning. This attribute is ignored if either an insertbefore or insertafter attribute matches an element.
preference-editable
Mozilla 1.8
Typ: boolean
If true, the element may be used as one that modifies a preference in a prefwindow. The preference attribute may be used to connect to a preference element. This is useful for custom elements implemented in XBL. The element should fire change or select events when the value is changed so that the preference will update accordingly.
ref
Typ: URI źródła RDF
Dla szablonowo generowanych elementów, ten atrybut jest stosowany do określenia korzenia (węzła głównego) RDF, gdzie rozpoczyna się generowanie zawartości. Będzie ona przesyłana do wartości. This will correspond to the value of an about attribute on an RDF container. This attribute should be placed alongside the datasources attribute.


removeelement
Typ: id elementu
Kiedy umieszczony na elemencie w nakładce overlay, to sygnalizuje, który element w bazowym pliku powinien być usunięty z okna.
sortDirection
Typ: jedna z wartości poniżej
Ustaw ten atrybut na ustawienie kierunku, w którym zawartość szablonów została wygenerowana i posortowana. Zastosuj atrybut sortResource, aby określić klucz sortowania.
  • ascending: Dane są sortowane w kolejności rosnącej.
  • descending: Dane są sortowane w kolejności malejącej.
  • natural: Dane są sortowane w zwyczajny sposób, co oznacza porządek w tych, co zostały w magazynie.
sortResource
Typ: adres URI predykatu RDF
Dla szablonu generowanej treści, określa słowo kluczowe sortowania, jeśli będziemy chcieli, aby treść była sortowana. Słowo kluczowe powinno być pełnym adresem URI źródła sortowania, na przykład 'https://home.netscape.com/NC-rdf#Name'. Umieść ten atrybut na tym samym elemencie jako atrybut datasources. Zastosuj sortResource2 do określenia drugiego słowa kluczowego sortowania.
sortResource2
Typ: adres URI predykatu RDF
Drugie słowo kluczowe dla sortowanej treści.



statustext
Typ: string
Stosujemy do ustawienia tekstu, który zostanie wyświetlony na pasku stanu, kiedy użytkownik przesuwa mysz nad elementem. Przeglądarka Mozilli nie reguluje paska stanu automatycznie. Ten atrybut służy tylko jako miejsce do przechowywania tekstu. W Firefoksie, ten tekst jest umieszczany automatycznie w statusbar dla pozycji menu (menuitems) na pasku menu.
style
Typ: styl CSS inline
Reguły stylu CSS stosowany do elementu. Składnia jest jako atrybut stylu HTML. Jest preferowany do umieszczenia reguł stylu w arkuszu stylów.
template
Typ: id elementu
For template generated elements, this attribute may optionally be placed on the root node (the element with the datasources attribute) to refer to a template that exists elsewhere in the XUL code. This template attribute should be set to the id of the template element. This might be used to share a single template between multiple trees or menus. If this attribute is not specified, there should be a template element directly inside the node.
tooltip
Typ: id elementu tooltip
Powinien być ustawiony na wartość id elementu popup, który powinien być zastosowany jako okienko porady, kiedy kursor myszki jest w danym momencie nad elementem. Porada automatycznie znika, kiedy kursor zostaje przesunięty z nad elementu. Jeśli ten atrybut jest ustawiony na '_child', to pierwsza porada elementu potomnego zostanie użyta wewnątrz elementu.
tooltiptext
Typ: string
Used to set the text which appears in the tooltip when the user moves the mouse over the element. This can be used instead of setting the tooltip to a popup for the common case where it contains only text. The tooltip is displayed in a default tooltip which only displays only a label, however the default tooltip may be changed by setting the default attribute on a tooltip element.

top
Typ: string (reprezentujący integer)
Dla elementów umieszczonych wewnątrz stosu (stack), określa pozycję elementu od górnego brzegu.
uri
Typ: string
For template-generated content, the attribute should be placed on the element where content generation should begin. Thus, it should be placed on an element that is a descendant of a template. The value should be set to rdf:*.
Elements that appear inside the element with the attribute will be repeated for each node in the RDF datasource. Elements outside will appear only once.
wait-cursor
Typ: boolean
Ustaw ten atrybut na wartość true, aby zmienić kursor na zajęty, kiedy znajdzie się on nad danym elementem. Zwykle ustawia się ten atrybut w elemencie window lub innym elemencie najwyższego poziomu.
width
Typ: string (reprezentujący integer)
Szerokość elementu w pikselach. Zwykle jednak powinno stosować się własność width w arkuszu stylów.

 

Autorzy i etykiety dokumentu

 Autorzy tej strony: SphinxKnight, Mgjbot, Ptak82
 Ostatnia aktualizacja: SphinxKnight,