summaryrefslogtreecommitdiff
path: root/xc/doc/specs/Xaw/Panner
blob: 245ee8767a29811f276683549cef5abc1c270c06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
.\" $XConsortium: Panner,v 1.8 94/05/01 19:21:19 gildea Exp $
.NH 2
Panner Widget
.LP
.XS
	Panner Widget
.XE
.IN "Panner widget" "" "@DEF@"
.Ds 0
.TA 2.0i
.ta 2.0i
.sp
Application header file	<X11/Xaw/Panner.h>
.IN "Panner.h" ""
Class header file	<X11/Xaw/PannerP.h>
.IN "PannerP.h" ""
Class		pannerWidgetClass
.IN "pannerWidgetClass" ""
Class Name	Panner
.IN "Panner widget" "class name"
Superclass	Simple
.sp
.De
.LP
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.
.LP
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.
.NH 3
Resources
.LP
When creating a Panner widget instance, the following resources are
retrieved from the argument list or from the resource database:
.LP
.IN "Panner widget" "resources"
.TS H
expand;
lw(1i) lw(1i) lw(1i) lw(.5i) lw(2i).
_
.sp 3p
.TB
Name	Class	Type	Notes	Default Value
.sp 3p
_
.TH
.R
.sp 3p
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
.sp 3p
_
.TE
.Ac
.IP \fBallowOff\fP 1.5i
Whether to allow the edges of the slider to go off the edges of the canvas.
.As
.Bg
.Gp
.IP \fBbackgroundStipple\fP 1.5i
The name of a bitmap pattern to be used as the background for
the area representing the canvas.
.Bc
.Bp
.Bw
.IP \fBcanvasHeight\fP 1.5i
.br
.ns
.IP \fBcanvasWidth\fP 1.5i
The size of the canvas.
.Cm
.Cu
.Cn
.IP \fBdefaultScale\fP 1.5i
The percentage size that the Panner widget should have relative
to the size of the canvas.
.Dp
.Dc
.IP \fBforeground\fP 1.5i
A pixel value which indexes the widget's colormap to derive the color
used to draw the slider.
.Hw
.IP \fBinternalSpace\fP 1.5i
The width of internal border in pixels between a slider representing the 
full size of the canvas
and the edge of the Panner widget.
.Ix
.IP \fBlineWidth\fP 1.5i
The width of the lines in the rubberbanding rectangle when rubberbanding
is in effect instead of continuous scrolling.  The default is 0.
.Mm
.Pf
.Pb
.IP \fBreportCallback\fP 1.5i
All functions on this callback list are called when the
\fBnotify\fP action is invoked.  See the \fBPanner Actions\fP section 
for details.
.IP \fBresize\fP 1.5i
Whether or not to resize the panner whenever the canvas size is changed so
that the \fBdefaultScale\fP is maintained.
.IP \fBrubberBand\fP 1.5i
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 \fBmove\fP action procedure also
invokes the \fBnotify\fP action procedure.
.Sc
.Se
.IP \fBshadowColor\fP 1.5i
The color of the shadow underneath the slider.
.IP \fBshadowThickness\fP 1.5i
The width of the shadow underneath the slider.
.IP \fBsliderX\fP 1.5i
.br
.ns
.IP \fBsliderY\fP 1.5i
The location of the slider in the coordinates of the canvas.
.IP \fBsliderHeight\fP 1.5i
.br
.ns
.IP \fBsliderWidth\fP 1.5i
The size of the slider.
.Tr
.Xy
.NH 3 
Panner Actions
.IN "Panner widget" "actions"
.LP
The actions supported by the Panner widget are:
.IP \fBstart\fP() 1.5i
This action begins movement of the slider.
.IP \fBstop\fP() 1.5i
This action ends movement of the slider.
.IP \fBabort\fP() 1.5i
This action ends movement of the slider and restores it to the position it
held when the \fBstart\fP action was invoked.
.IP \fBmove\fP() 1.5i
This action moves the outline of the slider (if the \fBrubberBand\fP resource
is True) or the slider itself (by invoking the \fBnotify\fP
action procedure).
.IP \fBpage\fP(\fIxamount\fP,\fIyamount\fP) 1.5i
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 \fBp\fP indicating pages (slider sizes), or \fBc\fP indicating
canvas sizes.  Thus, \fIpage(+0,+.5p)\fP represents vertical movement down
one-half the height of the slider and \fIpage(0,0)\fP represents moving to
the upper left corner of the canvas.
.IP \fBnotify\fP() 1.5i
This action informs the application of the slider's current position by 
invoking the \fBreportCallback\fP functions registered by the application.
.IP \fBset\fP(\fIwhat\fP,\fIvalue\fP) 1.5i
This action changes the behavior of the Panner.  The \fIwhat\fP argument 
must currently be the string \fBrubberband\fP and controls the value of 
the \fBrubberBand\fP resource.  The \fIvalue\fP argument 
may have one of the values \fBon\fP, \fBoff\fP, or \fBtoggle\fP.
.LP
.sp
The default bindings for Panner are:
.IN "Panner widget" "default translation table"
.LP
.Ds 0
.TA .5i 1.75i
.ta .5i 1.75i
	<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)
.De
.NH 3
Panner Callbacks
.IN "Panner widget" "callbacks"
.LP
The functions registered on the \fBreportCallback\fP list are invoked by
the \fBnotify\fP action as follows:
.IN "ReportProc" "" "@DEF@"
.FD 0
void ReportProc(\fIpanner\fP, \fIclient_data\fP, \fIreport\fP)
.br
	Widget \fIpanner\fP;
.br
	XtPointer \fIclient_data\fP;
.br
	XtPointer \fIreport\fP;    /* (XawPannerReport *) */
.FN
.IP \fIpanner\fP 1i
Specifies the Panner widget.
.IP \fIclient_data\fP 1i
Specifies the client data.
.IP \fIreport\fP 1i
Specifies a pointer to an \fBXawPannerReport\fP structure containing
the location and size of the slider and the size of the canvas.