Application header file | <X11/Xraw/Panner.h> |
Class header file | <X11/Xraw/PannerP.h> |
Class | pannerWidgetClass |
Class Name | Panner |
Superclass | Simple --> Core |
The Panner widget represents a rectangular region (called the ``canvas'') of which only a smaller, enclosed rectangular region (called the ``slider'') by is visible at any given time. It is typically used with a Porthole widget to scroll a third widget in two dimensions.
When a Panner is created, it is drawn with the slider in a contrasting color. The slider may be moved around the canvas by pressing, dragging, and then releasing Button1. While scrolling is in progress, the application receives notification through callback procedures which it may use to update any associated widgets. Notification may be done either continuously whenever the slider moves or discretely whenever the slider has been given a new location.
Name | Class | Type | Notes | Default Value |
---|---|---|---|---|
allowOff | AllowOff | Boolean | False | |
backgroundStipple | BackgroundStipple | String | NULL | |
canvasHeight | CanvasHeight | Dimension | 0 | |
canvasWidth | CanvasWidth | Dimension | 0 | |
defaultScale | DefaultScale | Dimension | 8 | |
foreground | Foreground | Pixel | XtDefaultForeground | |
internalSpace | InternalSpace | Dimension | 4 | |
lineWidth | LineWidth | Dimension | 0 | |
reportCallback | ReportCallback | Callback | NULL | |
resize | Resize | Boolean | True | |
rubberBand | RubberBand | Boolean | False | |
shadowColor | ShadowColor | Pixel | XtDefaultForeground | |
shadowThickness | ShadowThickness | Dimension | 2 | |
sliderX | SliderX | Position | 0 | |
sliderY | SliderY | Position | 0 | |
sliderHeight | SliderHeight | Dimension | 0 | |
sliderWidth | SliderWidth | Dimension | 0 | |
translations | Translations | TranslationTable | See Panner Actions | |
width | Width | Dimension | A | depends on orientation |
allowOff | Whether to allow the edges of the slider to go off the edges of the canvas. |
---|---|
backgroundStipple | The name of a bitmap pattern to be used as the background for the area representing the canvas. |
canvasHeight canvasWidth |
The size of the canvas. |
defaultScale | The percentage size that the Panner widget should have relative to the size of the canvas. |
foreground | A pixel value which indexes the widget's colormap to derive the color used to draw the slider. |
internalSpace | The width of internal border in pixels between a slider representing the full size of the canvas and the edge of the Panner widget. |
lineWidth | The width of the lines in the rubberbanding rectangle when rubberbanding is in effect instead of continuous scrolling. The default is 0. |
reportCallback | All functions on this callback list are called when the notify action is invoked. See the Panner Actions section for details. |
resize | Whether or not to resize the panner whenever the canvas size is changed so that the defaultScale is maintained. |
rubberBand | Whether or not scrolling should be discrete (only moving a rubberbanded rectangle until the scrolling is done) or continuous (moving the slider itself). This controls whether or not the move action procedure also invokes the notify action procedure. |
shadowColor | The color of the shadow underneath the slider. |
shadowThickness | The width of the shadow underneath the slider. |
sliderX sliderY |
The location of the slider in the coordinates of the canvas. |
sliderHeight sliderWidth |
The size of the slider. |
Simple class resources | ||||
---|---|---|---|---|
Name | Class | Type | Notes | Default Value |
bottomShadowPixel | BottomShadowPixel | Pixel | CSG | Dinamic |
bottomShadowPixmap | BottomShadowPixmap | Pixmap | CSG | UnspecifiedPixmap |
cursor | Cursor | Cursor | CSG | None |
cursorName | CursorName | String | C | NULL |
highlightPixel | highlightPixel | Pixel | CSG | Dinamic |
highlightPixmap | highlightPixmap | Pixmap | CSG | UnspecifiedPixmap |
highlightThickness | HighlightThickness | Dimension | CSG | 2 |
insensitiveBorder | Insensitive | Pixmap | CSG | None**GreyPixmap |
foreground | Foreground | Pixel | CSG | XtDefaultForeground |
shadowWidth | ShadowWidth | Dimension | CSG | 0 |
topShadowPixmap | TopShadowPixmap | Pixmap | CSG | UnspecifiedPixmap |
topShadowPixel | TopShadowPixel | Pixel | CSG | Dinamic |
userData | UserData | XtPointer | CSG | NULL |
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 | Font height + 2 * internalHeight |
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 | Label width + 2 * internalWidth |
x | Position | Position | CSG | 0 |
y | Position | Position | CSG | 0 |
The actions supported by the Panner widget are:
start() | This action begins movement of the slider. |
stop() | This action ends movement of the slider. |
abort() | This action ends movement of the slider and restores it to the position it held when the start action was invoked. |
move() | This action moves the outline of the slider (if the rubberBand resource is True) or the slider itself (by invoking the notify action procedure). |
page(xamount,yamount) | This action moves the slider by the specified amounts. The format for the amounts is a signed or unsigned floating-point number (e.g., +1.0 or \-.5) followed by either p indicating pages (slider sizes), or c indicating canvas sizes. Thus, page(+0,+.5p) represents vertical movement down one-half the height of the slider and page(0,0) represents moving to the upper left corner of the canvas. |
notify() | This action informs the application of the slider's current position by invoking the reportCallback functions registered by the application. |
set(what,value) | This action changes the behavior of the Panner. The what argument must currently be the string rubberband and controls the value of the rubberBand resource. The value argument may have one of the values on, off, or toggle. |
The default bindings for Panner are:
<Btn1Down>: start()
<Btn1Motion>: move()
<Btn1Up>: notify() stop()
<Btn2Down>: abort()
<Key>KP_Enter: set(rubberband,toggle)
<Key>space: page(+1p,+1p)
<Key>Delete: page(-1p,-1p)
<Key>BackSpace: page(-1p,-1p)
<Key>Left: page(-.5p,+0)
<Key>Right: page(+.5p,+0)
<Key>Up: page(+0,-.5p)
<Key>Down: page(+0,+.5p)
<Key>Home: page(0,0)
The functions registered on the reportCallback list are invoked by
the notify action as follows:
void ReportProc(panner, client_data, report)
Widget panner;
XtPointer client_data;
XtPointer report; /* (XawPannerReport *) */
panner | Specifies the Panner widget. |
client_data | Specifies the client data. |
report |
Specifies a pointer to an XawPannerReport structure containing
the location and size of the slider and the size of the canvas.
|