Paned widget

Application Header file <Xraw/Paned.h>
Class Header file <Xraw/PanedP.h>
Class panedWidgetClass
Class Name Paned
Superclass Container --> Constraint --> Composit --> Core

Table of Contents


      The Paned widget manages children in a vertically or horizontally tiled fashion. The panes may be dynamically resized by the user by using the grips that appear near the right or bottom edge of the border between two panes. The Paned widget may accept any widget class as a pane except Grip. Grip widgets have a special meaning for the Paned widget, and adding a Grip as its own pane will confuse the Paned widget.

Paned Face

Using the Paned widget

    The grips allow the panes to be resized by the user. The semantics of how these panes resize is somewhat complicated, and warrants further explanation here. When the mouse pointer is positioned on a grip and pressed, an arrow is displayed that indicates the pane that is to be to be resized. While keeping the mouse button down, the user can move the grip up and down (or left and right). This, in turn, changes the size of the pane. The size of the Paned widget will not change. Instead, it chooses another pane (or panes) to resize. For more details on which pane it chooses to resize, see New Resources
Name Class Type Notes Default Value
betweenCursor Cursor Cursor CSG Depends on orientation
cursor Cursor Cursor CSG None
gripCursor Cursor Cursor CSG Depends on orientation
gripIndent GripIndent Position CSG 10
gripTranslations Translations TranslationTable CG see below
horizontalBetweenCursor Cursor Cursor CG sb_up_arrow
horizontalGripCursor Cursor Cursor CSG sb_h_double_arrow
internalBorderWidth BorderWidth Dimension CSG 6 (it was 1)
leftCursor Cursor Cursor CG sb_left_arrow
lowerCursor Cursor Cursor CG sb_down_arrow
orientation Orientation Orientation CG XtorientVertical
rightCursor Cursor Cursor CG sb_right_arrow
upperCursor Cursor Cursor CG sb_up_arrow
verticalBetweenCursor Cursor Cursor CG sb_left_arrow
verticalGripCursor Cursor Cursor CSG sb_v_double_arrow
New Xraw resources
hSpace HSpace Dimension CSG 0
vSpace VSpace Dimension CSG 0
Obsolete resources
internalBorderColor BorderColor Pixel CSG XtDefaultForeground
refigureMode Boolean Boolean CG True

betweenCursor If this resource is not None then this cursor to be used for the grip when changing the boundary between two panes for both vertical and horizontal orientations.
If this resource is None then horizontalBetweenCursor and verticalBetweenCursor to be used depend on orientation.
cursor The cursor to use when the mouse pointer is over the Paned widget, but not in any of its children (children may also inherit this cursor). It should be noted that the internal borders are actually part of the Paned widget, not the children.
gripCursor The cursor to use when the grips are not active. The default value is verticalGripCursor or horizontalGripCursor depending on the orientation of the Paned widget.
gripIndent The amount of space left between the right (or bottom) edge of the Paned widget and all the grips.
gripTranslation Translation table that will be applied to all grips.
horizontalBetweenCursor
verticalBetweenCursor
If betweenCursor is not set to None than this cursor to be used for the grip when changing the boundary between two panes. These resources allow the cursors to be different depending on the orientation of the Paned widget.
horizontalGripCursor
verticalGripCursor
The cursor to be used for the grips when they are not active. These resources allow the cursors to be different depending on the orientation of the Paned widget.
internalBorderColor This resource is obsolete in Xraw.
internalBorderWidth The width of the internal borders. This is the amount of space left between the panes. The class name of this resource allows Paned*BorderWidth: 3 to set the internal border width for the Paned widget.
leftCursor
rightCursor
The cursor used to indicate which is the important pane to resize when the Paned widget is oriented horizontally.
lowerCursor
upperCursor
The cursor used to indicate which is the important pane to resize when the Paned widget is oriented vertically. This is not the same as the number of panes, since this also contains a grip for some of the panes, use XawPanedGetNumSub to retrieve the number of panes.
orientation The orientation to stack the panes. This resource cannot be changed after widget have been created. This value can be either XtorientVertical or XtorientHorizontal.
In resource file it must be
Paned*Orientation:vertical or
Paned*Orientation:horizontal.
refigureMode This resource is obsolete in Xraw. Use convenience routine XawPanedSetRefigureMode() to control layout of panes.

hSpace
vSpace
The amount of space, in pixels, to leave between edge of Paned widget and corresponding edge of virtual layout box.


New Constraint Resources

Name Class Type Notes Default Value
allowResize Boolean Boolean CG False
max Max Dimension CG Infinity
min Min Dimension CG Height of Grips
preferredPaneSize PreferredPaneSize Dimension CG ask child
resizeToPreferred Boolean Boolean CG False
showGrip ShowGrip Boolean CG True
skipAdjust Boolean Boolean CG False
allowResize If this value is False the the Paned widget will disallow all geometry requests from this child.
max
min
The absolute maximum or minimum size for this pane. These values will never be overridden by the Paned widget. This may cause some panes to be pushed off the bottom (or right) edge of the paned widget.
preferredPaneSize Normally the paned widget makes a QueryGeometry call on a child to determine the preferred size of the child's pane. There are times when the application programmer or the user has a better idea of the preferred size of a pane. Setting this resource causes the value passed to be interpreted as the preferred size, in pixels, of this pane.
resizeToPreferred Determines whether or not to resize each pane to its preferred size when the Paned widget is resized. See Layout Semantics for details.

