source: trunk/third/wcl/Xmp/XmpTable.man @ 8837

Revision 8837, 20.9 KB checked in by ghudson, 28 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r8836, which included commits to RCS files with non-trunk default branches.
Line 
1.COMMENT SCCS_data: %Z% %M% %I% %E% %U%
2.TH "XmpTable" 3 "19 March 1993"
3.SH NAME
4XmpTable \- Motif Public Table Widget
5.SH SYNOPSIS
6.ta 1.5i 2.5i
7.nf
8.ft B
9In C++ or C:
10
11#include <X11/Intrinsic.h>
12#include <X11/Xmp/Table.h>
13
14Widget newTable = XtCreateWidget( name, xmpTableWidgetClass, pw, ... );
15Widget another = XmpCreateTable( pw, name, arglist, argcount );
16.fi
17.ft R
18.SH LINK BY
19.nf
20.ft B
21example% ld -o prog prog.o -lXmp -lXm <WclOption> -lXmu -lXt -lX11
22.ft R
23.fi
24.LP
25.I XmpTable
26does not require the use of Wcl, but the author obviously
27encourages its use ;^).  See
28.I Wcl(3)
29for usage and linking of Wcl.
30.SH DESCRIPTION
31.LP
32.I XmpTable
33is a manager widget which allows widgets to be arranged in a tabular
34form.  The
35.I XmpTable
36widget has a
37.B layout
38resource which is used to specify the column and row position of each
39child.  Children can span rows and/or columns.  Layout options
40are available to control the initial sizes, justification, and dynamic resizing
41of children.
42.LP
43Amazing as this may sound,
44.I XmpTable
45is internally fully object-oriented, but all methods and members of internal
46objects are in fact accessible to client applications.  Rather than
47being pedantic about "information hiding", the author tries to follow
48the principle that
49.I XmpTable
50is going to be used by programmers, and programmers sometimes need to
51do things the author did not foresee.  The structures and methods of
52the
53.I XmpTable
54and all of its component objects are declared in the
55.B TableP.h
56include file.  Some methods which some may find useful are
57.B XmpTableLocFindPosition()
58and
59.B XmpTableLocFind()
60which clients can use to find the location information for widgets at
61some specific location in an
62.I XmpTable,
63or for some specific widget in an
64.I XmpTable.
65.sp 1
66.SS "Classes"
67.I XmpTable
68inherits behavior and resources from \fBCore\fP, \fBComposite\fP,
69\fBConstraint\fP, \fBXmManager\fP, and \fBXmBulletinBoard\fP classes.
70.PP
71The class pointer is \fBxmpTableWidgetClass\fP.
72.PP
73The class name is \fBXmpTable\fP.
74.sp 1
75.SS "New Resources"
76The following table defines a set of widget resources used by the programmer
77to specify data.  The programmer can also set the resource values for the
78inherited classes to set attributes for this widget.  To reference a
79resource by name or by class in an application defaults file, remove the
80\fBXtN\fP or \fBXtC\fP prefix and use the remaining letters.
81
82The codes in the access column indicate if the given resource can be
83set at creation time (\fBC\fP),
84set by using \fBXtSetValues\fP (\fBS\fP),
85retrieved by using \fBXtGetValues\fP (\fBG\fP),
86or is not applicable (\fBN/A\fP).
87.nf
88
89XmpTable Resource Set
90Name              Class             Type         Default Access
91
92XtNlayout         XtCLayout         XmpTableLoc  NULL    CSG
93XtNdefaultOptions XtCDefaultOptions XmpTableOpts NULL    CSG
94XtNsameWidth      XtCSameSize       XrmName**    NULL    CSG
95XtNsameHeight     XtCSameSize       XrmName**    NULL    CSG
96XtNsameBorder     XtCSameSize       XrmName**    NULL    CSG
97XtNshrinkSimple   XtCShrinkSimple   Boolean      True    CSG
98XtNforceShrink    XtCForceShrink    Boolean      True    CSG
99XtNcolumnSpacing  XtCSpacing        int          0       CSG
100XtNrowSpacing     XtCSpacing        int          0       CSG
101.fi
102.IP "\fBXtNlayout\fP"
103Specifies the column, row, column span, row span, and options for each
104child.  The options field is optional, and takes the identical form of
105the \fBXtNdefaultOptions\fP resource discussed below.  If no options
106are specified for a child, that childs options will be the value of the
107\fBXtNdefaultOptions\fP resource when the child is first managed.
108Children which are not named in the layout specification are positioned
109in column 0, row 0, with colum and row spans of 1, and using the
110default options.  If the layout is changed after the
111.I XmpTable
112is created, then a complete re-layout is performed.  The internal type
113\fBXmpTableLoc\fP which must be passed to \fBXtCreateWidget()\fP or to
114\fBXtSetValues()\fP is obtained by passing a string representation of
115the layout specification to \fBXmpTableLocParse()\fP which will be
116discussed below.  A layout resource consists of one layout
117specification per named child, with each layout specification being
118separated (or terminated) by a ";" and with each layout specification
119of the form:
120.RS
121.RS
122.sp 2
123.nf
124\fB<name> <col> <row> [<opts>]\fP
125.fi
126.RE
127.RE
128.IP "\fBXtNdefaultOptions\fP"
129Specifies the layout options which apply to all children which do not
130have specific layout options in the child's layout specification.  The
131layout options allow a child widget to be justified within the table
132cell, and allow the initial size and dynamic resizing of children to be
133constrained.  Combinations of options can be used: \fBtr\fP means top
134and right, or north-east justification.  Note that the justification
135does not do anything special with labels of XmLabel widgets, or text in
136XmText widgets: it simply sets the positioning of the entire child
137widget within the cell of the
138.I XmpTable.
139The layout options consist of a series of adjacent case sensitive
140letters, each of which sets a layout option:
141.RS
142.RS
143.IP \fBl\fP
144left justify child in table cell.
145.IP \fBr\fP
146right justify child in table cell.
147.IP \fBt\fP
148top  justify child in table cell.
149.IP \fBb\fP
150bottom justify child in table cell.
151.IP \fBw\fP
152do not stretch width of column in which child is
153positioned during resizing.  Column width will remain wide enough to
154contain the widest child in the column.
155.IP \fBh\fP
156do not stretch height of row in which child is positioned
157during resizing.  Row height will remain high enough to contain the
158tallest child in the row.
159.IP \fBW\fP
160do not stretch width of child during resizing.  The width
161of the column may grow (unless constrained by \fBw\fP), and the child
162will be justified according to its layout options.
163.IP \fBH\fP
164do not stretch height of child during resizing.  The height
165of the row  may grow (unless constrained by \fBh\fP), and the child
166will be justified according to its layout options.
167.RE
168.RE
169.IP "\fBXtNsameWidth XtNsameHeight XtNsameBorder\fP"
170These three resources are used to specify the names of children
171of a Table which will be constrained to remain the same size as
172the table shrinks and grows, and when children are managed and
173unmanaged, and when children are allowed to resize.
174
175These three resources are often set together by using their common
176resource class \fBSameSize\fP in resource files.
177
178If you have been using \fBWcSameSize()\fP with limited success, you will
179probably like to use these resources instead.
180.IP "\fBXtNshrinkSimple\fP"
181Specifies if simple widgets (widgets which have NULL
182\fBquery_geometry\fP methods) should be forced smaller when the table
183widget is made smaller.  Such simple widgets will be forced to their
184original preferred sizes, but not smaller.  Widgets suffering from this
185malady in the \fBMotif\fP widget set include \fBXmArrowButton\fP,
186\fBXmArrowButtonGadget\fP, \fBXmDrawnButton\fP, \fBXmScale\fP,
187\fBXmScrollBar\fP, \fBXmSeparator\fP.  By default, this is \fBTrue\fP.
188Older versions of XmpTable did not provide this feature, and so setting
189this resource \fBFalse\fP will give the old behavior, which the author
190found obnoxious.
191.IP "\fBXtNforceShrink\fP"
192Specifies if widgets should be made smaller than their "preferred" sizes.
193The XmpTable widget tries to respect the preferred geometries of its children.
194This virtually always works when the table is initially created, but after
195widgets are managed, many
196widgets simply respond with their current sizes: this means when the Table is
197made larger, some children will claim they do not want to be made smaller.
198The difficulty arises because the vocabulary of the query geometry prototcol
199is somewhat limited.  Widgets which are locked using options including any of
200"whWH" will continue to be excluded from stretching, but others will be
201stretched and then can be shrunk back to their initial preferred sizes from
202the time they were last managed.  When the table is shrunk further, all
203children are shrunk an equal number of pixels until they are of size 1
204(the smallest legal size of a Widget).
205By default, this resource is \fBTrue\fP.
206Older versions of XmpTable did not provide this feature, and so setting
207this resource \fBFalse\fP will give the old behavior, which the author
208found obnoxious.
209.IP "\fBXtNcolumnSpacing\fP"
210Specifies the number of pixels between columns.
211.IP "\fBXtNrowSpacing\fP"
212Specifies the number of pixels between rows.
213.sp 1
214.SS "Inherited Resources"
215.I XmpTable
216inherits behavior and resources from the following
217superclasses.  For a complete description of each resource, refer to the
218man page for that superclass.
219.nf
220
221XmBulletinBoard Resource Set
222Name                Class              Type           Default      Access
223
224XmNallowOverlap     XmCAllowOverlap    Boolean        True         CSG
225XmNautoUnmanage     XmCAutoUnmanage    Boolean        True         CG
226XmNbuttonFontList   XmCButtonFontList  XmFontList     dynamic      CSG
227XmNcancelButton     XmCWidget          Window         NULL         SG
228XmNdefaultButton    XmCWidget          Window         NULL         SG
229XmNdefaultPosition  XmCDefaultPosition Boolean        True         CSG
230XmNdialogStyle      XmCDialogStyle     unsigned char  dynamic      CSG
231XmNdialogTitle      XmCDialogTitle     XmString       NULL         CSG
232XmNfocusCallback    XmCCallback        XtCallbackList NULL         C
233XmNlabelFontList    XmCLabelFontList   XmFontList     dynamic      CSG
234XmNmapCallback      XmCCallback        XtCallbackList NULL         C
235XmNmarginHeight     XmCMarginHeight    Dimension      10           CSG
236XmNmarginWidth      XmCMarginWidth     Dimension      10           CSG
237XmNnoResize         XmCNoResize        Boolean        False        CSG
238XmNresizePolicy     XmCResizePolicy    unsigned char  XmRESIZE_ANY CSG
239XmNshadowType       XmCShadowType      unsigned char  XmSHADOW_OUT CSG
240XmNtextFontList     XmCTextFontList    XmFontList     dynamic      CSG
241XmNtextTranslations XmCTranslations    XtTranslations NULL         C
242XmNunmapCallback    XmCCallback        XtCallbackList NULL         C
243.fi
244.nf
245
246XmManager Resource Set
247Name                  Class                 Type              Default Access
248
249XmNbottomShadowColor  XmCBottomShadowColor  Pixel             dynamic CSG
250XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
251XmNforeground         XmCForeground         Pixel             dynamic CSG
252XmNhelpCallback       XmCCallback           XtCallbackList    NULL    C
253XmNhighlightColor     XmCHighlightColor     Pixel             dynamic CSG
254XmNhighlightPixmap    XmCHighlightPixmap    Pixmap            dynamic CSG
255XmNnavigationType     XmCNavigationType     XmNavigationType XmTAB_GROUP CSG
256XmNshadowThickness    XmCShadowThickness    Dimension         dynamic CSG
257XmNstringDirection    XmCStringDirection    XmStringDirection dynamic CG
258XmNtopShadowColor     XmCBackgroundTopShadowColor Pixel       dynamic CSG
259XmNtopShadowPixmap    XmCTopShadowPixmap    Pixmap            dynamic CSG
260XmNtraversalOn        XmCTraversalOn        Boolean           True    CSG
261XmNuserData           XmCUserData           Pointer           NULL    CSG
262.fi
263.nf
264
265Composite Resource Set
266Name              Class              Type        Default Access
267
268XmNchildren       XmCReadOnly        WidgetList  NULL    G
269XmNinsertPosition XmCInsertPosition  (*)()       NULL    CSG
270XmNnumChildren    XmCReadOnly        Cardinal    0       G
271.fi
272.nf
273
274Core Resource Set
275Name                 Class                Type           Default Access
276
277XmNaccelerators      XmCAccelerators      XtAccelerators NULL    CSG
278XmNancestorSensitive XmCSensitive         Boolean        dynamic G
279XmNbackground        XmCBackground        Pixel          dynamic CSG
280XmNbackgroundPixmap  XmCPixmap            Pixmap  XmUNSPECIFIED_PIXMAP CSG
281XmNborderColor       XmCBorderColor       Pixel   XtDefaultForeground  CSG
282XmNborderPixmap      XmCPixmap            Pixmap  XmUNSPECIFIED_PIXMAP CSG
283XmNborderWidth       XmCBorderWidth       Dimension      0       CSG
284XmNcolormap          XmCColormap          Colormap       dynamic CG
285XmNdepth             XmCDepth             int            dynamic CG
286XmNdestroyCallback   XmCCallback          XtCallbackList NULL    C
287XmNheight            XmCHeight            Dimension      dynamic CSG
288XmNmappedWhenManaged XmCMappedWhenManaged Boolean        True    CSG
289XmNscreen            XmCScreen            Screen*        dynamic CG
290XmNsensitive         XmCSensitive         Boolean        True    CSG
291XmNtranslations      XmCTranslations      XtTranslations NULL    CSG
292XmNwidth             XmCWidth             Dimension      dynamic CSG
293XmNx                 XmCPosition          Position       0       CSG
294XmNy                 XmCPosition          Position       0       CSG
295.fi
296.SH SUPPORT PROCEDURES
297.LP
298.I XmpTable
299provides the following procedures and functions which can be used
300to create and manipulate
301.I XmpTables
302and the children of
303.I XmpTables:
304.nf
305.ft B
306
307XmpTableLoc XmpTableLocParse( char* layout );
308void XmpTableLocFree( XmpTableLoc toFree );
309XmpTableOpts XmpTableOptsParse( char* options );
310void XmpTableChildPosition( Widget child, int col, int row );
311void XmpTableChildResize( Widget child, int col_span, int row_span );
312void XmpTableChildOptions( Widget child, XmpTableOpts opts );
313void XmpTableChildConfig( Widget child,
314                          int col, int row, int col_span, int row_span,
315                          XmpTableOpts opts );
316Widget XmpCreateTable( Widget, char*, ArgList, Cardinal );
317Widget XmpCreateTableDialog( Widget, char*, ArgList, Cardinal );
318Widget XmpCreateTableTransient( Widget, char*, ArgList, Cardinal );
319.ft R
320.fi
321.LP
322Each of these routines can also be invoked from resource files, as the
323.B Xmp
324library procedure
325.B XmpRegisterMotif()
326registers the names of each of these procedures as both actions and
327callbacks with the
328.B Wcl
329string-to-callback converter and with the \fBXt Translation Manager\fP.
330These routines are discussed in more detail below.
331.IP "XmpTableLoc XmpTableLocParse( char* layout );"
332This function takes a string which specifies a layout resource for and
333.I XmpTable
334widget and returns an
335.B XmpTableLoc,
336a pointer to an opaque type, which can then passed to
337.B XtCreateWidget(),
338any of the
339.B XmpCreateTable
340constructors, or to
341.B XtSetValues().  The
342.I XmpTable
343copies the storage, and so the
344.B XmpTableLoc
345storage must be released by the client when no longer needed (often
346immediately after use) by passing the
347.B XmpTableLoc
348to
349.B XmpTableLocFree().
350.IP "void XmpTableLocFree( XmpTableLoc toFree );"
351This procedure releases the storage pointed to by the
352.B XmpTableLoc
353opaque pointer.
354.IP "XmpTableOpts XmpTableOptsParse( char* options );"
355This function parses the options specifier string into an
356.B XmpTableOpts
357which can then be passed to .B XtCreateWidget(),
358any of the
359.B XmpCreateTable
360constructors, or to
361.B XtSetValues().
362.B XmpTableOpts
363is typedef'd to a standard machine data type (currently an int),
364and so does not need to be free'd.
365.IP "void XmpTableChildPosition( Widget child, int col, int row );"
366This procedure allows a child of an
367.I XmpTable
368widget to be moved to a different cell.  If the child spans multiple
369columns and/or rows, the column and row indicates the upper left corner
370of the child widget.  The defaultLayout resource of the
371.I XmpTable
372is actually changed by this procedure, so the new location of the child
373will be remembered even if the child is unmanaged and re-managed.  The
374layout of the
375.I XmpTable
376is recomputed, which means all issues involved in the positioning and
377sizes of all children of the
378.I XmpTable
379are also re-analyzed.  For example, if the child widget has the option
380\fBW\fP specified, then the column to which the child widget is moved will
381then be prevented from becoming wider, and the column from which the
382child widget came may be enabled to be made wider.
383.IP "void XmpTableChildResize( Widget, int col_span, int row_span );"
384This procedure allows a child of an
385.I XmpTable
386widget to be resized so the child spans a different number of columns
387or rows.  Again, the layout of the
388.I XmpTable
389is recomputed, which means all issues involved in the positioning and
390sizes of all children of the
391.I XmpTable
392are re-analyzed.  For example, if the child widget has the option
393\fBW\fP specified, then all of the columns which the child widget spans
394will be prevented from becoming wider.
395.IP "void XmpTableChildOptions( Widget child, XmpTableOpts opts );"
396This procedure allows a child of an
397.I XmpTable
398widget to have its layout options changed.  Again, the layout of the
399.I XmpTable
400is recomputed, which means all issues involved in the positioning and
401sizes of all children of the
402.I XmpTable
403are re-analyzed.  For example, if the child widget has the option
404\fBW\fP specified, then all of the columns which the child widget spans
405will be prevented from becoming wider.
406.LP
407.nf
408void XmpTableChildConfig( Widget child,
409                          int col, int row,
410                          int col_span, int row_span,
411                          XmpTableOpts opts );
412.fi
413.IP
414This procedure allows a child of an
415.I XmpTable
416widget to have all of its layout specifications changed at once.
417.IP "Widget XmpCreateTable( Widget, char*, ArgList, Cardinal );"
418This function creates a new
419.I XmpTable
420widget.  The \fIWidget\fP argument specifies the parent widget ID, the
421\fIchar*\fP argument specifies the name of the created widget, the
422\fIArgList\fP argument specifies the argument list, and the
423\fICardinal\fP argument specifies the number of attribute/value pairs
424in the argument list.
425.IP "Widget XmpCreateTableDialog(Widget,char*,ArgList,Cardinal);"
426This function creates a new
427.I XmpTable
428widget as a child of a new
429.I XmDialogShell.
430The name of the new
431.I XmDialogShell
432has the same name as the new
433.I XmpTable
434but with the characters "_popup" concatenated to the end.  The
435\fIWidget\fP argument specifies the parent widget ID, the \fIchar*\fP
436argument specifies the name of the created \fIXmpTable\fP widget, the
437\fIArgList\fP argument specifies the argument list, and the
438\fICardinal\fP argument specifies the number of attribute/value pairs
439in the argument list.
440.IP "Widget XmpCreateTableTransient(Widget,char*,ArgList,Cardinal);"
441This is almost identical to \fIXmpCreateTableDialog()\fP except the
442shell widget is an \fIXtTransientShell\fP, with the \fIXtNtransientFor\fP
443resource set if it is available (after R4) and the related bug
444is fixed (still broken in early releases of R5).
445.SH TRANSLATIONS
446.LP
447.I XmpTable
448inherits translations from
449.B XmBulletinBoard.
450.SH ACTIONS AND CALLBACKS
451.LP
452The Xmp library provides the following callbacks and actions
453for manipulating children of
454XmpTable widgets:
455.LP
456.nf
457.ft B
458XmpTableChildConfig( widget col row [h_span [v_span [opts]]] )
459XmpTableChildPosition( widget col row )
460XmpTableChildResize( widget h_span v_span )
461XmpTableChildOptions( widget options )
462.ft R
463.fi
464.LP
465Each callback procedure can also be named in resource files as
466the name of the procedure followed by CB: i.e, XmpTableChildConfig()
467can also be invoked as a callback by giving the name XmpTableChildConfigCB()
468for a callback resource value.  Also, each action procedure can also
469be named by appending ACT to the procedure name.  Normally, I just use the
470procedure name, so it is less trouble to change behavior from callbacks
471to actions triggered by translations or accelerators, and vice versa.
472The CB and ACT endings are maintained for backward compatibility, and
473because some people like to be more explicit.  It is all a matter of taste.
474.LP
475Arguments to the procedures are provided as strings, the characters
476between the parenthesis following the procedure name.  If no parenthesis
477follow the procedure name, then a NULL string is passed to the procedure.
478Some procedures require arguments, some provide reasonable defaults when
479no arguments are given.  For example:
480.RS
481.LP
482.nf
483*foo.activateCallback:       XmpTableChildPosition( this 2 4 )
484.fi
485.RE
486.LP
487Each
488.I XmpTable
489callback and action procedure is discussed in detail below.
490.IP "XmpTableChildConfig( w col row [h_span [v_span [opts]]] )"
491This allows a child of an XmpTable to be moved to a new row or
492column, to be given a different horizontal or vertical span, and
493to change the justification and re-size options of the child.
494.IP "XmpTableChildPosition( w col row )"
495This allows a child of an XmpTable to be moved to a new row or
496column.
497.IP "XmpTableChildResize( w h_span v_span )"
498This allows a child of an XmpTable to be given a different horizontal
499or vertical span.
500.IP "XmpTableChildOptions( w options )"
501This allows a child of an XmpTable to be given new
502justification and re-size options.
503.SH "SEE ALSO"
504Xmp (3), Mri (1), Wcl (3), X (1), Core (3X), Composite (3X),
505Constraint (3X), XmBulletinBoard (3X).
506.SH BUGS
507.LP
508Sometimes, semi-intersecting sameWidth and sameHeight name lists
509do not work correctly during resizing.
510.SH AUTHORS
511David E. Smyth (David.Smyth@sniap.mchp.sni.de) at Siemens Nixdorf
512Informationssysteme AG, Munich Germany.  The original Table widget
513on which the external interface and many concepts of the
514.I XmpTable
515were derived was written by David Harrison in 1989 while he was
516at the University of California, Berkeley.
Note: See TracBrowser for help on using the repository browser.