Customizing Dreamweaver MX Menus Using menus.xml

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter 20.  Extending Dreamweaver MX


Another integral part of Dreamweaver MX are the menu items. You navigate them to open files, copy text, insert commands, and view help all through the core drop-down menus that Dreamweaver MX contains. Like most software applications, everything that you could possibly insert, view, edit, or interact with are available through these drop-down menus. Unlike most software applications, Dreamweaver MX enables you to customize the menu items or subitems to meet your needs.

Because all the menus are generated from one XML-based file, you as the user have complete control to add, remove, and change keyboard shortcuts as well as rearrange, rename, and remove menu items.

Menus.xml Tag Syntax

Before you begin making any changes to the menus.xml file, it might be helpful to see how it is structured. XML, like HTML, is tag based, which means that for every opening tag, there must be a closing tag, although some tags simply close themselves by adding the "/" at the end. If you open the menus.xml file, located in Macromedia\Dreamweaver MX\Configuration\Menus, you will notice that it is very much structured like an HTML page but contains slightly different syntax. The reason for this is that it is XML. XML defines data, not how data should be structured, which is what HTML takes care of. By defining the data that menus should contain, Dreamweaver MX can, in turn, use the information to dynamically construct the menus whenever the application is loaded.

NOTE

Never open the menus.xml file in Dreamweaver MX; open it in a different text editor such as Notepad.


XML, unlike HTML, allows you to create your own tags, hence the reason for the custom tag syntax. Navigating the menus.xml file for the first time can be somewhat of a challenge. The following explanations should help to clear things up:

  • <menubar> Provides information about a menu bar in the Dreamweaver MX menu structure.

  • <menu> Provides information about a menu or submenu to appear in the Dreamweaver MX menu structure. This tag must reside within the <menubar> tag.

  • <menuitem> Defines a menu item for a Dreamweaver MX menu. The tag must reside within a menu tag.

  • <separator> Indicates that a separator should be present in the menu. This tag must reside within a <menu> tag.

  • <shortcutlist> Specifies a shortcut list in the menus.xml file. This tag will contain one or more <shortcut> tags.

  • <shortcut> Specifies a keyboard shortcut in the menus.xml. This tag must be contained within a <shortcutlist> tag.

With this knowledge, you should now be able to rearrange menu items.

Rearranging Menus and Menu Items

Editing the menus.xml file allows for great control over how your menus are structured. A lot of people, including myself, are used to working within environments that they are familiar with. When a new program comes out that deviates from the traditional File, Edit, View, structure, it becomes difficult to adapt. Fortunately with Dreamweaver MX, that can be changed. Modifying the menus.xml file enables you to move items within a menu or out of and into another menu, add or remove separators, and add menu bars and even move one menu into another menu.

NOTE

Before you make any modifications to the menus.xml file, you should make a copy of it as a backup.


To move a menu item, follow these steps:

  1. Open the menus.xml file in Notepad.

  2. Cut an entire menu item tag from the beginning to its closing tag, as shown in Figure 20.13.

    Figure 20.13. Cutting the "cut" and moving it below "copy" will change it in the IDE as well.

    graphics/20fig13.jpg

  3. Paste the menu item tag into its new insertion point, making sure that it is still nested within a menu tag.

  4. Restart Dreamweaver and check the menu that you pasted the menu tag into.

Changing the Name of a Menu or Menu Item

You can easily change the name of a menu or menu item by following these steps:

  1. Open the menus.xml file in Notepad.

  2. To change a menu item, simply change the name attribute.

  3. Save and close the file and restart Dreamweaver MX.

Changing Keyboard Shortcuts Using the Keyboard Shortcuts Editor

Possibly the easiest way to change shortcuts is by using the shortcuts editor, available from the Edit menu. Selecting this command launches the Keyboard Shortcuts editor pictured in Figure 20.14.

Figure 20.14. The easiest way to modify shortcuts is by launching the Keyboard Shortcuts editor from the Edit menu.

graphics/20fig14.jpg

The Keyboard Shortcuts editor contains a few important features that are worth mentioning:

  • Current Set Indicates the keyboard shortcuts sets that Dreamweaver MX supports.

  • Commands The commands allow you to choose from a specific menu bar. Notice that depending on which window you are in, the menu bar changes. Commands enable you to navigate between all of these.

  • Shortcuts Indicates the shortcut that the command is currently set to.

  • Press Key Place your cursor in this field and click the keyboard combination to change the keyboard shortcut.

To change a keyboard shortcut using the editor, follow these steps:

  1. Select the set from the Current Set selector. Default is Macromedia Standard.

  2. Select the command set that you would like to change.

  3. Select the shortcut from the shortcuts list.

  4. Place your cursor inside the Press Key field and select the shortcut that you would like to change it to.

  5. Select Change.


    Team-Fly    
    Top


    Macromedia Dreamweaver MX Unleashed
    Macromedia Dreamweaver MX 2004 Unleashed
    ISBN: 0672326310
    EAN: 2147483647
    Year: 2002
    Pages: 321

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net