diff options
Diffstat (limited to 'files/pt-pt/archive/mozilla/xul')
11 files changed, 1281 insertions, 0 deletions
diff --git a/files/pt-pt/archive/mozilla/xul/comunidade/index.html b/files/pt-pt/archive/mozilla/xul/comunidade/index.html new file mode 100644 index 0000000000..a2712cc2a1 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/comunidade/index.html @@ -0,0 +1,6 @@ +--- +title: Comunidade +slug: Archive/Mozilla/XUL/Comunidade +--- +<p> +</p> diff --git a/files/pt-pt/archive/mozilla/xul/image/index.html b/files/pt-pt/archive/mozilla/xul/image/index.html new file mode 100644 index 0000000000..5316e18ebd --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/image/index.html @@ -0,0 +1,154 @@ +--- +title: image +slug: Archive/Mozilla/XUL/image +tags: + - Elementos XUL + - Referência XUL +translation_of: Archive/Mozilla/XUL/image +--- +<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs"> + « <a href="/pt-PT/docs/XUL_Reference">XUL Reference home</a> [ + <a href="#Examples">Examples</a> | + <a href="#Attributes">Attributes</a> | + <a href="#Properties">Properties</a> | + <a href="#Methods">Methods</a> | + <a href="#Related">Related</a> ] +</span></div> + +<h3 id="Resumo">Resumo</h3> + +<p>Um elemento que exibe uma imagem, bem como o elemento <a href="/En/HTML/Element/Img" title="https://developer.mozilla.org/en/HTML/element/img"><code>img</code></a> de HTML. O atributo <code id="a-src"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> pode ser utilziado para especificar o URL da imagem.</p> + +<p>Está disponível mais informação no <a href="/pt-PT/docs/Mozilla/Tech/XUL/Tutorial/Adicionar_Etiquetas_e_Imagens" title="en/XUL_Tutorial/Adding_Labels_and_Images">Tutorial de XUL</a>.</p> + +<div class="noinclude"> +<div class="note"> +<p><strong>Nota:</strong> Prior to <span title="(Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)">Gecko 8.0</span>, images did not shrink down with the same ratio in both directions when specifying maximum sizes using <code>maxheight</code> or <code>maxwidth</code>. The new behavior aligns more with the HTML <a href="/pt-PT/docs/Web/HTML/Element/img" title="The documentation about this has not yet been written; please consider contributing!"><code><img></code></a> element and shrinks both the width and height down proportionally.</p> +</div> +</div> + +<dl> + <dt>Atributos</dt> + <dd><a href="#a-onerror">onerror</a>, <a href="#a-image.onload">onload</a>, <a href="#a-src">src</a>, <a href="#a-validate">validate</a></dd> +</dl> + +<dl> + <dt>Propriedades</dt> + <dd><a href="#p-accessibleType">accessibleType</a>, <a href="#p-src">src</a></dd> +</dl> + +<dl> + <dt>Classes de estilo</dt> + <dd><a href="#s-alert-icon">alert-icon</a>, <a href="#s-error-icon">error-icon</a>, <a href="#s-message-icon">message-icon</a>, <a href="#s-question-icon">question-icon</a></dd> +</dl> + +<h3 id="Exemplos">Exemplos</h3> + +<div class="float-right"><img alt="Image:Firefoxlogo2.png" class="internal" src="/@api/deki/files/220/=Firefoxlogo2.png"></div> + +<pre class="eval"><image src='Firefoxlogo.png' width='135' height='130'/> +</pre> + +<h3 id="Atributos">Atributos</h3> + +<p> </p><div id="a-onerror"> + + +<dl> + <dt><code id="a-onerror"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/onerror">onerror</a></code></dt> + <dd>Type: <em>script code</em></dd> + <dd>This event is sent to an <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> element when an error occurs loading the image.</dd> +</dl> +</div> <div id="a-image.onload"> + + +<dl> + <dt><code id="a-image.onload"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/image.onload">image.onload</a></code></dt> + <dd>Type: <em>script code</em></dd> + <dd>This event handler will be called on the <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> element when the image has finished loading. This applies whether the image is applied via the <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> attribute or the <code>list-style-image</code> style property. If you change the image, the event will fire again when the new image loads. This event will not bubble up the element tree.</dd> +</dl> +</div> <div id="a-src"> + +<dl> + <dt> + <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code></dt> + <dd> + Type: <em>URI</em></dd> + <dd> + The URI of the content to appear in the element.</dd> +</dl> + + +</div> <div id="a-validate"> + + +<dl> + <dt><code id="a-validate"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/validate">validate</a></code></dt> + <dd>Type: <em>one of the values below</em></dd> + <dd>This attribute indicates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling:</dd> + <dd> + <dl> + <dt><code>always</code></dt> + <dd>The image is always checked to see whether it should be reloaded.</dd> + <dt><code>never</code></dt> + <dd>The image will be loaded from the cache if possible.</dd> + </dl> + </dd> +</dl> +</div> + +<h3 id="Propriedades">Propriedades</h3> + +<div id="p-accessibleType"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + A value indicating the type of accessibility object for the element.</dd> +</dl> +</div> <div id="p-src"> + +<dl> + <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/src">src</a></span></code></dt> + <dd>Type: <em>URL</em></dd> + <dd>Gets and sets the value of the <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> attribute.</dd> +</dl></div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/pt-PT/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody> +</table> + +<h3 id="Métodos">Métodos</h3> + +<table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Methods</strong><br> <small><code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a class="internal" href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <a class="internal" href="/En/DOM/Node.getFeature" title="En/DOM/Node.getFeature">getFeature</a>, <a class="internal" href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a class="internal" href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a class="internal" href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.isSupported">isSupported()</a></code>, <a class="internal" href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a class="internal" href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a class="internal" href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p> </td> </tr> </tbody> +</table> + +<h3 id="Classes_de_estilo">Classes de estilo</h3> + +<dl> + <dt> + <code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/alert-icon">alert-icon</a></code></dt> + <dd> + Class that adds an alert icon. This typically looks like an exclamation mark. This and the other icon classes may be used by <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> elements or other elements which can have an image.</dd> +</dl> <dl> + <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/error-icon">error-icon</a></code></dt> + <dd>Class that adds an error icon. This will typically be a red "X" icon.</dd> +</dl> <dl> + <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/message-icon">message-icon</a></code></dt> + <dd>Class that adds a message box icon.</dd> +</dl> <dl> + <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/question-icon">question-icon</a></code></dt> + <dd>Class that adds a question icon, which usually looks like a question mark.</dd> +</dl> + +<h3 id="Relacionado">Relacionado</h3> + +<p>See also the <code id="a-image"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> and <code id="a-icon"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/icon">icon</a></code> attributes.</p> + +<h3 id="Interfaces">Interfaces</h3> + +<ul> + <li><code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider" title="">nsIAccessibleProvider</a></code></li> + <li><code><a href="/pt-PT/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMXULImageElement" title="">nsIDOMXULImageElement</a></code></li> +</ul> + +<div class="noinclude"></div> diff --git a/files/pt-pt/archive/mozilla/xul/index.html b/files/pt-pt/archive/mozilla/xul/index.html new file mode 100644 index 0000000000..3485d951c8 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/index.html @@ -0,0 +1,83 @@ +--- +title: XUL +slug: Archive/Mozilla/XUL +tags: + - Todas_as_Categorias + - XUL +translation_of: Archive/Mozilla/XUL +--- +<p> </p> + +<div class="callout-box"><strong><a href="/pt/Tutorial_XUL" title="pt/Tutorial_XUL">Tutorial XUL</a></strong> + +<p>Um tutorial introdutório ao XUL, originário do XULPlanet.</p> +</div> + +<div> +<p>A <strong>XML User Interface Language (XUL)</strong> (em português "linguagem XML de interface de usuário") é a linguagem de interface de usuário da Mozilla baseada na <a href="/pt/XML" title="pt/XML">XML</a> que permite construir aplicações multi-plataformas ricas em características que podem rodar ligadas ou desligadas da internet. Essas aplicações são facilmente personalizadas com texto, gráficos e disposições alternativas, fazendo com que possam ser marcadas e localizadas para vários mercados. Desenvolvedores Web que já estejam familiarizados com <a href="/pt/DHTML" title="pt/DHTML">DHTML</a> irão aprender <a href="/pt/XUL" title="pt/XUL">XUL</a> rapidamente e vão logo poder criar aplicações.</p> +</div> + +<table class="topicpage-table"> + <tbody> + <tr> + <td> + <h4 id="Documenta.C3.A7.C3.A3o" name="Documenta.C3.A7.C3.A3o"><a href="/Special:Tags?tag=XUL&language=pt" title="Special:Tags?tag=XUL&language=pt">Documentação</a></h4> + + <dl> + <dt><a href="/pt/Refer%C3%AAncia_XUL" title="pt/Referência_XUL">Referência XUL</a></dt> + <dd><small>Veja também a documentação MDC em <a href="/pt/Preferences_System" title="pt/Preferences_System">prefwindow</a>.</small></dd> + </dl> + + <dl> + <dt><a href="/pt/Controles_XUL" title="pt/Controles_XUL">Controles XUL</a></dt> + <dd><small>Uma rápida lista de todos os controles XUL disponíveis.</small></dd> + </dl> + + <dl> + <dt><a href="/pt/Vis%C3%A3o_Geral_do_XUL" title="pt/Visão_Geral_do_XUL">Visão Geral do XUL</a></dt> + <dd><small>Descreve as características chave e os componentes do XUL.</small></dd> + </dl> + + <dl> + <dt><a href="/pt/Guia_modelo_do_XUL" title="pt/Guia_modelo_do_XUL">Guia modelo do XUL</a></dt> + <dd><small>Um guia detalhado sobre modelos XUL, que é um meio de gerar conteúdo de um código de dados.</small></dd> + </dl> + + <dl> + <dt><a href="/pt/Sobreposi%C3%A7%C3%B5es_XUL" title="pt/Sobreposições_XUL">Sobreposições XUL</a></dt> + <dd><small>Um artigo sobre sobreposições XUL. Sobreposições são usadas para descrever conteúdo extra para a UI. Ele proporciona um poderoso mecanismo para extender e customizar aplicações XUL existentes.</small></dd> + </dl> + + <p><span class="alllinks"><a href="/Special:Tags?tag=XUL:Artigos&language=pt" title="Special:Tags?tag=XUL:Artigos&language=pt">Veja todos...</a></span></p> + </td> + <td> + <h4 id="Comunidade" name="Comunidade">Comunidade</h4> + + <p>{{ DiscussionList("dev-tech-xul", "mozilla.dev.tech.xul") }}</p> + + <ul> + <li><a class="link-irc" href="irc://irc.mozilla.org/xul">canal #xul em irc.mozilla.org</a></li> + <li><a href="/pt/XUL/Comunidade" title="pt/XUL/Comunidade">Outros links para comunidades...</a></li> + </ul> + + <h4 id="Ferramentas" name="Ferramentas">Ferramentas</h4> + + <ul> + <li><a href="/pt/DOM_Inspector" title="pt/DOM_Inspector">DOM Inspector</a></li> + </ul> + + <p><span class="alllinks"><a href="/Special:Tags?tag=XUL:Ferramentas&language=pt" title="Special:Tags?tag=XUL:Ferramentas&language=pt">Veja todas...</a></span></p> + + <h4 id="T.C3.B3picos_relacionados" name="T.C3.B3picos_relacionados">Tópicos relacionados</h4> + + <p><a href="/pt/JavaScript" title="pt/JavaScript">JavaScript</a>, <a href="/pt/CSS" title="pt/CSS">CSS</a>, <a href="/pt/RDF" title="pt/RDF">RDF</a>, <a href="/pt/XBL" title="pt/XBL">XBL</a>, <a href="/pt/Extens%C3%B5es" title="pt/Extensões">Extensões</a>, <a href="/pt/XULRunner" title="pt/XULRunner">XULRunner</a></p> + + <p><span class="comment">Categorias</span></p> + + <p><span class="comment">Interwiki Language Links</span></p> + + <p> </p> + </td> + </tr> + </tbody> +</table> diff --git a/files/pt-pt/archive/mozilla/xul/namespaces/index.html b/files/pt-pt/archive/mozilla/xul/namespaces/index.html new file mode 100644 index 0000000000..53bc371053 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/namespaces/index.html @@ -0,0 +1,153 @@ +--- +title: Espaços de nomes +slug: Archive/Mozilla/XUL/Namespaces +tags: + - Extensões + - Extras +translation_of: Archive/Mozilla/XUL/Namespaces +--- +<p> </p> + +<p>Em adição a este documento, consulte <em><a href="/pt-PT/docs/Web/SVG/Namespaces_Crash_Course" title="en/SVG/Namespaces_Crash_Course">Namespaces Crash Course</a></em>.</p> + +<p><strong>Espaços de nomes XML </strong>fornecem uma maneira para distinguir nomes duplicados de elementos e atributos. Os nomes de elementos e atributos duplicados podem ocorrer quando um documento XML contém elementos e atributos de dois ou mais esquemas XML diferentes (ou DTDs). para citar <a class="external" href="https://pt.wikipedia.org/wiki/Espa%C3%A7o_de_nomes">Wikipédia</a>: "Em geral, um espaço de nome é um recipiente abstrato que fornece contexto para os itens... este contém e permite a desambiguação de itens com o mesmo nome."</p> + +<p>If you are familiar with C++ namespaces, Java packages, perl packages, or Python module importing, you are already familiar with the namespace concept.</p> + +<p>An XML namespace is identified by an unique name (called a URI, not a URL, even though it can look like a URL). An URI is any string, although most people choose a URL-based URI because URLs are an easy way to <em>hope</em> for uniqueness. Although there's nothing preventing someone else from using the namespace <code>http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</code>, it's fairly unlikely anyone would choose that accidentally. Even if they did accidentally choose it, they may not define the same elements as XUL anyway (e.g., <code><textbox/></code>) in their schema/DTD.</p> + +<p>Any element type or attribute name in an XML namespace can be uniquely identified by its XML namespace and its "local name". Together, these two items define a <em>qualified name</em>, or <a class="external" href="http://www.w3.org/TR/REC-xml-names/#dt-qualname">QName</a>.</p> + +<p>For example, <code><xul:textbox/></code> uses a namespace named "xul" and a local name "textbox". This distinguishes it from, for example, <code><foobar:textbox/></code> which might occur in the same document. The <strong>xul</strong> and <strong>foobar</strong> namespaces must be defined at the top of the XML document in which they are used, like so:</p> + +<pre> <foobar:some-element + xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:foobar="the-foobar-namespace"> + <xul:textbox id="foo" value="bar"/> + <foobar:textbox favorite-food="pancakes"/> + </foobar:some-element> +</pre> + +<p>Notice I've mixed two <code><textboxes/></code> in the same document. The only way to distinguish that they have different meanings is with namespaces.</p> + +<p>There's only one other thing to know: "default namespace". Every XML element has a "default namespace", and this is used with XUL elements all the time. In XUL documents, you'll usually see this:</p> + +<pre> <window + id="foo" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + ... + ... + </window> +</pre> + +<p>and in XHTML documents, you'll see this:</p> + +<pre> <html xmlns="http://www.w3.org/1999/xhtml"> + ... + ... + </html> +</pre> + +<p>There is a very subtle difference here than before. Before I wrote <code>xmlns<strong>:xul</strong>="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"</code> but here the <strong>:xul</strong> piece is omitted. This signifies to the XML parser that <code>http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</code> is the <strong>default namespace</strong> for the element and its descendant elements (unless further overridden by a default namespace on a descendant element), and that any element without a namespace (i.e., no prefix and colon) belongs to the default namespace. That's why we can write the shorthand <code><textbox/></code> instead of <code><xul:textbox/></code> in XUL (although the latter is just as correct when not using <code>http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</code> as the default namespace) -- the XUL namespace is defined as the default on the topmost element. In other words, a default namespace permits a kind of short-hand to be used for all descendants of an element.</p> + +<p>Here's a question: what namespace contains the element <code>foo</code> in the XML document below?</p> + +<pre> <foo/> +</pre> + +<p>The answer is that it's in <strong>no</strong> namespace, or alternately, it's in the namespace denoted by the empty string:</p> + +<pre> <foo xmlns=""/> +</pre> + +<p>This second example is semantically equivalent to the first.</p> + +<p>Now, a second question: what namespaces are the <code>bar</code>, <code>baz</code>, and <code>quux</code> attributes in?</p> + +<pre> <foo bar="value"> + <element xmlns="namespace!" baz="value"> + <element quux="value"/> + </element> + </foo> +</pre> + +<p><code>bar</code> is obviously not in a namespace. What about <code>baz</code> and <code>quux</code>? The answer is that they aren't in a namespace either. In fact no unprefixed attribute is ever in a namespace, primarily because XML originally didn't have namespaces, and all XML from that time had to stay in no namespace. This is a source of perennial confusion for XML namespaces.</p> + +<div id="SL_balloon_obj" style="display: block;"> +<div class="SL_ImTranslatorLogo" id="SL_button" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%; opacity: 0; display: block; left: -8px; top: -25px; transition: visibility 2s ease 0s, opacity 2s linear 0s;"> </div> + +<div id="SL_shadow_translation_result2" style="display: none;"> </div> + +<div id="SL_shadow_translator" style="display: none;"> +<div id="SL_planshet"> +<div id="SL_arrow_up" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;"> </div> + +<div id="SL_Bproviders"> +<div class="SL_BL_LABLE_ON" id="SL_P0" title="Google">G</div> + +<div class="SL_BL_LABLE_ON" id="SL_P1" title="Microsoft">M</div> + +<div class="SL_BL_LABLE_ON" id="SL_P2" title="Translator">T</div> +</div> + +<div id="SL_alert_bbl" style="display: none;"> +<div id="SLHKclose" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;"> </div> + +<div id="SL_alert_cont"> </div> +</div> + +<div id="SL_TB"> +<table id="SL_tables"> + <tbody><tr> + <td class="SL_td"><input></td> + <td class="SL_td"><select><option value="auto">Detectar idioma</option><option value="af">Africâner</option><option value="sq">Albanês</option><option value="de">Alemão</option><option value="ar">Arabe</option><option value="hy">Armênio</option><option value="az">Azerbaijano</option><option value="eu">Basco</option><option value="bn">Bengali</option><option value="be">Bielo-russo</option><option value="my">Birmanês</option><option value="bs">Bósnio</option><option value="bg">Búlgaro</option><option value="ca">Catalão</option><option value="kk">Cazaque</option><option value="ceb">Cebuano</option><option value="ny">Chichewa</option><option value="zh-CN">Chinês (Simp)</option><option value="zh-TW">Chinês (Trad)</option><option value="si">Cingalês</option><option value="ko">Coreano</option><option value="ht">Crioulo haitiano</option><option value="hr">Croata</option><option value="da">Dinamarquês</option><option value="sk">Eslovaco</option><option value="sl">Esloveno</option><option value="es">Espanhol</option><option value="eo">Esperanto</option><option value="et">Estoniano</option><option value="fi">Finlandês</option><option value="fr">Francês</option><option value="gl">Galego</option><option value="cy">Galês</option><option value="ka">Georgiano</option><option value="el">Grego</option><option value="gu">Gujarati</option><option value="ha">Hauça</option><option value="iw">Hebraico</option><option value="hi">Hindi</option><option value="hmn">Hmong</option><option value="nl">Holandês</option><option value="hu">Húngaro</option><option value="ig">Igbo</option><option value="id">Indonésio</option><option value="en">Inglês</option><option value="yo">Ioruba</option><option value="ga">Irlandês</option><option value="is">Islandês</option><option value="it">Italiano</option><option value="ja">Japonês</option><option value="jw">Javanês</option><option value="kn">Kannada</option><option value="km">Khmer</option><option value="lo">Laosiano</option><option value="la">Latim</option><option value="lv">Letão</option><option value="lt">Lituano</option><option value="mk">Macedônico</option><option value="ml">Malaiala</option><option value="ms">Malaio</option><option value="mg">Malgaxe</option><option value="mt">Maltês</option><option value="mi">Maori</option><option value="mr">Marathi</option><option value="mn">Mongol</option><option value="ne">Nepalês</option><option value="no">Norueguês</option><option value="fa">Persa</option><option value="pl">Polonês</option><option value="pt">Português</option><option value="pa">Punjabi</option><option value="ro">Romeno</option><option value="ru">Russo</option><option value="sr">Sérvio</option><option value="st">Sesotho</option><option value="so">Somália</option><option value="sw">Suaíli</option><option value="su">Sudanês</option><option value="sv">Sueco</option><option value="tg">Tadjique</option><option value="tl">Tagalo</option><option value="th">Tailandês</option><option value="ta">Tâmil</option><option value="cs">Tcheco</option><option value="te">Telugo</option><option value="tr">Turco</option><option value="uk">Ucraniano</option><option value="ur">Urdu</option><option value="uz">Uzbeque</option><option value="vi">Vietnamita</option><option value="yi">Yiddish</option><option value="zu">Zulu</option></select></td> + <td class="SL_td"> + <div id="SL_switch_b" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;" title="Alternar Idiomas"> </div> + </td> + <td class="SL_td"><select><option value="af">Africâner</option><option value="sq">Albanês</option><option value="de">Alemão</option><option value="ar">Arabe</option><option value="hy">Armênio</option><option value="az">Azerbaijano</option><option value="eu">Basco</option><option value="bn">Bengali</option><option value="be">Bielo-russo</option><option value="my">Birmanês</option><option value="bs">Bósnio</option><option value="bg">Búlgaro</option><option value="ca">Catalão</option><option value="kk">Cazaque</option><option value="ceb">Cebuano</option><option value="ny">Chichewa</option><option value="zh-CN">Chinês (Simp)</option><option value="zh-TW">Chinês (Trad)</option><option value="si">Cingalês</option><option value="ko">Coreano</option><option value="ht">Crioulo haitiano</option><option value="hr">Croata</option><option value="da">Dinamarquês</option><option value="sk">Eslovaco</option><option value="sl">Esloveno</option><option value="es">Espanhol</option><option value="eo">Esperanto</option><option value="et">Estoniano</option><option value="fi">Finlandês</option><option value="fr">Francês</option><option value="gl">Galego</option><option value="cy">Galês</option><option value="ka">Georgiano</option><option value="el">Grego</option><option value="gu">Gujarati</option><option value="ha">Hauça</option><option value="iw">Hebraico</option><option value="hi">Hindi</option><option value="hmn">Hmong</option><option value="nl">Holandês</option><option value="hu">Húngaro</option><option value="ig">Igbo</option><option value="id">Indonésio</option><option selected value="en">Inglês</option><option value="yo">Ioruba</option><option value="ga">Irlandês</option><option value="is">Islandês</option><option value="it">Italiano</option><option value="ja">Japonês</option><option value="jw">Javanês</option><option value="kn">Kannada</option><option value="km">Khmer</option><option value="lo">Laosiano</option><option value="la">Latim</option><option value="lv">Letão</option><option value="lt">Lituano</option><option value="mk">Macedônico</option><option value="ml">Malaiala</option><option value="ms">Malaio</option><option value="mg">Malgaxe</option><option value="mt">Maltês</option><option value="mi">Maori</option><option value="mr">Marathi</option><option value="mn">Mongol</option><option value="ne">Nepalês</option><option value="no">Norueguês</option><option value="fa">Persa</option><option value="pl">Polonês</option><option value="pt">Português</option><option value="pa">Punjabi</option><option value="ro">Romeno</option><option value="ru">Russo</option><option value="sr">Sérvio</option><option value="st">Sesotho</option><option value="so">Somália</option><option value="sw">Suaíli</option><option value="su">Sudanês</option><option value="sv">Sueco</option><option value="tg">Tadjique</option><option value="tl">Tagalo</option><option value="th">Tailandês</option><option value="ta">Tâmil</option><option value="cs">Tcheco</option><option value="te">Telugo</option><option value="tr">Turco</option><option value="uk">Ucraniano</option><option value="ur">Urdu</option><option value="uz">Uzbeque</option><option value="vi">Vietnamita</option><option value="yi">Yiddish</option><option value="zu">Zulu</option></select></td> + <td class="SL_td"> + <div id="SL_TTS_voice" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;" title="Ouça"> </div> + </td> + <td class="SL_td"> + <div class="SL_copy" id="SL_copy" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;" title="Copiar"> </div> + </td> + <td class="SL_td"> + <div id="SL_bbl_font_patch"> </div> + + <div class="SL_bbl_font" id="SL_bbl_font" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;" title="Tamanho da fonte"> </div> + </td> + <td class="SL_td"> + <div id="SL_bbl_help" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;" title="Ajuda"> </div> + </td> + <td class="SL_td"> + <div class="SL_pin_off" id="SL_pin" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;" title="Fixar a janela de pop-up"> </div> + </td> + </tr> +</tbody></table> +</div> +</div> + +<div id="SL_shadow_translation_result" style=""> </div> + +<div class="SL_loading" id="SL_loading" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;"> </div> + +<div id="SL_player2"> </div> + +<div id="SL_alert100">A função de fala é limitada a 200 caracteres</div> + +<div id="SL_Balloon_options" style="background: rgb(255, 255, 255) repeat scroll 0% 0%;"> +<div id="SL_arrow_down" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;"> </div> + +<table id="SL_tbl_opt" style="width: 100%;"> + <tbody><tr> + <td><input></td> + <td> + <div id="SL_BBL_IMG" style="background: rgba(0, 0, 0, 0) repeat scroll 0% 0%;" title="Mostrar o botão do ImTranslator 3 segundos"> </div> + </td> + <td><a class="SL_options" title="Mostrar opções">Opções</a> : <a class="SL_options" title="Histórico de tradução">Histórico</a> : <a class="SL_options" title="Comentários">Comentários</a> : <a class="SL_options" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GD9D8CPW8HFA2" title="Faça sua contribuição">Donate</a></td> + <td><span id="SL_Balloon_Close" title="Encerrar">Encerrar</span></td> + </tr> +</tbody></table> +</div> +</div> +</div> diff --git a/files/pt-pt/archive/mozilla/xul/outros_recursos/index.html b/files/pt-pt/archive/mozilla/xul/outros_recursos/index.html new file mode 100644 index 0000000000..fba234096d --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/outros_recursos/index.html @@ -0,0 +1,6 @@ +--- +title: Outros recursos +slug: Archive/Mozilla/XUL/Outros_recursos +--- +<p> +</p> diff --git a/files/pt-pt/archive/mozilla/xul/scale/index.html b/files/pt-pt/archive/mozilla/xul/scale/index.html new file mode 100644 index 0000000000..fab8882332 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/scale/index.html @@ -0,0 +1,235 @@ +--- +title: scale +slug: Archive/Mozilla/XUL/scale +tags: + - PrecisaDeConteúdo +--- +<p> +<span class="breadcrumbs XULRef_breadcrumbs"> + « <a href="/pt-PT/docs/XUL_Reference">XUL Reference home</a> [ + <a href="#Examples">Examples</a> | + <a href="#Attributes">Attributes</a> | + <a href="#Properties">Properties</a> | + <a href="#Methods">Methods</a> | + <a href="#Related">Related</a> ] +</span> +</p><p>Uma escala permite ao usuário selecionar um valor de uma faixa. Uma barra exibida horizontalmente ou verticalmente permite ao usuário selecionar um valor arrastando um ponteiro na barra. +</p><p>Use o atributo de orientação para especificar a orientação da escala. O valor padrão é <tt>horizontal</tt>, que exibe uma escala horizontal. Valores pequenos são para a esquerda e valores maiores para a direita. Configure o atributo <code>orient</code> para <tt>vertical</tt> para usar uma escala vertical. +</p><p>O usuário pode usar as teclas de flecha para incrementar ou decrementar o valor em uma unidade, ou as teclas de "page up" e "page down" para incrementar ou decrementar uma página, como especificado pelo atributo <code>pageincrement</code>. As teclas "home" e "end" configuram o valor da escala para os valores mínimo e máximo, respectivamente. +</p> +<dl><dt> Atributos +</dt><dd> <a href="#a-disabled">disabled</a>, <a href="#a-increment">increment</a>, <a href="#a-max">max</a>, <a href="#a-min">min</a>, <a href="#a-pageincrement">pageincrement</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-value">value</a> +</dd></dl> +<dl><dt> Propriedades +</dt><dd> <a href="#p-disabled">disabled</a>, <a href="#p-max">max</a>, <a href="#p-min">min</a>, <a href="#p-increment">increment</a>, <a href="#p-pageIncrement">pageIncrement</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a>, </dd></dl> +<dl><dt> Métodos +</dt><dd> <a href="#m-decrease">decrease</a>, <a href="#m-decreasePage">decreasePage</a>, <a href="#m-increase">increase</a>, <a href="#m-increasePage">increasePage</a>, +</dd></dl> +<h3 id="Examples" name="Examples"> Examples </h3> +<p>Escala horizontal: +</p> +<pre><scale min="1" max="10"/> +</pre> +<p><img alt="Image:Controlguide-scale.png"> +</p><p>Escala vertical: +</p> +<pre><scale min="1" max="10" orient="vertical"/> +</pre> +<h3 id="Atributos" name="Atributos"> Atributos </h3> +<p> +</p><div id="a-disabled"> + + +<dl> + <dt><code id="a-disabled"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt> + <dd>Type: <em>boolean</em></dd> + <dd>Indicates whether the element is disabled or not. If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the <code>command</code> event will not fire. In the case of form elements, it will not be submitted. Do not set the attribute to <code>true</code>, as this will suggest you can set it to <code>false</code> to enable the element again, which is not the case. + + <div>The <code>disabled</code> attribute is allowed only for form controls. Using it with an anchor tag (an <code><a></code> link) will have no effect.</div> + + <div> + The element will, however, still respond to mouse events. To enable the element, leave this attribute out entirely.</div> + </dd> + <dd>Visible controls have a <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/disabled">disabled</a></span></code> property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.</dd> +</dl> + + +</div> +<div id="a-increment"> + +<dl> + <dt> + <code id="a-increment"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + The amount by which the <code id="a-curpos"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/curpos">curpos</a></code> (for scroll bars) or <code id="a-value"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). The default value is 1.</dd> +</dl> +</div> +<div id="a-min"> + +<dl> + <dt> + <code id="a-min"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + The minimum value the control's value may take. The default value is 0.</dd> +</dl> +<p> </p> +</div> +<div id="a-max"> + +<dl> + <dd> + Type: <em>integer</em></dd> + <dd> + The maximum value that the scale or number box may be set to. The default value is 100 for scales and Infinity for number boxes.</dd> +</dl> + +<p> </p> +</div> +<div id="a-pageincrement"> + + +<dl> + <dt><code id="a-pageincrement"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/pageincrement">pageincrement</a></code></dt> + <dd>Type: <em>integer</em></dd> + <dd>The amount by which the value of the <code>curpos</code> or <code>value</code> attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. The default value is 10.</dd> +</dl> +</div> +<div id="a-tabindex"> + + +<dl> + <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt> + <dd>Type: <em>integer</em></dd> + <dd>The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "<code>tab</code>" key. Elements with a higher <code>tabindex</code> are later in the tab sequence.</dd> +</dl> +</div> +<div id="a-value"> + + +<dl> + <dt><code id="a-value"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt> + <dd>Type: <em>string</em></dd> + <dd>The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use. Be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) Use another attribute like "value2" or "data-myAtt" (as in the HTML5 draft), as XUL does not require validation (less future-proof); 2) Use <a href="/en/DOM/element.setAttributeNS" title="en/DOM/element.setAttributeNS">setAttributeNS()</a> to put custom attributes in a non-XUL namespace (serializable and future-proof); 3) Use <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData()</a> (future-proof and clean, but not easily serializable). For user editable <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code> elements, the contents, as visible to the user, are read and set using the Menulist.value syntax. For those elements, <a href="/en/DOM/element.setAttribute" title="en/DOM/element.setAttributeNS">setAttribute("value", myValue)</a> and <a href="/en/DOM/element.setAttribute" title="en/DOM/element.getAttributeNS">getAttribute("value")</a> do not access or affect the contents displayed to the user.</dd> +</dl> + + + +<p> </p> +</div> + +<h3 id="Propriedades" name="Propriedades"> Propriedades </h3> +<p> +</p><div id="p-disabled"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/disabled">disabled</a></span></code></dt> + <dd> + Type: <em>boolean</em></dd> + <dd> + Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd> +</dl> +</div> +<div id="p-increment"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/increment">increment</a></span></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + Gets and sets the value of the <code id="a-increment"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code> attribute.</dd> +</dl></div> +<div id="p-min"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/min">min</a></span></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + Gets and sets the value of the <code id="a-min"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code> attribute.</dd> +</dl></div> +<div id="p-max"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/max">max</a></span></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + Gets and sets the value of the <code id="a-max"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code> attribute.</dd> +</dl></div> +<div id="p-pageIncrement"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/pageIncrement">pageIncrement</a></span></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + Gets and sets the value of the <code id="a-pageincrement"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/pageincrement">pageincrement</a></code> attribute.</dd> +</dl></div> +<div id="p-tabIndex"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt> + <dd> + Type: <em>integer</em></dd> + <dd> + Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd> +</dl></div> +<div id="p-value"> +<dl> + <dt> + <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/value">value</a></span></code></dt> + <dd> + Type: <em>string</em></dd> + <dd> + Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute. For <code><a href="/en-US/docs/Mozilla/Tech/XUL/textbox" title="textbox">textbox</a></code> and user editable <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code> elements, the contents, as visible to the user, are read and set using the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/Textbox.value">Textbox.value</a></span></code> and Menulist.value syntax.</dd> +</dl> + +<p> </p></div> + +<h3 id="M.C3.A9todos" name="M.C3.A9todos"> Métodos </h3> +<table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Methods</strong><br> <small><code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a class="internal" href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <a class="internal" href="/En/DOM/Node.getFeature" title="En/DOM/Node.getFeature">getFeature</a>, <a class="internal" href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a class="internal" href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a class="internal" href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.isSupported">isSupported()</a></code>, <a class="internal" href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a class="internal" href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/pt-PT/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a class="internal" href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p> </td> </tr> </tbody> +</table> +<dl> + <dt> + <span id="m-decrease"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/decrease">decrease()</a></code></span></dt> + <dd> + Return type: <em>no return value</em></dd> + <dd> + Decreases the value of the scale or number box by the <code id="a-increment"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>.</dd> +</dl> +<dl> + <dt> + <span id="m-decreasePage"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/decreasePage">decreasePage()</a></code></span></dt> + <dd> + Return type: <em>no return value</em></dd> + <dd> + Decreases the value of the scale by the <code id="a-pageincrement"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/pageincrement">pageincrement</a></code>.</dd> +</dl> +<dl> + <dt> + <span id="m-increase"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/increase">increase()</a></code></span></dt> + <dd> + Return type: <em>no return value</em></dd> + <dd> + Increases the value of the scale or number box by the <code id="a-increment"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>.</dd> +</dl> +<dl> + <dt> + <span id="m-increasePage"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/increasePage">increasePage()</a></code></span></dt> + <dd> + Return type: <em>no return value</em></dd> + <dd> + Increases the value of the scale by the page increment.</dd> +</dl> + +<h3 id="Relacionado" name="Relacionado"> Relacionado </h3> +<dl><dt> Interfaces +</dt><dd> <a href="pt/NsIDOMXULControlElement">nsIDOMXULControlElement</a> +</dd></dl> +<p><span class="comment">Categorias</span> +</p><p><span class="comment">Interwiki Language Links</span> +</p> diff --git a/files/pt-pt/archive/mozilla/xul/tutorial/adicionar_etiquetas_e_imagens/index.html b/files/pt-pt/archive/mozilla/xul/tutorial/adicionar_etiquetas_e_imagens/index.html new file mode 100644 index 0000000000..7f6d53c292 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/tutorial/adicionar_etiquetas_e_imagens/index.html @@ -0,0 +1,102 @@ +--- +title: Adicionar Etiquetas e Imagens +slug: Archive/Mozilla/XUL/Tutorial/Adicionar_Etiquetas_e_Imagens +tags: + - Tutoriais + - Tutorial de XUL + - XUL +translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Labels_and_Images +--- +<div class="prevnext" style="text-align: right;"> + <p><a href="/pt-PT/docs/XUL_Tutorial/Adding_Buttons" style="float: left;">« Anterior</a><a href="/pt-PT/docs/XUL_Tutorial/Input_Controls">Próxima »</a></p> +</div> + +<p>Esta secção descreve uma maneira para adicionar etiquetas e imagens a uma janela. Além disso, nós consideramos em como incluir os elementos em grupos.</p> + +<h3 id="Text_Elements" name="Text_Elements">Elementos de Texto</h3> + +<p>You cannot embed text directly into a XUL file without tags around it and expect it to be displayed. You can use two XUL elements for this purpose.</p> + +<h4 id="Label_Element" name="Label_Element">Elemento Etiqueta</h4> + +<p>The most basic way to include text in a window is to use the <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element. It should be used when you want to place a descriptive label beside a control, such as a button. An example is shown below:</p> + +<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_1.xul">View</a></p> + +<pre><label value="This is some text"/> +</pre> + +<p>The <code><code id="a-value"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></code> attribute can be used to specify the text that you wish to have displayed. The text will not wrap, so the text will all be displayed on a single line. This syntax is the most common of labels.</p> + +<p>If the text needs to wrap, you can place the text content inside opening and closing tags as in the following example:</p> + +<p><span id="Example_2"><a id="Example_2"></a><strong>Example 2</strong></span> :</p> + +<pre><label>This is some longer text that will wrap onto several lines.</label> +</pre> + +<p>As with HTML, line breaks and extra whitespace are collapsed into a single space. Later, we'll find out <a href="/en-US/docs/XUL_Tutorial/Element_Positioning" title="en/XUL_Tutorial/Element_Positioning">how to constrain the width of elements</a> so that we can see the wrapping more easily.</p> + +<h5 id="Control_Attribute" name="Control_Attribute">Atributo de Controle</h5> + +<p>You can use the <code><code id="a-control"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code></code> attribute to set which control the label is associated with. When the user clicks on an associated label, that control will be focused. This association is also important for <a href="/en-US/docs/Accessibility" title="en/Accessibility">accessibility</a>, so that screen readers read aloud the label for the control as the user tabs to it. Set the value of the <code>control</code> attribute to the <code><code id="a-id"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></code> of the element to be focused.</p> + +<p><span id="Example_3"><a id="Example_3"></a><strong>Example 3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_3.xul">View</a></p> + +<pre><label value="Click here:" control="open-button"/> +<button id="open-button" label="Open"/> +</pre> + +<p>In the example above, clicking the label will cause the button to be focused.</p> + +<h4 id="Description_Element" name="Description_Element">Elemento Descrição</h4> + +<p>For descriptive text not associated with any particular control, you can use the <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/description" title="description">description</a></code> tag. This element is useful for informative text at the top of a dialog or a group of controls for example. As with the <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element, you can either use the <code>value</code> attribute for a single line of text or place text or XHTML content inside opening and closing description tags for longer blocks of text. It is more common to use the attribute syntax for labels, and the text content syntax for descriptions.</p> + +<p><span id="Example_4"><a id="Example_4"></a><strong>Example 4</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_2.xul">View</a></p> + +<pre><description> + This longer section of text is displayed. +</description> +</pre> + +<p>You can set the text via script using the <a href="/en-US/docs/DOM/Node.textContent" title="En/DOM/Node.textContent">textContent</a> property, as in the following example:</p> + +<pre><description id="text" width="200"/> + +document.getElementById('text').textContent = "Some lengthy word wrapped text goes here."; +</pre> + +<p>Internally, both the <code><code><a href="/pt-PT/docs/Mozilla/Tech/XUL/label" title="label">label</a></code></code> element and the <code><code><a href="/pt-PT/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></code> elements are the same. The <code><code><a href="/pt-PT/docs/Mozilla/Tech/XUL/label" title="label">label</a></code></code> element is intended for labels of controls, such as text fields. The <code>control</code> attribute is only supported for labels. The <code><code><a href="/pt-PT/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></code> element is intended for other descriptive text such as informative text at the top of a <code><code><a href="/pt-PT/docs/Mozilla/Tech/XUL/dialog" title="dialog">dialog</a></code></code> box.</p> + +<h3 id="Images" name="Images">Imagens</h3> + +<p>XUL has an element to display images within a window. This element is appropriately named <code><a href="/pt-PT/docs/Mozilla/Tech/XUL/image" title="image">image</a></code>. Note that the tag name is different than HTML (<em>image</em> instead of <em>img</em>). You can use the <code><code id="a-src"><a href="https://developer.mozilla.org/pt-PT/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code></code> attribute to specify the URL of the image file. The example below shows this:</p> + +<pre class="brush: xml"><image src="images/banner.jpg"/> +</pre> + +<p>Although you can use this syntax, it would be better in order to support different themes to use a style sheet to set the image URL. A later section will describe how to <a href="/en-US/docs/XUL_Tutorial/Adding_Style_Sheets" title="en/XUL_Tutorial/Adding_Style_Sheets">use style sheets</a>, but an example will be shown here for completeness. You can use the <code><a href="/en-US/docs/CSS/list-style-image" title="en/CSS/list-style-image">list-style-image</a></code> CSS property to set the URL for the image. Here are some examples:</p> + +<pre class="brush: xml"><strong>XUL:</strong> + <image id="image1"/> + <image id="search"/> +</pre> + +<pre class="brush: css"><strong>Style Sheet:</strong> + #image1 { + list-style-image: url("<a class="external" rel="freelink">chrome://findfile/skin/banner.jpg</a>"); + } + + #search { + list-style-image: url("<span class="nowiki">http://example.com/images/search.png</span>"); + } +</pre> + +<p>These images come from within the chrome directory, in the skin for the findfile package. Because images vary by theme, you would usually place images in the skin directory.</p> + +<p>In the next section, we will learn how to <a href="/en-US/docs/XUL_Tutorial/Input_Controls" title="en/XUL_Tutorial/Input_Controls">add some input controls to a window</a>.</p> + +<div class="prevnext" style="text-align: right;"> + <p><a href="/pt-PT/docs/XUL_Tutorial/Adding_Buttons" style="float: left;">« Anterior</a><a href="/pt-PT/docs/XUL_Tutorial/Input_Controls">Próxima »</a></p> +</div> diff --git a/files/pt-pt/archive/mozilla/xul/tutorial/ficheiros_de_propriedade/index.html b/files/pt-pt/archive/mozilla/xul/tutorial/ficheiros_de_propriedade/index.html new file mode 100644 index 0000000000..44657ee360 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/tutorial/ficheiros_de_propriedade/index.html @@ -0,0 +1,115 @@ +--- +title: Ficheiros de Propriedade +slug: Archive/Mozilla/XUL/Tutorial/Ficheiros_de_propriedade +tags: + - Internacionalização + - Localização + - Tutoriais + - Tutorial de XUL + - XUL +translation_of: Archive/Mozilla/XUL/Tutorial/Property_Files +--- +<p> </p> + +<p>{{ PreviousNext("XUL Tutorial:Localization", "XUL Tutorial:Introduction to XBL") }}</p> + +<p>Num <em>script</em>, não pode ser utilizadas as <em>entities</em>. Em vez disso, são utilizados 'ficheiros de Propriedade'.</p> + +<h3 id="Properties" name="Properties">Properties</h3> + +<p>DTD files are suitable when you have text in a XUL file. However, a script does not get parsed for entities. In addition, you may wish to display a message which is generated from a script, if, for example, you do not know the exact text to be displayed. For this purpose, property files can be used.</p> + +<p>A property file contains a set of strings. You will find property files alongside the DTD files with a .properties extension. Properties in the file are declared with the syntax <code>name=value</code>. An example is shown below:</p> + +<pre>notFoundAlert=No files were found matching the criteria. +deleteAlert=Click OK to have all your files deleted. +resultMessage=%2$S files found in the %1$S directory. +</pre> + +<p>Here, the property file contains three properties. These would be read by a script and displayed to the user.</p> + +<p>A property file can also include comments. A line that begins with a hash sign ('#') is treated as a comment:</p> + +<pre># This is a comment +welcomeMessage=Hello, world! +# This is another comment +goodbyeMessage=Come back soon! +</pre> + +<h3 id="Stringbundles" name="Stringbundles">Stringbundles</h3> + +<p>You could write the code to read properties yourself, however XUL provides the <code>{{ XULElem("stringbundle") }}</code> element which does this for you. The element has a number of functions which can be used to get strings from the property file and get other locale information. This element reads in the contents of a property file and builds a list of properties for you. You can then look up a particular property by name.</p> + +<pre><stringbundleset id="<code>stringbundleset</code>"> +<stringbundle id="strings" src="strings.properties"/> +</stringbundleset> +</pre> + +<p>Including this element will read the properties from the file 'strings.properties' in the same directory as the XUL file. Use a chrome URL to read a file from the locale:</p> + +<pre><stringbundleset id="<code>stringbundleset</code>"> +<stringbundle id="strings" src="chrome://myplugin/locale/strings.properties"/> +</stringbundleset> +</pre> + +<p>Like other non-displayed elements, you should declare all your stringbundles inside a <code>{{ XULElem("stringbundleset") }}</code> element so that they are all kept together.</p> + +<h4 id="Getting_a_String_from_the_Bundle" name="Getting_a_String_from_the_Bundle">Getting a String from the Bundle</h4> + +<p>This <code>{{ XULElem("stringbundle") }}</code> element has a number of properties. The first is <code>getString</code> which can be used in a script to read a string from the bundle.</p> + +<pre>var strbundle = document.getElementById("strings"); +var nofilesfound=strbundle.getString("notFoundAlert"); + +alert(nofilesfound); +</pre> + +<ul> + <li>This example first gets a reference to the bundle using its <code>id</code></li> + <li>Then, it looks up the string 'notFoundAlert' in the property file. The function <code>getString()</code> returns the value of the string or null if the string does not exist.</li> + <li>Finally, the string is displayed in an alert box.</li> +</ul> + +<h4 id="Text_Formatting" name="Text_Formatting">Text Formatting</h4> + +<p>The next method is <code>getFormattedString()</code>. This method also gets a string with the given key name from the bundle. In addition, each occurrence of formatting code (e.g. <code>%S</code>) is replaced by each successive element in the supplied array.</p> + +<pre class="brush: js">var dir = "/usr/local/document"; +var count = 10; + +var strbundle = document.getElementById("strings"); +var result = strbundle.getFormattedString("resultMessage", [ dir, count ]); + +alert(result); +</pre> + +<p>This example will display following message in an alert box.</p> + +<pre>10 files found in the /usr/local/document directory. +</pre> + +<p>You will notice the formatting codes <code>%1$S</code> and <code>%2$S</code> is used, and replaced different order in the array. Formatting code %<em>n</em>$S is specify the position of corresponding parameter directly. Although the word order is not the same in all the languages, by using <code>getFormattedString()</code> the specification of the order can be put out the property files.</p> + +<p>In case you need to format a string that already contains the percentage character in it (to get something like "50% Off" returned), escape the percentage character with another percentage character, like this:</p> + +<pre>my.percentage.string = %S%% Off +</pre> + +<p>Not escaping the percentage character will generate an incorrect string that strips the space character between the percentage character and the next word of the string ("50%Off").</p> + +<h3 id="Escape_non-ASCII_Characters" name="Escape_non-ASCII_Characters">Non-ASCII Characters, UTF-8 and escaping</h3> + +<p>Gecko 1.8.x (or later) supports property files encoded in UTF-8. You can and should write non-ASCII characters directly without escape sequences, and save the file as UTF-8 without BOM. Double-check the save options of your text editor, because many don't do this by default. See <a href="/en/Localizing_extension_descriptions" title="en/Localizing_extension_descriptions">Localizing extension descriptions</a> for more details.</p> + +<p>In some cases, it may be useful or needed to use escape sequences to express some characters. Property files support escape sequences of the form: <code>\uXXXX</code> , where XXXX is a Unicode character code. For example, to put a space at the beginning or end of a string (which would normally be stripped by the properties file parser), use \u0020 .</p> + +<p><br> + In the next section, we will look at XBL, which can be used to define the <a href="/en/XUL_Tutorial/Introduction_to_XBL" title="en/XUL_Tutorial/Introduction_to_XBL">behavior of an element</a>.</p> + +<p>{{ PreviousNext("XUL Tutorial:Localization", "XUL Tutorial:Introduction to XBL") }}</p> + +<h2 id="Consulte_Também">Consulte Também</h2> + +<ul> + <li>How to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: <a href="/en-US/Add-ons/Bootstrapped_extensions#Localization_%28L10n%29">Bootstrapped Extensions :: Localization (L10n)</a></li> +</ul> diff --git a/files/pt-pt/archive/mozilla/xul/tutorial/index.html b/files/pt-pt/archive/mozilla/xul/tutorial/index.html new file mode 100644 index 0000000000..8071ee6794 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/tutorial/index.html @@ -0,0 +1,142 @@ +--- +title: XUL Tutorial +slug: Archive/Mozilla/XUL/Tutorial +tags: + - NeedsTranslation + - TopicStub + - Tutorials + - XUL + - XUL_Tutorial +translation_of: Archive/Mozilla/XUL/Tutorial +--- +<p>This tutorial describes <a href="/en-US/docs/XUL" title="/en-US/docs/XUL">XUL</a>, the <a href="/en-US/docs/XML" title="/en-US/docs/XML">XML</a> User-interface Language. This language was created for the Mozilla application and is used to describe its user interface.</p> +<h2 id="Introduction" name="Introduction">Introduction</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Introduction" title="/en-US/docs/XUL/Tutorial/Introduction">Introduction</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/XUL_Structure" title="/en-US/docs/XUL/Tutorial/XUL_Structure">XUL Structure</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/The_Chrome_URL" title="/en-US/docs/XUL/Tutorial/The_Chrome_URL">The Chrome URL</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Manifest_Files" title="/en-US/docs/XUL/Tutorial/Manifest_Files">Manifest Files</a></li> +</ul> +<h2 id="Simple_Elements" name="Simple_Elements">Simple Elements</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Creating_a_Window" title="/en-US/docs/XUL/Tutorial/Creating_a_Window">Creating a Window</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_Buttons" title="/en-US/docs/XUL/Tutorial/Adding_Buttons">Adding Buttons</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_Labels_and_Images" title="/en-US/docs/XUL/Tutorial/Adding_Labels_and_Images">Adding Labels and Images</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Input_Controls" title="/en-US/docs/XUL/Tutorial/Input_Controls">Input Controls</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Numeric_Controls" title="/en-US/docs/XUL/Tutorial/Numeric_Controls">Numeric Controls</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/List_Controls" title="/en-US/docs/XUL/Tutorial/List_Controls">List Controls</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Progress_Meters" title="/en-US/docs/XUL/Tutorial/Progress_Meters">Progress Meters</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_HTML_Elements" title="/en-US/docs/XUL/Tutorial/Adding_HTML_Elements">Adding HTML Elements</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Using_Spacers" title="/en-US/docs/XUL/Tutorial/Using_Spacers">Using Spacers</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/More_Button_Features" title="/en-US/docs/XUL/Tutorial/More_Button_Features">More Button Features</a></li> +</ul> +<h2 id="The_Box_Model" name="The_Box_Model">The Box Model</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/The_Box_Model" title="/en-US/docs/XUL/Tutorial/The_Box_Model">The Box Model</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Element_Positioning" title="/en-US/docs/XUL/Tutorial/Element_Positioning">Element Positioning</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Box_Model_Details" title="/en-US/docs/XUL/Tutorial/Box_Model_Details">Box Model Details</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Groupboxes" title="/en-US/docs/XUL/Tutorial/Groupboxes">Groupboxes</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_More_Elements" title="/en-US/docs/XUL/Tutorial/Adding_More_Elements">Adding More Elements</a></li> +</ul> +<h2 id="More_Layout_Elements" name="More_Layout_Elements">More Layout Elements</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Stacks_and_Decks" title="/en-US/docs/XUL/Tutorial/Stacks_and_Decks">Stacks and Decks</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Stack_Positioning" title="/en-US/docs/XUL/Tutorial/Stack_Positioning">Stack Positioning</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Tabboxes" title="/en-US/docs/XUL/Tutorial/Tabboxes">Tabboxes</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Grids" title="/en-US/docs/XUL/Tutorial/Grids">Grids</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Content_Panels" title="/en-US/docs/XUL/Tutorial/Content_Panels">Content Panels</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Splitters" title="/en-US/docs/XUL/Tutorial/Splitters">Splitters</a></li> +</ul> +<h2 id="Toolbars_and_Menus" name="Toolbars_and_Menus">Toolbars and Menus</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Toolbars" title="/en-US/docs/XUL/Tutorial/Toolbars">Toolbars</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Simple_Menu_Bars" title="/en-US/docs/XUL/Tutorial/Simple_Menu_Bars">Simple Menu Bars</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/More_Menu_Features" title="/en-US/docs/XUL/Tutorial/More_Menu_Features">More Menu Features</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Popup_Menus" title="/en-US/docs/XUL/Tutorial/Popup_Menus">Popup Menus</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Scrolling_Menus" title="/en-US/docs/XUL/Tutorial/Scrolling_Menus">Scrolling Menus</a></li> +</ul> +<h2 id="Events_and_Scripts" name="Events_and_Scripts">Events and Scripts</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_Event_Handlers" title="/en-US/docs/XUL/Tutorial/Adding_Event_Handlers">Adding Event Handlers</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/More_Event_Handlers" title="/en-US/docs/XUL/Tutorial/More_Event_Handlers">More Event Handlers</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Keyboard_Shortcuts" title="/en-US/docs/XUL/Tutorial/Keyboard_Shortcuts">Keyboard Shortcuts</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Focus_and_Selection" title="/en-US/docs/XUL/Tutorial/Focus_and_Selection">Focus and Selection</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Commands" title="/en-US/docs/XUL/Tutorial/Commands">Commands</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Updating_Commands" title="/en-US/docs/XUL/Tutorial/Updating_Commands">Updating Commands</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Broadcasters_and_Observers" title="/en-US/docs/XUL/Tutorial/Broadcasters_and_Observers">Broadcasters and Observers</a></li> +</ul> +<h2 id="Document_Object_Model" name="Document_Object_Model">Document Object Model</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Document_Object_Model" title="/en-US/docs/XUL/Tutorial/Document_Object_Model">Document Object Model</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Modifying_a_XUL_Interface" title="/en-US/docs/XUL/Tutorial/Modifying_a_XUL_Interface">Modifying a XUL Interface</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Manipulating_Lists" title="/en-US/docs/XUL/Tutorial/Manipulating_Lists">Manipulating Lists</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Box_Objects" title="/en-US/docs/XUL/Tutorial/Box_Objects">Box Objects</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/XPCOM_Interfaces" title="/en-US/docs/XUL/Tutorial/XPCOM_Interfaces">XPCOM Interfaces</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/XPCOM_Examples" title="/en-US/docs/XUL/Tutorial/XPCOM_Examples">XPCOM Examples</a></li> +</ul> +<h2 id="Trees" name="Trees">Trees</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Trees" title="/en-US/docs/XUL/Tutorial/Trees">Trees</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/More_Tree_Features" title="/en-US/docs/XUL/Tutorial/More_Tree_Features">More Tree Features</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Tree_Selection" title="/en-US/docs/XUL/Tutorial/Tree_Selection">Tree Selection</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Custom_Tree_Views" title="/en-US/docs/XUL/Tutorial/Custom_Tree_Views">Custom Tree Views</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Tree_View_Details" title="/en-US/docs/XUL/Tutorial/Tree_View_Details">Tree View Details</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Tree_Box_Objects" title="/en-US/docs/XUL/Tutorial/Tree_Box_Objects">Tree Box Objects</a></li> +</ul> +<h2 id="RDF_and_Templates" name="RDF_and_Templates">RDF and Templates</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Introduction_to_RDF" title="/en-US/docs/XUL/Tutorial/Introduction_to_RDF">Introduction to RDF</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Templates" title="/en-US/docs/XUL/Tutorial/Templates">Templates</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Trees_and_Templates" title="/en-US/docs/XUL/Tutorial/Trees_and_Templates">Trees and Templates</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/RDF_Datasources" title="/en-US/docs/XUL/Tutorial/RDF_Datasources">RDF Datasources</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Advanced_Rules" title="/en-US/docs/XUL/Tutorial/Advanced_Rules">Advanced Rules</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Persistent_Data" title="/en-US/docs/XUL/Tutorial/Persistent_Data">Persistent Data</a></li> +</ul> +<h2 id="Skins_and_Locales" name="Skins_and_Locales">Skins and Locales</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_Style_Sheets" title="/en-US/docs/XUL/Tutorial/Adding_Style_Sheets">Adding Style Sheets</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Styling_a_Tree" title="/en-US/docs/XUL/Tutorial/Styling_a_Tree">Styling a Tree</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Modifying_the_Default_Skin" title="/en-US/docs/XUL/Tutorial/Modifying_the_Default_Skin">Modifying the Default Skin</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Creating_a_Skin" title="/en-US/docs/XUL/Tutorial/Creating_a_Skin">Creating a Skin</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Localization" title="/en-US/docs/XUL/Tutorial/Localization">Localization</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Property_Files" title="/en-US/docs/XUL/Tutorial/Property_Files">Property Files</a></li> +</ul> +<h2 id="Bindings" name="Bindings">Bindings</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Introduction_to_XBL" title="/en-US/docs/XUL/Tutorial/Introduction_to_XBL">Introduction to XBL</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Anonymous_Content" title="/en-US/docs/XUL/Tutorial/Anonymous_Content">Anonymous Content</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/XBL_Attribute_Inheritance" title="/en-US/docs/XUL/Tutorial/XBL_Attribute_Inheritance">XBL Attribute Inheritance</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_Properties_to_XBL-defined_Elements" title="/en-US/docs/XUL/Tutorial/Adding_Properties_to_XBL-defined_Elements">Adding Properties</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_Methods_to_XBL-defined_Elements" title="/en-US/docs/XUL/Tutorial/Adding_Methods_to_XBL-defined_Elements">Adding Methods</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Adding_Event_Handlers_to_XBL-defined_Elements" title="/en-US/docs/XUL/Tutorial/Adding_Event_Handlers_to_XBL-defined_Elements">Adding Event Handlers</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/XBL_Inheritance" title="/en-US/docs/XUL/Tutorial/XBL_Inheritance">XBL Inheritance</a></li> + <li><a href="/en-US/docs/Mozilla/Tech/XUL/Tutorial/Using_XBL_from_stylesheets">Creating reusable content using CSS and XBL</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/XBL_Example" title="/en-US/docs/XUL/Tutorial/XBL_Example">XBL Example</a></li> +</ul> +<h2 id="Specialized_Window_Types" name="Specialized_Window_Types">Specialized Window Types</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Features_of_a_Window" title="/en-US/docs/XUL/Tutorial/Features_of_a_Window">Features of a Window</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Creating_Dialogs" title="/en-US/docs/XUL/Tutorial/Creating_Dialogs">Creating Dialogs</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Open_and_Save_Dialogs" title="/en-US/docs/XUL/Tutorial/Open_and_Save_Dialogs">Open and Save Dialogs</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Creating_a_Wizard" title="/en-US/docs/XUL/Tutorial/Creating_a_Wizard">Creating a Wizard</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/More_Wizards" title="/en-US/docs/XUL/Tutorial/More_Wizards">More Wizards</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Overlays" title="/en-US/docs/XUL/Tutorial/Overlays">Overlays</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Cross_Package_Overlays" title="/en-US/docs/XUL/Tutorial/Cross_Package_Overlays">Cross Package Overlays</a></li> +</ul> +<h2 id="Installation" name="Installation">Installation</h2> +<ul> + <li><a href="/en-US/docs/XUL/Tutorial/Creating_an_Installer" title="/en-US/docs/XUL/Tutorial/Creating_an_Installer">Creating an Installer</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Install_Scripts" title="/en-US/docs/XUL/Tutorial/Install_Scripts">Install Scripts</a></li> + <li><a href="/en-US/docs/XUL/Tutorial/Additional_Install_Features" title="/en-US/docs/XUL/Tutorial/Additional_Install_Features">Additional Install Features</a></li> +</ul> +<div class="note"> + <p>This XUL tutorial was originally created by <a class="external" href="http://www.xulplanet.com/ndeakin/">Neil Deakin</a>. He has graciously given us permission to use it as part of the <a href="/en-US/docs/Project:About" title="Project:About">MDN</a>.</p> +</div> +<div class="originaldocinfo"> + <h2 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h2> + <ul> + <li>Author: <a class="external" href="http://www.xulplanet.com/ndeakin/">Neil Deakin</a></li> + <li>Copyright Information: © 1999-2005 XULPlanet.com</li> + </ul> +</div> +<p> </p> diff --git a/files/pt-pt/archive/mozilla/xul/tutorial/modificar_o_tema_predefinido/index.html b/files/pt-pt/archive/mozilla/xul/tutorial/modificar_o_tema_predefinido/index.html new file mode 100644 index 0000000000..9c403175a6 --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/tutorial/modificar_o_tema_predefinido/index.html @@ -0,0 +1,70 @@ +--- +title: Modificar o Tema Predefinido +slug: Archive/Mozilla/XUL/Tutorial/Modificar_o_tema_predefinido +tags: + - Firefox + - Intermediário + - Personalização + - Tutoriais + - Tutorial XUL + - XUL +translation_of: Archive/Mozilla/XUL/Tutorial/Modifying_the_Default_Skin +--- +<p>{{ PreviousNext("XUL Tutorial:Styling a Tree", "XUL Tutorial:Creating a Skin") }}</p> + +<div class="warning"> +<p>Esta documentação não foi atualizada para o Firefox Quantum. Support for the <code>userChrome.css</code> file and any of its elements described below are not guaranteed in future versions of Firefox. Using it may lead to hard-to-diagnose bugs or crashes. Use at your own risk!</p> +</div> + +<p>Esta secção descreve como modificar o tema de uma janela.</p> + +<h3 id="Skin_Basics" name="Skin_Basics">O Essencial do Tema</h3> + +<p>A <a href="/en-US/docs/XUL/Tutorial/Creating_a_Skin">skin</a> is a set of style sheets, images and behaviors that are applied to a XUL file. By applying a different skin, you can change the look of a window without changing its functionality. Firefox provides a skin by default, and you may download others. The XUL for any skins is the same, however the style sheets and images used are different.</p> + +<p>For a simple personalized look to a Firefox window, you can easily change the style sheets associated with it. Larger changes can be done by creating an entirely new skin. Firefox has a Theme Manager for changing the default skin. (Although the underlying code for Mozilla calls them skins and the user interface calls them themes, they're both referring to the same thing).</p> + +<p>A skin is described using <a href="en/CSS">CSS</a>, allowing you to define the <a href="en/CSS/Getting_Started/Color">colors</a>, <a href="en/CSS/Getting_Started/Boxes">borders</a> and images used to draw elements. The file classic.jar contains the skin definitions. The global directory within this archive contains the main style definitions for how to display the various XUL elements. By changing these files, you can change the look of the XUL applications.</p> + +<h3 id="Customize_with_userChrome.css" name="Customize_with_userChrome.css">Personalizar com userChrome.css</h3> + +<p>If you place a file called 'userChrome.css' in a directory called 'chrome' inside your user profile directory, you can override settings without changing the archives themselves. This directory should be created when you create a profile and some examples placed there. The file 'userContent.css' customizes Web pages, whereas 'userChrome.css' customizes chrome files.</p> + +<p>For example, by adding the following to the end of the file, you can change all <code>{{ XULElem("menubar") }}</code> elements to have a red background.</p> + +<pre class="brush: css">menubar { + background-color: red; +} +</pre> + +<p>If you open any Firefox window after making this change, the menu bars will be red. Because this change was made to the user style sheet, it affects all windows. This means that the browser menu bar, the bookmarks menu bar and even the find files menu bar will be red.</p> + +<h3 id="Skin_Packages" name="Skin_Packages">Pacotes de Temas</h3> + +<p>To have the change affect only one window, change the style sheet associated with that XUL file. For example, to add a red border around the menu commands in the bookmarks manager window, add the following to bookmarksManager.css in the classic.jar or your favorite skin archive.</p> + +<pre class="brush: css">menuitem { + border: 1px solid red; +} +</pre> + +<p>If you look in one of the skin archives, you will notice that each contain a number of style sheets and a number of images. The style sheets refer to the images. You should avoid putting references to images directly in XUL files if you want your content to be skinnable. This is because a particular skin's design might not use images and it may need some more complex design. By referring to the images with CSS, they are easy to remove. It also removes the reliance on specific image filenames.</p> + +<p>You can assign images to a button, checkbox and other elements by using the <code>list-style-image</code> property as in the following:</p> + +<pre class="brush: css">checkbox { + list-style-image: url("chrome://findfile/skin/images/check-off.jpg"); +} + +checkbox[checked="true"] { + list-style-image: url("chrome://findfile/skin/images/check-on.jpg"); +} +</pre> + +<p>This code changes the image associated with a checkbox. The first style sets the image for a normal checkbox and the second style sets the image for a checked checkbox. The modifier 'checked=true' makes the style only apply to elements which have their checked attributes set to true.</p> + +<p><small>See also : <a href="/en-US/Add-ons/Themes/Obsolete/Creating_a_Skin_for_Firefox">creating a skin for Firefox</a> and <a href="en/CSS/Getting_Started">CSS getting started</a> </small></p> + +<p>Na secção seguinte, nós iremos abordar a <a href="/en-US/docs/Mozilla/Tech/XUL/Tutorial/Creating_a_Skin">criação de um novo tema</a></p> + +<p>{{ PreviousNext("XUL Tutorial:Styling a Tree", "XUL Tutorial:Creating a Skin") }}</p> diff --git a/files/pt-pt/archive/mozilla/xul/tutorial/xbl_bindings/index.html b/files/pt-pt/archive/mozilla/xul/tutorial/xbl_bindings/index.html new file mode 100644 index 0000000000..9b5dd8f99f --- /dev/null +++ b/files/pt-pt/archive/mozilla/xul/tutorial/xbl_bindings/index.html @@ -0,0 +1,215 @@ +--- +title: XBL bindings +slug: Archive/Mozilla/XUL/Tutorial/XBL_bindings +tags: + - 'CSS:Como_começar' +translation_of: Archive/Beginner_tutorials/Using_XBL_from_stylesheets +--- +<p>{{ PreviousNext("CSS:Como começar:JavaScript", "CSS:Como começar:Interfaces de usuário XUL") }}</p> + +<p>Esta página ilustra como o você pode usar as CSS no Mozilla para melhorar a estrutura de aplicações complexas, fazendo o código e recursos mais facilmente reutilizáveis.</p> + +<p>Você aplica esta técnica em uma simples demonstração.</p> + +<h2 id="Informa.C3.A7.C3.A3o_XBL_bindings" name="Informa.C3.A7.C3.A3o:_XBL_bindings">Informação: XBL bindings</h2> + +<p>A estrutura proporcionada pela linguagem de marcação e as CSS não é ideal para aplicações complexas onde partes precisam ser autônomas e reutilizáveis. Você pode colocar folhas de estilo em arquivos separados, e pode também colocar os scripts em arquivos separados. Mas você precisa ligar estes arquivos no documento como um todo.</p> + +<p>Outra limitação estrutural concerne ao conteúdo. Você pode usar as CSS para proporcionar conteúdo para elementos selecionados, mas o conteúdo é limitado a textos e imagens, e seu posicionamento é limitado em antes ou depois do elemento selecionado.</p> + +<p>Mozilla proporciona um mecanismo que supera estas limitações: <em>XBL</em> (XML Bindings Language). Você pode usar o XBL para ligar elementos selecionados ao próprio:</p> + +<ul> + <li>Folha de estilo</li> + <li>Conteúdo</li> + <li>Propriedades e métodos</li> + <li>Manipuladores de eventos</li> +</ul> + +<p>Evitando ligar tudo no nível do documento, você pode fazer as partes autônomas que são fáceis de manter e reutilizar.</p> + +<table style="border: 1px solid #36b; padding: 1em; background-color: #f4f4f4; margin-bottom: 1em; width: 100%;"> + <caption>Mais detalhes</caption> + <tbody> + <tr> + <td>Para mais informação sobre XBL bindings, veja a página <a href="/pt/XBL" title="pt/XBL">XBL</a> neste wiki.</td> + </tr> + </tbody> +</table> + +<h2 id="A.C3.A7.C3.A3o_Uma_demonstra.C3.A7.C3.A3o_XBL" name="A.C3.A7.C3.A3o:_Uma_demonstra.C3.A7.C3.A3o_XBL">Ação: Uma demonstração XBL</h2> + +<p>Crie um novo documento HTML, <code>doc6.html</code>. Copie e cole o conteúdo daqui:</p> + +<div style="width: 48em;"> +<pre><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> +<HTML> + +<HEAD> +<TITLE>Como Começar Mozilla CSS - Demonstração XBL </TITLE> +<LINK rel="stylesheet" type="text/css" href="style6.css"> +</HEAD> + +<BODY> +<H1>Demonstração XBL</H1> +<DIV id="square">Clique Aqui</DIV> +</BODY> + +</HTML> +</pre> +</div> + +<p>Crie um novo arquivo CSS, <code>style6.css</code>. Esta folha de estilo contém o documento de estilo. Copie e cole o conteúdo daqui:</p> + +<div style="width: 48em;"> +<pre>/*** Demonstração XBL ***/ +#square { + -moz-binding: url("square.xbl#square"); + } +</pre> +</div> + +<p>Crie um novo arquivo de texto, <code>square.xbl</code>. Este arquivo contém o XBL binding. Copie e cole o conteúdo daqui, tendo certeza de ter rolado a tela para pegar tudo isto:</p> + +<div style="width: 48em; height: 12em; overflow: auto;"> +<pre><?xml version="1.0"?> +<!DOCTYPE bindings> +<bindings xmlns="http://www.mozilla.org/xbl" + xmlns:html="http://www.w3.org/1999/xhtml"> + +<binding id="square"> + + <resources> + <stylesheet src="bind6.css"/> + </resources> + + <content> + <html:div anonid="square"/> + <html:button anonid="button" type="button"> + <children/> + </html:button> + </content> + + <implementation> + + <field name="square"><![CDATA[ + document.getAnonymousElementByAttribute(this, "anonid", "square") + ]]></field> + + <field name="button"><![CDATA[ + document.getAnonymousElementByAttribute(this, "anonid", "button") + ]]></field> + + <method name="doDemo"> + <body><![CDATA[ + this.square.style.backgroundColor = "#cf4" + this.square.style.marginLeft = "20em" + this.button.setAttribute("disabled", "true") + setTimeout(this.clearDemo, 2000, this) + ]]></body> + </method> + + <method name="clearDemo"> + <parameter name="me"/> + <body><![CDATA[ + me.square.style.backgroundColor = "transparent" + me.square.style.marginLeft = "0" + me.button.removeAttribute("disabled") + ]]></body> + </method> + + </implementation> + + <handlers> + <handler event="click" button="0"><![CDATA[ + if (event.originalTarget == this.button) this.doDemo() + ]]></handler> + </handlers> + + </binding> + +</bindings> +</pre> +</div> + +<p>Crie um novo arquivo CSS, <code>bind6.css</code>. Esta folha de estilo separada contém o estilo para o binding. Copie e cole o conteúdo daqui:</p> + +<div style="width: 48em;"> +<pre>/*** Demonstração XBL ***/ +[anonid="square"] { + width: 20em; + height: 20em; + border: 2px inset gray; + } + +[anonid="button"] { + margin-top: 1em; + padding: .5em 2em; + } +</pre> +</div> + +<p>Abra o documento no seu navegador e pressione o botão.</p> + +<p>O wiki não suporta JavaScript nas páginas, então não é possível demonstrar aqui. Deve parecer como isto, antes e depois de você pressionar o botão:</p> + +<table> + <tbody> + <tr> + <td style="padding-right: 2em;"> + <table style="border: 2px outset #36b; padding: 0 4em .5em .5em;"> + <tbody> + <tr> + <td> + <p><strong>Demonstração XBL</strong></p> + </td> + </tr> + </tbody> + </table> + </td> + <td> + <table style="border: 2px outset #36b; padding: 0 4em .5em .5em;"> + <tbody> + <tr> + <td> + <p><strong>Demonstração XBL</strong></p> + </td> + </tr> + </tbody> + </table> + </td> + </tr> + </tbody> +</table> + +<p>Notas sobre esta demonstração:</p> + +<ul> + <li>O documento HTML é ligado à folha de estilo normalmente mas isto não liga nenhum código JavaScript.</li> + <li>O documento não contém nenhum botão. Ele contém somente o texto do botão. O botão é adicionado por binding.</li> + <li>O documento folha de estilo liga o binding.</li> + <li>O binding liga isto à sua folha de estilo, e isto suporta seu conteúdo e o código JavaScript. Então o binding é autônomo.</li> +</ul> + +<table style="border: 1px solid #36b; padding: 1em; background-color: #fffff4; margin-bottom: .5em;"> + <caption>Desafios</caption> + <tbody> + <tr> + <td>Mude o arquivo XBL de modo que o quadrado dobre a largura ao mudar de cor, em vez de saltar para a direita. + <p>Use a ferramenta DOM Inspector para inspecionar o documento, reavaliando o conteúdo adicionado.</p> + </td> + </tr> + </tbody> +</table> + +<h3 id="O_que_vem_depois.3F" name="O_que_vem_depois.3F">O que vem depois?</h3> + +<p>Se você teve dificuldade para entender esta página, ou se você tem algum comentário sobre ela, por favor contribua nesta página de <a href="/Talk:pt/CSS/Como_come%C3%A7ar/XBL_bindings" title="Talk:pt/CSS/Como_começar/XBL_bindings">Discussão</a>.</p> + +<p>Nesta demonstração, o quadrado e o botão foram <em>widgets</em> independentes que funcionam com um documento HTML. Mozilla tem uma linguagem de marcação especializada para criação de interfaces de usuários. A próxima página demostra isto: <strong><a href="/pt/CSS/Como_come%C3%A7ar/Interfaces_de_usu%C3%A1rio_XUL" title="pt/CSS/Como_começar/Interfaces_de_usuário_XUL">Interfaces de usuário XUL</a></strong></p> + +<p>{{ PreviousNext("CSS:Como começar:JavaScript", "CSS:Como começar:Interfaces de usuário XUL") }}</p> + +<p><span class="comment">Categorias</span></p> + +<p><span class="comment">Interwiki Language Links</span></p> |