XML
  Home arrow XML arrow Page 3 - Overlays in XUL
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Overlays in XUL
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-05-15

    Table of Contents:
  • Overlays in XUL
  • Creating an overlay
  • Adjusting the overlay to your application
  • Creating a dynamic overlay

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Overlays in XUL - Adjusting the overlay to your application


    (Page 3 of 4 )

    If you use a locale with your application and read in things like menuitem labels, you should do the same with any overlays, so in this example, I should change the menu code within the overlay file to something like:

    <menuitem id="menuitem1" label="&newlabel1;"/>
    <menuitem id="menuitem1" label="&newlabel2;"/>
    <menuitem id="menuitem1" label="&newlabel3;"/>
    <menuitem id="menuitem1" label="&newlabel4;"/>

    Then create a new DTD file with the code:

    <!ENTITY newlabel1 "New item 1">
    <!ENTITY newlabel2 "New item 2">
    <!ENTITY newlabel3 "New item 3">
    <!ENTITY newlabel4 "New item 4">

    This DTD file should be saved with the name newmenuOverlay.dtd to match the overlay file and should be saved in your existing locale directory.  This way, you won’t have to register the new DTD file with the chrome either; although before it can be used, you’ll need to add the following DOCTYPE declaration to your newmenuOverlay.xul file:

    <!DOCTYPE overlay SYSTEM
    "chrome://interface/locale/newmenuOverlay.dtd">

    So now, any window that needs to contain this menu can simply have the statement that imports the overlay, and an ID matched menu element (or whatever element is being overlaid), and it can make use of the overlay file.  This is also the same means by which files can be taken from Mozilla itself to cut down on the amount of coding that is required.  You know that Mozilla is going to be installed on the end users system in order for XUL to work, so when creating XUL applications for deployment, you can rely on being able to borrow elements like these from Mozilla. 

    Overlays can also overlay other overlay files as well as JavaScript or CSS files, so when using Mozilla content in your own applications not only can you overlay the elements used to build the desired menus, you can also use overlays to import the functionality which can cut down massively on the amount of coding you need to do, especially when it comes to some of the complicated XPCOM interfaces that are required in order to build things like the file open/save functionality that is often required in applications.

    More XML Articles
    More By Dan Wellman


       · Hi,Overlays are an interesting and easy aspect of XUL to play around with, I...
     

    XML ARTICLES

    - Using Regions with XSL Formatting Objects
    - Using XSL Formatting Objects
    - More Schematron Features
    - Schematron Patterns and Validation
    - Using Schematron
    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek