PtLabel

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

# `PtLabel`

`PtLabel` -- A label that displays text, bitmaps, or images.

## Synopsis

    class PtLabel PtBasic
    {
        accel_key;               // string  (Pt_ARG_ACCEL_KEY)
        balloon_color;           // color  (Pt_ARG_BALLOON_COLOR)
        balloon_fill_color;      // color  (Pt_ARG_BALLOON_FILL_COLOR)
        balloon_position;        // short  (Pt_ARG_BALLOON_POSITION)
        horizontal_alignment;    // unsigned char  (Pt_ARG_HORIZONTAL_ALIGNMENT)
        label_data;              // PhImage  (Pt_ARG_LABEL_DATA)
        label_flags;             // flag  (Pt_ARG_LABEL_FLAGS)
        label_type;              // char  (Pt_ARG_LABEL_TYPE)
        line_spacing;            // unsigned short  (Pt_ARG_LINE_SPACING)
        margin_bottom;           // unsigned short  (Pt_ARG_MARGIN_BOTTOM)
        margin_left;             // unsigned short  (Pt_ARG_MARGIN_LEFT)
        margin_right;            // unsigned short  (Pt_ARG_MARGIN_RIGHT)
        margin_top;              // unsigned short  (Pt_ARG_MARGIN_TOP)
        select_shift;            // unsigned short  (Pt_ARG_SELECT_SHIFT)
        text_font;               // string  (Pt_ARG_TEXT_FONT)
        text_string;             // string  (Pt_ARG_TEXT_STRING)
        underline1;              // color  (Pt_ARG_UNDERLINE1)
        underline2;              // color  (Pt_ARG_UNDERLINE2)
        underline_type;          // unsigned short  (Pt_ARG_UNDERLINE_TYPE)
        vertical_alignment;      // unsigned char  (Pt_ARG_VERTICAL_ALIGNMENT)
    }

## Base Classes

`PtWidget` <-- `PtBasic` <-- `PtLabel`

## Derived Classes

`PtButton`, `PtMenuLabel`, `PtText`, `PtToggleButton`

## Description

This widget is a label that can hold text, bitmaps, or images, and has an optional pop-up text balloon. Labels can be used to identify widgets and data entry fields, make icons, or put pictures into your applications.

| For detailed information, please refer to PtLabel in the Photon documentation.

## Instance Variables

accel_key

  A string specifying a character to use as an accelerator key or hot key.

balloon_color

  A number specifying the color for pop-up balloon text. Default is `0x0` (black).

balloon_fill_color

  A number specifying the color for the pop-up balloon background. Default is `0xfeffb1` (yellow).

balloon_position

  This instance variable specifies the position of the pop-up balloon, and may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_BALLOON_RIGHT` | Right
  `Pt_BALLOON_LEFT` | Left
  `Pt_BALLOON_TOP` | Top
  `Pt_BALLOON_BOTTOM` | Bottom
  `Pt_BALLOON_INPLACE` | In Place

horizontal_alignment

  This instance variable specifies the horizontal alignment of the label text, and may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_RIGHT` | Align the label text to the right.
  `Pt_LEFT` | Align the label text to the left.
  `Pt_CENTER` | Center the label text horizontally.

label_data

  A `PhImage` displayed by the label if the `label_type` is set to `Pt_IMAGE`.

label_flags

  This instance variable controls the appearance and behavior of the widget, and may be a combination of zero or more of the following flags:

  Constant | Description
  --- | ---
  `Pt_LABEL_SELECT_SHIFT` | Cause the content of the widget to shift down and right when the widget is selected.
  `Pt_SHOW_BALLOON` | Cause balloon help to pop up on the widget if the cursor is left stationary over the widget for 1.25 seconds.
  `Pt_BALLOON_AS_REQUIRED` | Only show balloon help if it is different from the visible content of the widget.
  `Pt_BACKFILL_TEXT` | Cause the widget to fill the text rectangle with the background color before rendering the text.
  `Pt_BALLOON_REGISTERED` | Internal informational bit.

label_type

  This instance variable specifies the type of label, and may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_Z_STRING` | Display text using the `text_string` variable.
  `Pt_BITMAP` | Bitmap
  `Pt_IMAGE` | Display a `PhImage` using the `label_data` variable.
  `Pt_TEXT_IMAGE` | Display text and an image, positioned by the `balloon_position` variable.

line_spacing

  A number of pixels to put between lines of text for extra space.

margin_bottom, margin_left, margin_right, margin_top

  A number of pixels on the bottom, left, right, and top between the text and the edge of the label for margins.

select_shift

  This instance variable is deprecated. Set the `Pt_LABEL_SELECT_SHIFT` flag in `label_flags` instead.

text_font

  A string specifying the font used for label text.

text_string

  The string used for the label text string if the `label_type` is set to `Pt_Z_STRING` or `Pt_TEXT_IMAGE`.

underline1

  A number specifying the color for the first underline. Default is `0x0` (black).

underline2

  A number specifying the color for the second underline, which is just below the first underline. Making the two the same color creates a thick underline. Default is `0xffffffff` (transparent).

underline_type

  A constant that specifies the type of underline for the text. For single or double underlines, the underline colors are specified using `underline1` and `underline2` (above). Etched underlines use the colors of the widget's `top_border_color` and `bot_border_color`.

  This instance variable may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_NO_ULINE` | Text is not underlined.
  `Pt_SINGLE_ULINE` | Text gets a singe underline.
  `Pt_DOUBLE_ULINE` | Text gets a double underline.
  `Pt_ULINE_ETCHED_IN` | The underline gets an 'etched-in' appearance.
  `Pt_ULINE_ETCHED_OUT` | The underline gets an 'etched-out' appearance.

vertical_alignment

  This instance variable determines the vertical alignment of the text string, and may have one of the following values:

  Constant | Description
  --- | ---
  `Pt_BOTTOM` | Align the label text to the bottom.
  `Pt_TOP` | Align the label text to the top.
  `Pt_CENTER` | Center the label text vertically.

Prev | Home | Next
`PtIcon` | Up | `PtLed`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.