Panner Widget Application header file <X11/Xaw/Panner.h> Class header file <X11/Xaw/PannerP.h> Class pannerWidgetClass Class Name Panner Superclass Simple A Panner widget is a rectangle, called the ``canvas,'' on which another rectangle, the ``slider,'' moves in two dimensions. It is often used with a Porthole widget to move, or ``scroll,'' a third widget in two dimensions, in which case the slider's size and position gives feedback as to what portion of the third widget is visible. The slider may be scrolled around the canvas by pressing, dragging, and releasing Button1; the default translation also enables scrolling via arrow keys and some other keys. While scrolling is in progress, the application receives notification through callback procedures. Notification may be done either continuously whenever the slider moves or discretely whenever the slider has been given a new location. Resources When creating a Panner widget instance, the following resources are retrieved from the argument list or from the resource database: Name Class Type Notes Default Value accelerators Accelerators AcceleratorTable NULL allowOff AllowOff Boolean False ancestorSensitive AncestorSensitive Boolean D True background Background Pixel XtDefaultBackground backgroundPixmap Pixmap Pixmap XtUnspecifiedPixmap backgroundStipple BackgroundStipple String NULL borderColor BorderColor Pixel XtDefaultForeground borderPixmap Pixmap Pixmap XtUnspecifiedPixmap borderWidth BorderWidth Dimension 1 canvasHeight CanvasHeight Dimension 0 canvasWidth CanvasWidth Dimension 0 colormap Colormap Colormap Parent's Colormap cursor Cursor Cursor None cursorName Cursor String NULL defaultScale DefaultScale Dimension 8 depth Depth int C Parent's Depth destroyCallback Callback XtCallbackList NULL foreground Foreground Pixel XtDefaultForeground height Height Dimension A depends on orientation internalSpace InternalSpace Dimension 4 international International Boolean C False lineWidth LineWidth Dimension 0 mappedWhenManaged MappedWhenManaged Boolean True pointerColor Foreground Pixel XtDefaultForeground pointerColorBackground Background Pixel XtDefaultBackground reportCallback ReportCallback Callback NULL resize Resize Boolean True rubberBand RubberBand Boolean False screen Screen Screen R Parent's Screen sensitive Sensitive Boolean True 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 below width Width Dimension A depends on orientation x Position Position 0 y Position Position 0 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. Panner Actions 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) Panner Callbacks The functions registered on the reportCallback list are invoked by the notify action as follows: void ReportProc Widget panner XtPointer client_data XtPointer report panner Specifies the Panner widget. panner Specifies the client data. panner Specifies a pointer to an XawPannerReport structure containing the location and size of the slider and the size of the canvas.