Creating a Menu Area

The initial DiveTab script is a menu area with buttons that point to any of the other area and page types. You can add menu area buttons to any script, but, usually, menu area buttons are in the main.divetab script that is the landing page for your DiveTab application. The following procedure adds another menu area to the script. This procedure assumes that you created an initial DiveTab script.

NOTE: The GUI refers to DiveTab scripts as modules.

NOTE: Icon and banner are optional. If you want to include images or banners, the files must be in the project, typically in the /divetab/images folder.

To create menu areas within an existing script:

  1. In Workbench Explorer, double-click the script where you want to add a menu area button, or right-click the script and select Open with > Mobile Module Editor.

    The script opens in the GUI editor.

  2. Click the Add new item button (green plus sign) and, from the context menu, select ClosedNew Area > Menu Area.

    Menu Area Command

    A new ClosedUntitled Area button is added to the page as shown.

    New Menu Area Button

    Notice the additional button commands that appear when you move the mouse over the button. From these commands, you can:

    • Remove the button
    • Move the button to the left or right
    • Go to the area within the script
    • Insert a new button
  3. Open the new menu area to edit the properties. You can do one of the following:

    • Double-click the button.
    • Click the Go to Area button that appears when the mouse is positioned over the button.
    • With the button selected, click the Click here to edit Area bar under the Button Properties pane on the right.
  4. Edit the menu area button properties that appear on the right side of the screen. Here is an example of the Closedbutton properties.

    Menu Area Properties

    • Id—Replace the default menu-area-# with a meaningful identifier. Area IDs are used for internal referencing.
    • Title—(Optional) Enter the text that appears on the button face and the title for the page that it opens. You can use the <br> tag in this field to set a line break for long titles. The button shows two lines of text.
    • Icon—(Optional) Select the icon to appear on the button. Click the browse button (...) to navigate to the icon file.
    • Retina Icon—(Optional) Select the retina icon to appear on the button for retina displays. Click the browse button (...) to navigate to the icon file.

    NOTE: (Optional) You can also add a banner for this menu area. Click the link Click here to add a banner at the top of the page and navigate to the banner file.

  5. Save the script.

    An empty Closedmenu area is created. You can now populate this menu area with additional buttons using any of the area types. Follow Steps 6 through 9 to add a document area to the menu area for testing.

    Completed Menu Area

  6. In a menu area, click the Add new item button (green plus sign) and, from the context menu, select ClosedNew Area > Document Area.

    Context menu for creating a new Document area.

    A new ClosedUntitled Area button is added to the page as shown.

    New Document Area Button

  7. Open the new area to edit it. You can do one of the following:

    • Double-click the button.
    • Click the Go to Area button that appears when the mouse is positioned over the button.
    • With the button selected, click the Click here to edit Area bar under the Button Properties pane on the right.
  8. Edit the Closedmenu area button properties that appear on the right side of the screen.

    Document Area Properties

    • Id—Replace the default document-area-# with a meaningful identifier. Area IDs are used for internal referencing.
    • Title—(Optional) Enter the text that appears on the button face and the title for the page it opens. You can use the <br> tag in this field to set a line break for long titles.
    • Icon—(Optional) Select the icon to appear on the button. Click the browse button (...) to navigate to the icon file.
    • Path—Select the location of the document, which can be in a project folder or a repository. Click the browse button (...) to navigate to a document contained in the project.
    • Repository—(Optional) If stored in a repository, enter the name of the repository that the document is stored in.
    • Retina Icon—(Optional) Select the retina icon to appear on the button for retina displays. Click the browse button (...) to navigate to the icon file.

  9. Save the file. A Closedpreview of the document appears.

    The completed Document Area.

As you add buttons to this menu area, you should check that all is working as expected in the end-user application.

The DiveTab user experience for this simple example is the following:

  1. Open the DiveTab application and Sync to display the Closedlanding page.

    End-User Landing Page with One Menu Area

  2. Tap or click the Example Menu Area button to display the Closedmenu area that you just created. Notice that this menu page contains one document area.

    End-User Result Menu Area

These steps produce an underlying script. If you prefer, you can work directly within the script. To view and edit the script, right-click the file and click Open with > Text Editor.

Here is how this example Closedappears in the script.

divetab version = "0.0" { 
  
  menu-area id = "menu-area-1" { 
    banner "/divetab/images/banners/doc-banner-landscape.png" orientation = "landscape" retina = false 
    banner "/divetab/images/banners/doc-banner-portrait.png" orientation = "portrait" retina = false 
    title "Main Menu" 
    icon "/divetab/images/menu icons/11.png" 
    area id = "menu-area-2" 
  } 
  
  areas { 
    menu-area id = "menu-area-2" { 
      title "Example Menu Area" 
      icon "/divetab/images/menu icons/12.png" 
      icon "/divetab/images/menu icon/12.png" retina = true 
      area id = "document-area-1" 
    } 
    document-area id = "document-area-1" { 
      path "/divetab/documents/DiveTabUserGuidePC16.pdf" 
      title "DiveTab PC User Guide" 
      icon "/divetab/images/menu icons/55.png" 
    } 
  } 
} 

See also: