Part III Introduction (XForms (Forms Library) - Version 1.2 (Rev. 4) A Graphical User Interface Toolkit for X)

Next: Part III Static Objects, Previous: Part III, Up: Top [Contents][Index]

## 14 Introduction

This part describes all different object classes that are available in the Forms Library. All available object classes are summarized in a table below. For each class there is a section in this document that describes it. The section starts with a short description of the object, followed by the routine(s) to add it to a form. For (almost) all classes this routine has the same form

    FL_OBJECT *fl_add_CLASS(int type, FL_Coord x, FL_Coord y,
                            FL_Coord w, FL_Coord h, const char *label);

Here `type` is the type of the object in its class. Most classes have many different types. They are described in the section. `x`, `y`, `w` and `h` give the left upper corner and the width and height of the bounding box of the object. `label` is the label that is placed inside or next to the object. For each object class the default placement of the label is described. When the label starts with the character `@` the label is not printed but replaced by a symbol instead.

For each object class there is also a routine

    FL_OBJECT *fl_create_CLASS(int type, FL_Coord x, FL_Coord y,
                               FL_Coord w, FL_Coord h, const char *label);

that only creates the object but does not put it in the form. This routine is useful for building hierarchical object classes. The routine is not described in the following sections.

An important aspect of objects is how interaction is performed with them. First, there is the way in which the user interacts with the object, and second there’s the question under which circumstances an object changes its state and how this is returned to the application program. All this is described in detail in the following sections.

Object attributes can be divided into generic and object specific ones. For generic attributes (e.g., the object label size), the routines that change them always start with `fl_set_object_xxx()` where `xxx` is the name of the attribute. When a specific object is created and added to a form, it inherits many aspects of the generic object or initializes the object attributes to its needed defaults.

Object classes can be roughly divided into static object classes (Box, Frame, LabelFrame, Text, Bitmap, Pixmap, Clock and Chart), Buttons, valuator objects classes (Slider, Scrollbar, Dial, Positioner, Counter, Thumbwheel), Inputs, choice object classes (Menu, Choice, Browser), container object classes (Tabbed Folder, Form Browser, Menu bar) and, finally, other object classes (Timer, XYPlot, Canvas, Popup).

Box

  Rectangular areas to visually group objects.

Frame

  A box with an empty inside region.

LabelFrame

  A frame with label on the frame.

Text

  Simple one line labels.

Bitmap

  Displays an X11 bitmap.

Pixmap

  Displays a pixmap using the XPM library.

Clock

  A clock.

Chart

  Bar-charts, pie-charts, strip-charts, etc.

Button

  Many different kinds and types of buttons that the user can push.

Slider
ValSlider

  Both vertical and horizontal sliders to let the user indicate some float value, possibly with a field showing the currently set value.

Scrollbar

  Sliders plus two directional buttons.

Dial

  A dial to let the user indicate a float value.

Positioner

  Lets the user indicate an (x, y) position with the mouse.

Counter

  A different way to let a user step through values.

Thumbwheel

  Rolling a wheel to indicate float values.

Input

  Lets the user type in an input string.

Menu

  Both pop-up and drop-down menus can be created.

Choice

  Can be used to let the user make a choice from a set of items.

Browser

  A text browser with a slider. Can be used for making selections from sets of choices.

Folder

  A (tabbed) folder is a compound object capable of holding multiple groups of objects.

FormBrowser

  A browser you can drop forms into.

Timer

  A timer that runs from a set time towards 0. Can e.g., be used to do default actions after some time has elapsed.

XYPlot

  Shows simple 2D xy-plot from a tabulated function or a datafile. Data points can be interactively manipulated and retrieved.

Canvas

  Canvases are managed plain X windows. It differs from a raw application window only in the way its geometry is managed, not in the way various interaction is set up.

Popups

  Popup are mostly used by menus and choices, but they can also be used stand-alone to isplay context menus etc.

Thus, in the following sections, only the object specific routines are documented. Routines that set generic object attributes are documented in Part V.

When appropriate, the effect of certain (generic) attributes of the objects on the specific object is discussed. In particular, it is described what effect the routine `fl_set_object_color()` has on the appearance of the object. Also some remarks on possible boxtypes are made.

Next: Part III Static Objects, Previous: Part III, Up: Top [Contents][Index]