
Rebuilding the Demo Host Software
A-12
A.4.4
Drawing Screen Controls (Widgets)
Since we don’t use a graphical editor to draw the host-side application
widgets, we lay them out within the script in a recipe-like fashion. For our
application window (the "shell"), the script says which groups of widgets
are drawn next to, below, or within others.
A "widget" is a common name for a single element like a button, text field,
label, drop-down box, or a container for other widgets.
Containers are special because they can contain other widgets—both
simple elements and other containers. This application uses two kinds of
containers: "Groups" and "Composites". The difference between these is
that Groups have visible frames around the widgets they contain, while
Composites have no visible frames.
Another thing to know about containers is that a "grid" layout specify how
widgets inside them are laid out. Grids are matrices (including matrices
with only one row or column) in which each grid cell contains a widget
(including container widgets).
Each grid cell can be aligned left, right, or centered. A cell’s width or
height can also be controlled, but we usually don't have to. If we set the
width of a widget in pixels, the grid's column width adapts automatically
to match the widest element in the column. Also, if the widget size isn’t
specified, it adapts to the size needed to display its text.
A number of other properties of containers (for example, "margin width",
"vertical spacing", and "make all columns equal width") are available to
create professional-looking applications.
Here is an example. If you run the host-side application, the "Connection"
frame contains several buttons and text fields, one drop-down list (called
a "combo box"), and a few labels:
Содержание TMS320DM6437
Страница 1: ...TMS320DM6437 DVDP Getting Started Guide Literature Number SPRUEV6 July 2007 ...
Страница 20: ...2 8 ...
Страница 34: ...3 14 ...
Страница 40: ...4 6 ...
Страница 63: ......
Страница 64: ...Spectrum Digital Inc 509108 0001B ...