Back to Radio Button Object
Up to Table of Contents
Ahead to Text Field Objects

Text Objects

Text objects allow you to display text in your applications. This can be a character, a word or multiple paragraphs of text. You may find it useful to create a small Text object that serves as a label for another object, such as a Graphic. Or, you may make the Text object much larger so that it displays a larger description of another object. Use the Text object tool to draw a Text object. The tool appears as follows:

Note: The user cannot type in a Text objects at runtime. If your application requires an area in which the user can type, use the Text Field object.

Text Object Appearance

There are two ways to enter text in a Text object. You can set the object's Filename property to an ASCII text (. txt) file. Or, you can set the object's Text property. When you click in the Value field for the Text property, Jamba displays the Text Properties dialog box where you can type in the characters you want to display. When you click on OK, the text is automatically returned to the Value field.

The Font property controls the character size and style used by the object and the TextColor and BackgroundColor properties control the colors. Optionally, you can use the DisplayEffect property to use a special effect when the object displays.

Interactivity

Although a user cannot type in a Text object, he or she can still interact with a Text object in several ways.

For more information on available events, see the section entitled "Text Object Properties, Methods, and Events."

Lesson: Text Objects as Popup Labels

In this lesson you set up a Graphic of Africa and a Push Button labeled "Show Labels." When the user clicks the button, two Text objects appear that identify the Tropic of Cancer and the Equator.

Note: A completed version of this lesson, called lesn_14, is located in the \Jamba\lessons directory.

First set up the Graphic object.

Next, you'll set up the two Text objects.

The Text Properties dialog box appears.

The text appears in the object. Next you'll make the object's background transparent and its text white, so that it appears to rest right on the Graphic when its over it. You'll also make the object invisible so that it is not seen when the page first displays.

Now you'll use the same techniques to set up Text2.

The Text Properties dialog box appears.

Now set up the Push Button.

Now you'll set up PushButton1's To Do List so that it affects the Text objects when the user clicks.

The default event is Click. Because you want the To Do List actions to occur when the user clicks, you'll leave the default as is.

When the user clicks on PushButton1, Text1 will become visible. Now do the same for Text2.

Keep in mind that if you wanted the text labels to show all the time, it would be more efficient to incorporate them into the graphic being displayed. Also, for instructions on how to make a Text object visible only when the cursor is over a particular object, see the lesson for the Hotspot object.

Lesson: Page Scrolling in Text Objects

In this lesson you use two Picture Push Buttons, and the Text object's PageUp() and PageDown() methods, to scroll through text in a Text object.

Note: A completed version of this lesson, called lesn_15, is located in the \Jamba\lessons directory.

The first object to set up is the Text object.

Your To Do list tab should look like this when you are done.

Now you will set up PicturePushButton2, which is the Page Down button.

  • Select PicturePushButton2.

  • Click in the Value field of the Name property and rename the object to PageDown.

  • Click in the Value field of the Filename property and select the \Jamba\lessons\Graphics\Down.gif graphic file.
  • Set the ButtonStyle property to UpDown.

    You will now set up this button so that when the user clicks on it, the contents of the Text1 object will move down one page.

    • Click on the to Do List tab.

    • Click on the New To Do Item button.

    • Select Text1 from the Object drop down list

    • Select PageDown() from the What To Do drop down list. Leave the Value field empty.

    • Save the file and run it to see it work.

    • To see an example of what the completed applet should look like, click on the start button.

      Text Object Properties, Methods, and Events

      Text objects support the following properties, methods and events.

      Properties Methods Events
      BackgroundColor MoveAndSize() Click
      DisplayEffect PageUp() Create
      Enabled PageDown() DoubleClick
      FileName ScrollDown() Enter
      Font ScrollEnd() Hide
      Height ScrollHome() Leave
      HowToHide ScrollUp() LoadComplete
      HowToShow SlideTo() Show
      Name
       
      SlideToComplete
      Text
       
       
      TextColor
       
       
      Transparent
       
       
      Visible
       
       
      Width
       
       
      X
       
       
      Y
       
       

      Back to Radio Button Object
      Up to Table of Contents
      Ahead to Text Field Objects