1 <sect1 id="Panner_Widget">
2 <title>Panner Widget</title>
8 <!-- .IN "Panner widget" "" "@DEF@" -->
9 <literallayout class="monospaced">
13 Application header file <X11/Xaw/Panner.h>
14 <!-- .IN "Panner.h" "" -->
15 Class header file <X11/Xaw/PannerP.h>
16 <!-- .IN "PannerP.h" "" -->
17 Class pannerWidgetClass
18 <!-- .IN "pannerWidgetClass" "" -->
20 <!-- .IN "Panner widget" "class name" -->
27 A Panner widget is a rectangle, called the
28 ``canvas,'' on which another rectangle, the ``slider,'' moves in two
29 dimensions. It is often used with a Porthole widget to move, or
30 ``scroll,'' a third widget in two dimensions, in which case the
31 slider's size and position gives feedback as to what portion of
32 the third widget is visible.
36 The slider may be scrolled around the canvas by pressing,
37 dragging, and releasing Button1; the default translation also
38 enables scrolling via arrow keys and some other keys. While
39 scrolling is in progress, the application receives notification
40 through callback procedures. Notification may be done either
41 continuously whenever the slider moves or discretely whenever the
42 slider has been given a new location.
44 <sect2 id='Panner::Resources'>
45 <title>Resources</title>
48 When creating a Panner widget instance, the following resources are
49 retrieved from the argument list or from the resource database:
53 <!-- .IN "Panner widget" "resources" -->
55 <tgroup cols='5' align='center'>
56 <colspec colname='c1'/>
57 <colspec colname='c2'/>
58 <colspec colname='c3'/>
59 <colspec colname='c4'/>
60 <colspec colname='c5'/>
67 <entry>Default Value</entry>
72 <entry>accelerators</entry>
73 <entry>Accelerators</entry>
74 <entry>AcceleratorTable</entry>
79 <entry>allowOff</entry>
80 <entry>AllowOff</entry>
81 <entry>Boolean</entry>
86 <entry>ancestorSensitive</entry>
87 <entry>AncestorSensitive</entry>
88 <entry>Boolean</entry>
93 <entry>background</entry>
94 <entry>Background</entry>
97 <entry>XtDefaultBackground</entry>
100 <entry>backgroundPixmap</entry>
101 <entry>Pixmap</entry>
102 <entry>Pixmap</entry>
104 <entry>XtUnspecifiedPixmap</entry>
107 <entry>backgroundStipple</entry>
108 <entry>BackgroundStipple</entry>
109 <entry>String</entry>
114 <entry>borderColor</entry>
115 <entry>BorderColor</entry>
118 <entry>XtDefaultForeground</entry>
121 <entry>borderPixmap</entry>
122 <entry>Pixmap</entry>
123 <entry>Pixmap</entry>
125 <entry>XtUnspecifiedPixmap</entry>
128 <entry>borderWidth</entry>
129 <entry>BorderWidth</entry>
130 <entry>Dimension</entry>
135 <entry>canvasHeight</entry>
136 <entry>CanvasHeight</entry>
137 <entry>Dimension</entry>
142 <entry>canvasWidth</entry>
143 <entry>CanvasWidth</entry>
144 <entry>Dimension</entry>
149 <entry>colormap</entry>
150 <entry>Colormap</entry>
151 <entry>Colormap</entry>
153 <entry>Parent's Colormap</entry>
156 <entry>cursor</entry>
157 <entry>Cursor</entry>
158 <entry>Cursor</entry>
163 <entry>cursorName</entry>
164 <entry>Cursor</entry>
165 <entry>String</entry>
170 <entry>defaultScale</entry>
171 <entry>DefaultScale</entry>
172 <entry>Dimension</entry>
181 <entry>Parent's Depth</entry>
184 <entry>destroyCallback</entry>
185 <entry>Callback</entry>
186 <entry>XtCallbackList</entry>
191 <entry>foreground</entry>
192 <entry>Foreground</entry>
195 <entry>XtDefaultForeground</entry>
198 <entry>height</entry>
199 <entry>Height</entry>
200 <entry>Dimension</entry>
202 <entry>depends on orientation</entry>
205 <entry>internalSpace</entry>
206 <entry>InternalSpace</entry>
207 <entry>Dimension</entry>
212 <entry>international</entry>
213 <entry>International</entry>
214 <entry>Boolean</entry>
219 <entry>lineWidth</entry>
220 <entry>LineWidth</entry>
221 <entry>Dimension</entry>
226 <entry>mappedWhenManaged</entry>
227 <entry>MappedWhenManaged</entry>
228 <entry>Boolean</entry>
233 <entry>pointerColor</entry>
234 <entry>Foreground</entry>
237 <entry>XtDefaultForeground</entry>
240 <entry>pointerColorBackground</entry>
241 <entry>Background</entry>
244 <entry>XtDefaultBackground</entry>
247 <entry>reportCallback</entry>
248 <entry>ReportCallback</entry>
249 <entry>Callback</entry>
254 <entry>resize</entry>
255 <entry>Resize</entry>
256 <entry>Boolean</entry>
261 <entry>rubberBand</entry>
262 <entry>RubberBand</entry>
263 <entry>Boolean</entry>
268 <entry>screen</entry>
269 <entry>Screen</entry>
270 <entry>Screen</entry>
272 <entry>Parent's Screen</entry>
275 <entry>sensitive</entry>
276 <entry>Sensitive</entry>
277 <entry>Boolean</entry>
282 <entry>shadowColor</entry>
283 <entry>ShadowColor</entry>
286 <entry>XtDefaultForeground</entry>
289 <entry>shadowThickness</entry>
290 <entry>ShadowThickness</entry>
291 <entry>Dimension</entry>
296 <entry>sliderX</entry>
297 <entry>SliderX</entry>
298 <entry>Position</entry>
303 <entry>sliderY</entry>
304 <entry>SliderY</entry>
305 <entry>Position</entry>
310 <entry>sliderHeight</entry>
311 <entry>SliderHeight</entry>
312 <entry>Dimension</entry>
317 <entry>sliderWidth</entry>
318 <entry>SliderWidth</entry>
319 <entry>Dimension</entry>
324 <entry>translations</entry>
325 <entry>Translations</entry>
326 <entry>TranslationTable</entry>
328 <entry>See below</entry>
333 <entry>Dimension</entry>
335 <entry>depends on orientation</entry>
339 <entry>Position</entry>
340 <entry>Position</entry>
346 <entry>Position</entry>
347 <entry>Position</entry>
359 <function>allowOff</function>
363 Whether to allow the edges of the slider to go off the edges of the canvas.
372 <function>backgroundStipple</function>
376 The name of a bitmap pattern to be used as the background for
377 the area representing the canvas.
386 <function>canvasHeight</function>
397 <function>canvasWidth</function>
401 The size of the canvas.
410 <function>defaultScale</function>
414 The percentage size that the Panner widget should have relative
415 to the size of the canvas.
423 <function>foreground</function>
427 A pixel value which indexes the widget's colormap to derive the color
428 used to draw the slider.
435 <function>internalSpace</function>
439 The width of internal border in pixels between a slider representing the
440 full size of the canvas
441 and the edge of the Panner widget.
448 <function>lineWidth</function>
452 The width of the lines in the rubberbanding rectangle when rubberbanding
453 is in effect instead of continuous scrolling. The default is 0.
462 <function>reportCallback</function>
466 All functions on this callback list are called when the
467 <function>notify</function> action is invoked. See the <function>Panner Actions</function> section
474 <function>resize</function>
478 Whether or not to resize the panner whenever the canvas size is changed so
479 that the <function>defaultScale</function> is maintained.
485 <function>rubberBand</function>
489 Whether or not scrolling should be discrete (only moving a rubberbanded
490 rectangle until the scrolling is done) or continuous (moving the slider
491 itself). This controls whether or not the <function>move</function> action procedure also
492 invokes the <function>notify</function> action procedure.
500 <function>shadowColor</function>
504 The color of the shadow underneath the slider.
510 <function>shadowThickness</function>
514 The width of the shadow underneath the slider.
520 <function>sliderX</function>
531 <function>sliderY</function>
535 The location of the slider in the coordinates of the canvas.
541 <function>sliderHeight</function>
552 <function>sliderWidth</function>
556 The size of the slider.
564 <sect2 id="Panner_Actions">
565 <title>Panner Actions</title>
566 <!-- .IN "Panner widget" "actions" -->
569 The actions supported by the Panner widget are:
574 <function>start</function>()
578 This action begins movement of the slider.
584 <function>stop</function>()
588 This action ends movement of the slider.
594 <function>abort</function>()
598 This action ends movement of the slider and restores it to the position it
599 held when the <function>start</function> action was invoked.
605 <function>move</function>()
609 This action moves the outline of the slider (if the <function>rubberBand</function> resource
610 is True) or the slider itself (by invoking the <function>notify</function>
617 <function>page</function>(<function>xamount</function>,<function>yamount</function>)
621 This action moves the slider by the specified amounts. The format
622 for the amounts is a signed or unsigned floating-point number (e.g., +1.0
624 by either <function>p</function> indicating pages (slider sizes), or <function>c</function> indicating
625 canvas sizes. Thus, <emphasis remap='I'>page(+0,+.5p)</emphasis> represents vertical movement down
626 one-half the height of the slider and <emphasis remap='I'>page(0,0)</emphasis> represents moving to
627 the upper left corner of the canvas.
633 <function>notify</function>()
637 This action informs the application of the slider's current position by
638 invoking the <function>reportCallback</function> functions registered by the application.
644 <function>set</function>(<function>what</function>,<function>value</function>)
648 This action changes the behavior of the Panner. The <emphasis remap='I'>what</emphasis> argument
649 must currently be the string <function>rubberband</function> and controls the value of
650 the <function>rubberBand</function> resource. The <function>value</function> argument
651 may have one of the values <function>on</function>, <function>off</function>, or <function>toggle</function>.
660 The default bindings for Panner are:
661 <!-- .IN "Panner widget" "default translation table" -->
664 <literallayout class="monospaced">
665 <!-- .TA .5i 1.75i -->
666 <!-- .ta .5i 1.75i -->
667 <Btn1Down>: start(\|)
668 <Btn1Motion>: move(\|)
669 <Btn1Up>: notify(\|) stop(\|)
670 <Btn2Down>: abort(\|)
671 <Key>KP_Enter: set(rubberband,toggle)
672 <Key>space: page(+1p,+1p)
673 <Key>Delete: page(\-1p,\-1p)
674 <Key>BackSpace: page(\-1p,\-1p)
675 <Key>Left: page(\-.5p,+0)
676 <Key>Right: page(+.5p,+0)
677 <Key>Up: page(+0,\-.5p)
678 <Key>Down: page(+0,+.5p)
679 <Key>Home: page(0,0)
683 <sect2 id="Panner_Callbacks">
684 <title>Panner Callbacks</title>
685 <!-- .IN "Panner widget" "callbacks" -->
688 The functions registered on the <function>reportCallback</function> list are invoked by
689 the <function>notify</function> action as follows:
690 <!-- .IN "ReportProc" "" "@DEF@" -->
691 <funcsynopsis id='Panner::ReportProc'>
693 <funcdef>void<function> ReportProc</function></funcdef>
694 <paramdef>Widget<parameter> panner</parameter></paramdef>
695 <paramdef>XtPointer<parameter> client_data</parameter></paramdef>
696 <paramdef>XtPointer<parameter> report</parameter></paramdef>
707 <!-- .IP <emphasis remap='I'>panner</emphasis> 1i -->
708 Specifies the Panner widget.
716 <!-- .IP <emphasis remap='I'>client_data</emphasis> 1i -->
717 Specifies the client data.
725 <!-- .IP <emphasis remap='I'>report</emphasis> 1i -->
726 Specifies a pointer to an <function>XawPannerReport</function> structure containing
727 the location and size of the slider and the size of the canvas.