PtDivider

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

# `PtDivider`

`PtDivider` -- A container with re-sizable rows or columns.

## Synopsis

    class PtDivider PtContainer
    {
        divider_flags;     // flag  (Pt_ARG_DIVIDER_FLAGS)
        divider_offset;    // short  (Pt_ARG_DIVIDER_OFFSET)
        divider_sizes;     // PhPoint array  (Pt_ARG_DIVIDER_SIZES)
    }

## Base Classes

`PtWidget` <-- `PtBasic` <-- `PtContainer` <-- `PtDivider`

## Description

This widget is a container that makes adjustable rows or columns out of its child widgets, such as `PtButtons` or `PtPanes`. Its instance variables let you control how or whether the children get resized, and to find their relative positions.

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

## Instance Variables

divider_flags

  This instance variable specifies divider characteristics, and may be a combination of zero or more of the following flags:

  Constant | Description
  --- | ---
  `Pt_DIVIDER_NORESIZE` | Generates the callback without resizing children.
  `Pt_DIVIDER_RESIZE_BOTH` | ON, the default, resizes the widgets on either side of the handle. OFF moves the immediately right (or bottom) children and resizes the immediately left (or top) child and the far right (or bottom) child.
  `Pt_DIVIDER_INVISIBLE` | Hides the drag outline. Used with `Pt_DIVIDER_NORESIZE`.
  `Pt_DIVIDER_CASCADE` | Internal informational bit.

divider_offset

  An integer specifying how much to offset the `PtPoints` in the `divider_sizes` array in both the x and y directions. This is used to modify the `divider_sizes` array, but has no effect on the positioning of the children of the `PtDivider`.

divider_sizes

  A read-only array of `PhPoints` indicating the top left-hand corner of each child of the `PtDivider`.

## Callbacks

The following callbacks are associated with this widget:

Callback | Description
--- | ---
`Pt_CB_DIVIDER_DRAG` | This callback is generated after each drag event the widget receives.
`Pt_CB_DIVIDER_SETRESOURCES` | This callback is generated when the divider resources are set.

## Associated Classes

`PtDividerCallback`, `PtCallbackInfo`

## Example

This example, `ex_PtDivider.g`, is included in the `gamma_ph_`#`_examples_1_QNX4.tgz` file available on the Cogent Web Site.

    #!/usr/cogent/bin/phgamma

    /*
     * This example loads a PtDivider that holds three
     * buttons arranged vertically.
     */
    require_lisp("PhotonWidgets.lsp");
    require_lisp("PhabTemplate.lsp");
    PtInit(nil);

    wfile = PhabReadWidgetFile ("WidgetFiles/wgt/divider.wgtw");
    window = PhabCreateWidgets(wfile, nil, nil);

    win = PhabLookupWidget(window,#divider,nil);
    div = PhabLookupWidget(window,#MainDivider,nil);

    /*
     * Demonstrate no resizing. To prevent resizing, uncomment the
     * following line.
     */
    //div.divider_flags = Pt_DIVIDER_NORESIZE | Pt_DIVIDER_INVISIBLE;

    PtRealizeWidget(win);

    /*
     * Assign an offset, and then print the offset and sizes.
     */
    div.divider_offset = -10;
    pretty_princ("Offset: ",div.divider_offset,"\n");
    pretty_princ("Sizes: ",div.divider_sizes,"\n");

    PtMainLoop();

Prev | Home | Next
`PtDBContainer` | Up | `PtEllipse`

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