HyperActive Software Home


Converting a HyperCard stack to MetaCard


Table of Contents

(Partial listing:)

Notes about menus

How MetaCard menus work

A MetaCard menu consists of a set of popdown buttons, grouped together, and placed at the top of the card. The menu items that appear in each menu are just a return-delimited list stored in the button contents. The behavior of each menu is governed by the menu button's script.

On a Macintosh, if a menu group is not placed on a card, no stack menus appear in the Mac menu bar while that card is current. (There is one exception. It is possible to assign a default menu bar that appears when no other menu group is available. The default menu bar is only effective on Macs; if run on Windows, the stack will not have a menu on that card.) If a stack with no menus is run in development mode, MetaCard's developer menus will appear instead. If the stack does have a menu, then its own menus will replace the developer menus. In developer mode, the MetaCard menus can be accessed by bringing the message box, Home stack, or other native MetaCard stack to the front. There are other ways too, such as showing MetaCard's menus in a floating palette.

If a stack with no menus is run in player mode, the Mac menu bar will be empty except for the Apple and Help system menus.

On Windows machines, none of the above applies since there is no central menu bar. A card either has a menu or it doesn't. MetaCard's developer menus are displayed in a palette off to one side.

In MetaCard, double-clicking on a stack to launch MetaCard will launch the stack in player mode on any platform. There will be no menus unless the current card of the stack contains a menu group. If you should find yourself in the situation where you've double-clicked a stack without a menu bar, you can use the stack's close box to quit the program, since MetaCard automatically quits when the last stack is closed. But if your stack is in a window without a close box, you may have to force-quit.

MetaCard menus are objects that take up room at the top of a card. On Windows, this is standard; menus appear at the top of each window. When the same stack is run on a Macintosh, MetaCard pushes the top portion of the card above the top border of the window, out of view. The body of the window shortens to accomodate only that portion of the card that contains the actual stack content. The card is still technically the same height, but the part of the height that contains the menu group is hidden from view. MetaCard handles this window resizing transparently between platforms.

One thing for HyperCard users to remember is that what appears to be coordinates "0,0" on a Mac screen will really be more like "0,38", because the first 38 pixels contain the menu group hidden under the top of the window. Any scripts that work with card coordinates need to account for that.

When to create menus

When you are building stacks from scratch, the best time to create the menu bar is first. Because menus take up space at the top of the card, at least a basic group should be created before anything else. If the menu group isn't there from the beginning, you'll probably have to move all other card objects downward eventually to accomodate one later. Unless you plan to run the stack entirely in development mode at all times, you will need at least the basic File and Edit menus anyway.

Things change when you are converting HyperCard stacks to MetaCard, because the card objects are already placed and there is no room for an extra group of menu buttons at the top of the card. In most cases, the card must be made taller to accomodate a menu group, and all the existing objects need to be moved down to a lower portion of the card underneath it. This can be done with a script, and we'll walk through it in the next step of the tutorial.

Editing menus or other groups

Since the menu bar is just a group of buttons, any single menu is edited just as any other button is. They are in a group, so going into background editing mode is a good way to access them. While in background mode, you can also adjust their size, spacing, or other physical attributes if you don't like MetaCard's defaults. Of course, their appearance is immaterial on a Mac because the user will never see the actual buttons; they are instead turned into a real Mac menu bar at the top of the screen, and appear in the system font. On Windows, the buttons will be visible and the user will see them. MetaCard's default menu group is slightly taller than a standard Windows menu bar; you may want to make it shorter, but the defaults will work too.

MetaCard offers a global property called selectGroupedControls, which by default is false. You can set it to true in the message box (Runtime Revolution offers a clickable setting to toggle this property.) If selectGroupedControls is true, then you can edit objects in a group without going into background mode. Clicking on an object while selectGroupedControls is true will select the object itself rather than the group containing it.

Because this tutorial is for HyperCard users who are used to editing in background mode, we will usually suggest that method -- but feel free to try selectGroupedControls too, which is much easier most of the time.

Getting into background mode: If you do not need to adjust the physical size or position of background objects, it is often easier to access their properties by using the Control Browser under the Tools menu. If you do want to get into background editing mode: choose "Backgrounds..." from the Edit menu, select the group you want to edit, and click "Edit". To leave background editing mode, choose "Stop Editing BG" from the Edit menu.

The special Help menu

All Macintosh and Windows menu bars contain a Help menu. MetaCard handles this menu button slightly differently than others. In order to function correctly, the Help button must be the highest-layered button in the menu group; that is, it must be the last button created in that group.

The last item in the Help menu must be the "About" item, and the item before that one must be a divider line (indicated by a hyphen in the button contents.) If this convention is followed, MetaCard will automatically place the About menu item into the first position in the Apple menu on Macintosh computers; it leaves it in its normal position under the Help menu on Windows. MetaCard handles this cross-platform issue for you. Any menu bar created by the Menu Builder tool will create these items in the proper position by default. All you need to do is add the appropriate scripts, which this tutorial will show you how to do.

MetaCard menu control characters

There are several punctuation markers you can add to menu items to control the appearance and behavior of menu items, but the two that most concern us here are these:

  • An ampersand (&) character before a letter will display that letter with an underline on a Windows machine. Windows users use these letters to select menus and menu items from the keyboard.
  • A slash (/) character after a menu item, followed by a letter, will display that letter as a Command-key equivalent on a Mac, or a Control-key equivalent on Windows.

Keep these symbols in mind when creating and editing menu items in the next section of the tutorial, for you will see them in the Menu Builder tool we will use.



Up to top | Converting Stacks to MetaCard - TOC | Next Page


Developer ResourcesHome

 

HorizontalBar

Contact us 5226 West Nokomis Pky, Minneapolis MN 55417


 

 

 

 

All contents copyright (C) 1996, HyperActive Software. All rights reserved.
Revised: December 3, 2001
URL: http://www.hyperactivesw.com/mctutorial/tutorialtoc.html