PtComboBox

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

# `PtComboBox`

`PtComboBox` -- A text field and a list of choices.

## Synopsis

    class PtComboBox PtContainer
    {
        cbox_button_border_width;        // short  (Pt_ARG_CBOX_BUTTON_BORDER_WIDTH)
        cbox_button_bot_border_color;    // color  (Pt_ARG_CBOX_BUTTON_BOT_BORDER_COLOR)
        cbox_button_color;               // color  (Pt_ARG_CBOX_BUTTON_COLOR)
        cbox_button_top_border_color;    // color  (Pt_ARG_CBOX_BUTTON_TOP_BORDER_COLOR)
        cbox_button_width;               // unsigned short  (Pt_ARG_CBOX_BUTTON_WIDTH)
        cbox_flags;                      // flag  (Pt_ARG_CBOX_FLAGS)
        cbox_max_visible_count;          // unsigned short  (Pt_ARG_CBOX_MAX_VISIBLE_COUNT)
        cbox_sel_item;                   // unsigned short  (Pt_ARG_CBOX_SEL_ITEM)
    }

## Base Classes

`PtWidget` <-- `PtBasic` <-- `PtContainer` <-- `PtComboBox`

## Description

This widget combines a `PtText` widget with a `PtList` widget, and allows you to either enter a choice, or choose it from the list. The list can be either static or dropping, and you choose items by clicking on them with the mouse, or dragging down and releasing the mouse button. The list is scrollable if the number of items exceeds a specifiable maximum.

The first five instance variables for this widget are self-explanatory. The button they refer to is the drop button that activates the drop list.

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

## Instance Variables

cbox_button_border_width

  A number of pixels specifying the border width. Default is `2`.

cbox_button_bot_border_color

  A number specifying the color of the drop button's bottom border. Default is `0xffffff` (white).

cbox_button_color

  A number specifying the color of the drop button. Default is `0xc0c0c0` (grey).

cbox_button_top_border_color

  A number specifying the color of the drop button's top border. Default is `0x606060` (dark grey).

cbox_button_width

  A number of pixels specifying the width of the button. Default is `17`.

cbox_flags

  Flags that control the behavior of the widget.

  This instance variable may be a combination of zero or more of the following flags:

  Constant | Description
  --- | ---
  `Pt_COMBOBOX_STATIC` | Changes the field from drop (the default) to static, and removes the drop button.
  `Pt_COMBOBOX_TOP` | Changes the default location of a drop field from the bottom to the top of the text field.
  `Pt_COMBOBOX_MAX_WIDTH` | Maximizes the width of the box to the size of the longest item.
  `Pt_COMBOBOX_OPEN` | When set (1), the list is open.
  `Pt_COMBOBOX_ON_BOTTOM` | Internal informational bit.
  `Pt_COMBOBOX_EXTENTING` | Internal informational bit.

cbox_max_visible_count

  An integer specifying the maximum number of list items to display. If the number exceeds this maximum, a scrollbar will appear. If it is set to 0 (the default), all items will be displayed.

cbox_sel_item

  An index into the `items` variable that indicates the selected list item.

## Callbacks

The following callbacks are associated with this widget:

Callback | Description
--- | ---
`Pt_CB_CBOX_ACTIVATE` | This callback is generated when the combo box list is opened.
`Pt_CB_CBOX_CLOSE` | This callback is generated when the combo box list is closed.

| Since this class combines `PtList` and `PtText`, it inherits callbacks from both of those classes.

## Associated Classes

`PtList`, `PtText`

Prev | Home | Next
`PtClock` | Up | `PtContainer`

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