HyperActive Software

Home What's New Who We Are What We Do Solutions Resources

We make software for humans. Custom Mac, Windows, iOS and Android solutions in HyperCard, MetaCard, and RunRev LiveCode


Converting a HyperCard stack to LiveCode

Tips Card

Click on the Tips button to go to the Tips card. There is only one alteration we need to make here. You'll want to resize the Print Text button with the edit tool to make it a few pixels higher, since LiveCode draws shadow buttons differently than HyperCard. The Print Text button script needs revision too. It contains two print card field instructions, which we need to change to use the revPrintField script supplied by LiveCode. Option-Cmd-hover over the Print Text button to open its script.

The revPrintField handler exists in a script library in the LiveCode environment, and accepts one parameter, the name of a field:

revPrintField SourceField
In LiveCode, the long ID supplies the entire path to an object, whereas the short ID supplies only the ID number. Since the revPrintField handler is located in another stack, we need to supply the long ID so that the handler can find it. Change the script so it looks like this:
on mouseUp
  if the hilite of card button "RadioButton1" is true then
    answer "Print" &&quote& "How to get the most from tech support" \
        &quote& "?" with "Cancel" or "Print"
    if it is "Print" then
      revPrintField (the long ID of cd fld "TipsField1")
    end if
    answer "Print" &&quote& "What to do if tech support is not available" \
         &quote& "?" with "Cancel" or "Print"
    if it is "Print" then
      revPrintField (the long ID of cd fld "TipsField2")
    end if
  end if
end mouseUp

Save the script. That's the only change to this card.

Timer Cards

Choose the browse tool and click on the Timer button to go to the Timer card. The first Timer card needs no alteration. After a moment, the timer will appear to flip open and you will be on the second Timer card where the real business takes place.

We need to adjust the timer's numbers field, named "Elapsed Time", so it displays correctly. The field is covered by two transparent buttons. The first contains a script that "closes" the timer, and the one underneath it is a hilited button that causes the "Elapsed Time" field to display in reversed type -- that is, white text on a black background. LiveCode supports colored text in fields, so we no longer need the hilited button that is sandwiched in the middle. (The button may have lost its hilite during import; if so, it will be transparent.)

Using the edit tool, move the top transparent button away from the "Elapsed Time" field temporarily. Click on the second transparent button that covers the number display and delete it.

Now click on the numbers field and resize it so that it exactly covers the entire white area of the number display (abut the right and bottom edges of the field even with the "bevel" line.) Double-click the field to see the Field Properties palette, turn off the 3D checkbox and turn on the Opaque checkbox. Click the Field tab in the Properties palette and turn on Fixed Line Height. Close the Properties palette.

Since LiveCode allows colored text in fields, we'll set the timer text to green instead of white, to make it look more like a digital clock.

With the field still selected, click the Colors button in the tool bar. In the Color Palette, click on Background Color and select black as the color (the square in the upper left corner.) Now switch over to the Name tab in the Colors palette (it looks like a list.) This tab allows you to set colors using LiveCode's pre-defined color names. Click on Foreground Color and scroll down the names list to select "Green2". Close the Colors window.

Drag the original cover button back to its position over the top of the timer. Choose the browse tool and save the stack to disk.

Help Card

The Help card works fine as it is. No changes are needed.

Adjusting the backgrounds

On a Macintosh, where the default background color is grey, the white areas of the stack look different than they did in HyperCard but are still basically acceptable. But if you have looked at the stack on a Windows machine yet, you'll see that every card has taken on the system color scheme and all the white areas are now colored. We need to set some background properties so that our cards are both opaque and white.

Use the Application Browser to select the first background group (ID 13656) and click the Inspector button in LiveCode's toolbar to edit its properties. In this window, check the Opaque checkbox. Choose Colors and Patterns from the popup button. In this pane, click on the Background Color box and use the color picker to set the color to white. (You may need to choose the browse tool again to see the changes.)

You can leave the palette windows open, and click on the "Records" group in the Application Browser to to edit its properties. Repeat the above process, setting the background group "Records" to opaque and white. Do it once more for the "Tabbed Background" group. Those are the only three background groups we need to set. When you are done, choose the browse tool and save the stack to disk.

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