Inherited Resources

Container class resources
Name Class Type Notes Default Value
bottomShadowPixel BottomShadowPixel Pixel CSG Dinamic
bottomShadowPixmap BottomShadowPixmap Pixmap CSG UnspecifiedPixmap
shadowWidth ShadowWidth Dimension CSG 0
topShadowPixmap TopShadowPixmap Pixmap CSG UnspecifiedPixmap
topShadowPixel TopShadowPixel Pixel CSG Dinamic
userData UserData XtPointer CSG NULL

Composit class resources
Name Class Type Notes Default Value
children ReadOnly WidgetList C NULL
insertPosition InsertPosition XtOrderProc CSG Insert new children at the end of the child list
numChildren ReadOnly Cardinal C 0

Core class resources
Name Class Type Notes Default Value
accelerators Accelerators XtAccelerators CSG NULL
ancestorSensitive AncestorSensitive Boolean G True
background Background Pixel CSG XtDefaultBackground
backgroundPixmap Pixmap Pixmap CSG XtUnspecifiedPixmap
borderColor BorderColor Pixel CSG XtDefaultForeground
borderPixmap Pixmap Pixmap CSG XtUnspecifiedPixmap
borderWidth BorderWidth Dimension CSG 0
colormap Colormap Colormap CG Parent's Colormap
depth Depth int CG Parent's Depth
destroyCallback Callback XtCallbackList C NULL
height Height Dimension CSG Depends on orientation
initialResourcesPersistent InitialResourcesPersistent Boolean C True
mappedWhenManaged MappedWhenManaged Boolean CSG True
screen Screen Screen CG Parent's Screen
sensitive Sensitive Boolean CSG True
translations Translations XtTranslations CSG NULL
width Width Dimension CSG Depends on orientation
x Position Position CSG 0
y Position Position CSG 0


Grip Translations

    The Paned widget has no action routines of its own, as all actions are handled through the grips. The grips are each assigned a default Translation table.
        <Btn1Down>:     GripAction(Start, UpLeftPane)
        <Btn2Down>:     GripAction(Start, ThisBorderOnly)
        <Btn3Down>:     GripAction(Start, LowRightPane) 
        <Btn1Motion>:   GripAction(Move, UpLeftPane) 
        <Btn2Motion>:   GripAction(Move, ThisBorderOnly) 
        <Btn3Motion>:   GripAction(Move, LowRightPane)
        Any<BtnUp>:     GripAction(Commit)
The Paned widget interprets the GripAction as taking two arguments. The first argument may be any of the following:
Start Sets up the Paned widget for resizing and changes the cursor of the grip. The second argument determines which pane will be resized, and can take on any of the three values shown above.
Move The internal borders are drawn over the current pane locations to animate where the borders would actually be placed if you were to move this border as shown. The second argument must match the second argument that was passed to the Start action, that began this process. If these arguments are not passed, the behavior is undefined.
Commit This argument causes the Paned widget to commit the changes selected by the previously started action. The cursor is changed back to the grip's inactive cursor. No second argument is needed in this case.

Convenience routines

To enable or disable a child's request for pane resizing, use

void XawPanedAllowResize (w, allow_resize)
     Widget w;
     Boolean allow_resize;
w Specifies the child pane.
allow_resize Specifies whether or not resizing requests for this child will be granted by the Paned widget.

If allow_resize is True, the Paned widget allows geometry requests from the child to change the pane's height. If allow_resize is False, the Paned widget ignores geometry requests from the child to change the pane's height. The default state is True before the Pane is realized and False after it is realized. This procedure is equivalent to changing the allowResize constraint resource for the child.


To change the minimum and maximum height settings for a pane, use


void XawPanedSetMinMax(w, min, max)
     Widget w;
     int min, max;
w Specifies the child pane.
min Specifies the new minimum height of the child, expressed in pixels.
max Specifies the new maximum height of the child, expressed in pixels.

This procedure is equivalent to setting the min and max constraint resources for the child.


To retrieve the minimum and maximum height settings for a pane, use


void XawPanedGetMinMax(w, min_return, max_return)
     Widget w;
     int *min_return, *max_return;
w Specifies the child pane.
min Returns the minimum height of the child, expressed in pixels.
max Returns the maximum height of the child, expressed in pixels.

This procedure is equivalent to getting the min and max resources for this child child.


To enable or disable automatic recalculation of pane sizes and positions, use


void XawPanedSetRefigureMode(w, mode)
     Widget w;
     Boolean mode;
w Specifies the Paned widget.
min Specifies whether the layout of the Paned widget is enabled (True) or disabled (False).

When making several changes to the children of a Paned widget after the Paned has been realized, it is a good idea to disable relayout until after all changes have been made.


To retrieve the number of panes in a paned widget use


int XawPanedGetNumSub(w)
     Widget w;
w Specifies the Paned widget.

This function returns the number of panes in the Paned widget. This is not the same as the number of children, since the grips are also children of the Paned widget.


[Xraw home] [Xraw widget class hierarchy]


Vladimir T. Romanovski
romsky@hp1.oea.ihep.su