Repeater.xml revision 5b16253f
1<sect1 id="Repeater_Widget">
2<title>Repeater Widget</title>
3<!-- .XS -->
4<!-- 	Repeater Widget -->
5<!-- .XE -->
6<indexterm significance="preferred"><primary>Repeater widget</primary></indexterm>
7<literallayout class="monospaced">
8<!-- .TA 2.0i -->
9<!-- .ta 2.0i -->
10<!-- .sp -->
11Application header file	&lt;X11/Xaw/Repeater.h&gt;
12<indexterm><primary>Repeater.h</primary></indexterm>
13Class header file	&lt;X11/Xaw/RepeaterP.h&gt;
14<indexterm><primary>RepeaterP.h</primary></indexterm>
15Class	repeaterWidgetClass
16<indexterm><primary>repeaterWidgetClass</primary></indexterm>
17Class Name	Repeater
18<indexterm><primary>Repeater widget</primary><secondary>class name</secondary></indexterm>
19Superclass	Command
20<!-- .sp -->
21</literallayout>
22<para>
23<!-- .LP -->
24The Repeater widget is a subclass of the Command widget; see the
25<link linkend='Command_Widget'>Command documentation</link>
26for details.  The difference is that the Repeater can call its
27registered callbacks repeatedly, at an increasing rate.  The default translation
28does so for the duration the user holds down pointer button 1 while the pointer
29is on the Repeater.
30</para>
31<sect2 id='Repeater::Resources'>
32<title>Resources</title>
33<para>
34<!-- .LP -->
35When creating a Repeater widget instance, the following resources are
36retrieved from the argument list or from the resource database:
37</para>
38<para>
39<!-- .LP -->
40<indexterm><primary>Repeater widget</primary><secondary>resources</secondary></indexterm>
41<informaltable>
42  <tgroup cols='5' align='center'>
43  <colspec colname='c1'/>
44  <colspec colname='c2'/>
45  <colspec colname='c3'/>
46  <colspec colname='c4'/>
47  <colspec colname='c5'/>
48  <thead>
49    <row>
50      <entry>Name</entry>
51      <entry>Class</entry>
52      <entry>Type</entry>
53      <entry>Notes</entry>
54      <entry>Default Value</entry>
55    </row>
56  </thead>
57  <tbody>
58    <row>
59      <entry>accelerators</entry>
60      <entry>Accelerators</entry>
61      <entry>AcceleratorTable</entry>
62      <entry></entry>
63      <entry>NULL</entry>
64    </row>
65    <row>
66      <entry>ancestorSensitive</entry>
67      <entry>AncestorSensitive</entry>
68      <entry>Boolean</entry>
69      <entry>D</entry>
70      <entry>True</entry>
71    </row>
72    <row>
73      <entry>background</entry>
74      <entry>Background</entry>
75      <entry>Pixel</entry>
76      <entry></entry>
77      <entry>XtDefaultBackground</entry>
78    </row>
79    <row>
80      <entry>backgroundPixmap</entry>
81      <entry>Pixmap</entry>
82      <entry>Pixmap</entry>
83      <entry></entry>
84      <entry>XtUnspecifiedPixmap</entry>
85    </row>
86    <row>
87      <entry>bitmap</entry>
88      <entry>Bitmap</entry>
89      <entry>Pixmap</entry>
90      <entry></entry>
91      <entry>None</entry>
92    </row>
93    <row>
94      <entry>borderColor</entry>
95      <entry>BorderColor</entry>
96      <entry>Pixel</entry>
97      <entry></entry>
98      <entry>XtDefaultForeground</entry>
99    </row>
100    <row>
101      <entry>borderPixmap</entry>
102      <entry>Pixmap</entry>
103      <entry>Pixmap</entry>
104      <entry></entry>
105      <entry>XtUnspecifiedPixmap</entry>
106    </row>
107    <row>
108      <entry>borderWidth</entry>
109      <entry>BorderWidth</entry>
110      <entry>Dimension</entry>
111      <entry></entry>
112      <entry>1</entry>
113    </row>
114    <row>
115      <entry>callback</entry>
116      <entry>Callback</entry>
117      <entry>XtCallbackList</entry>
118      <entry></entry>
119      <entry>NULL</entry>
120    </row>
121    <row>
122      <entry>colormap</entry>
123      <entry>Colormap</entry>
124      <entry>Colormap</entry>
125      <entry></entry>
126      <entry>Parent's Colormap</entry>
127    </row>
128    <row>
129      <entry>cornerRoundPercent</entry>
130      <entry>CornerRoundPercent</entry>
131      <entry>Dimension</entry>
132      <entry></entry>
133      <entry>25</entry>
134    </row>
135    <row>
136      <entry>cursor</entry>
137      <entry>Cursor</entry>
138      <entry>Cursor</entry>
139      <entry></entry>
140      <entry>None</entry>
141    </row>
142    <row>
143      <entry>cursorName</entry>
144      <entry>Cursor</entry>
145      <entry>String</entry>
146      <entry></entry>
147      <entry>NULL</entry>
148    </row>
149    <row>
150      <entry>decay</entry>
151      <entry>Decay</entry>
152      <entry>Int</entry>
153      <entry></entry>
154      <entry>5</entry>
155    </row>
156    <row>
157      <entry>depth</entry>
158      <entry>Depth</entry>
159      <entry>int</entry>
160      <entry>C</entry>
161      <entry>Parent's Depth</entry>
162    </row>
163    <row>
164      <entry>destroyCallback</entry>
165      <entry>Callback</entry>
166      <entry>XtCallbackList</entry>
167      <entry></entry>
168      <entry>NULL</entry>
169    </row>
170    <row>
171      <entry>encoding</entry>
172      <entry>Encoding</entry>
173      <entry>UnsignedChar</entry>
174      <entry></entry>
175      <entry>XawTextEncoding8bit</entry>
176    </row>
177    <row>
178      <entry>flash</entry>
179      <entry>Boolean</entry>
180      <entry>Boolean</entry>
181      <entry></entry>
182      <entry>False</entry>
183    </row>
184    <row>
185      <entry>font</entry>
186      <entry>Font</entry>
187      <entry>XFontStruct</entry>
188      <entry></entry>
189      <entry>XtDefaultFont</entry>
190    </row>
191    <row>
192      <entry>fontSet</entry>
193      <entry>FontSet</entry>
194      <entry>XFontSet</entry>
195      <entry></entry>
196      <entry>XtDefaultFontSet</entry>
197    </row>
198    <row>
199      <entry>foreground</entry>
200      <entry>Foreground</entry>
201      <entry>Pixel</entry>
202      <entry></entry>
203      <entry>XtDefaultForeground</entry>
204    </row>
205    <row>
206      <entry>height</entry>
207      <entry>Height</entry>
208      <entry>Dimension</entry>
209      <entry>A</entry>
210      <entry>graphic height + 2 * <function>internalHeight</function></entry>
211    </row>
212    <row>
213      <entry>highlightThickness</entry>
214      <entry>Thickness</entry>
215      <entry>Dimension</entry>
216      <entry>A</entry>
217      <entry>2 (0 if Shaped)</entry>
218    </row>
219    <row>
220      <entry>initialDelay</entry>
221      <entry>Delay</entry>
222      <entry>Int</entry>
223      <entry></entry>
224      <entry>200</entry>
225    </row>
226    <row>
227      <entry>insensitiveBorder</entry>
228      <entry>Insensitive</entry>
229      <entry>Pixmap</entry>
230      <entry></entry>
231      <entry>GreyPixmap</entry>
232    </row>
233    <row>
234      <entry>internalHeight</entry>
235      <entry>Height</entry>
236      <entry>Dimension</entry>
237      <entry></entry>
238      <entry>2</entry>
239    </row>
240    <row>
241      <entry>internalWidth</entry>
242      <entry>Width</entry>
243      <entry>Dimension</entry>
244      <entry></entry>
245      <entry>4</entry>
246    </row>
247    <row>
248      <entry>international</entry>
249      <entry>International</entry>
250      <entry>Boolean</entry>
251      <entry>C</entry>
252      <entry>False</entry>
253    </row>
254    <row>
255      <entry>justify</entry>
256      <entry>Justify</entry>
257      <entry>Justify</entry>
258      <entry></entry>
259      <entry>XtJustifyCenter (center)</entry>
260    </row>
261    <row>
262      <entry>label</entry>
263      <entry>Label</entry>
264      <entry>String</entry>
265      <entry></entry>
266      <entry>name of widget</entry>
267    </row>
268    <row>
269      <entry>leftBitmap</entry>
270      <entry>LeftBitmap</entry>
271      <entry>Bitmap</entry>
272      <entry></entry>
273      <entry>None</entry>
274    </row>
275    <row>
276      <entry>mappedWhenManaged</entry>
277      <entry>MappedWhenManaged</entry>
278      <entry>Boolean</entry>
279      <entry></entry>
280      <entry>True</entry>
281    </row>
282    <row>
283      <entry>minimumDelay</entry>
284      <entry>MinimumDelay</entry>
285      <entry>Int</entry>
286      <entry></entry>
287      <entry>10</entry>
288    </row>
289    <row>
290      <entry>pointerColor</entry>
291      <entry>Foreground</entry>
292      <entry>Pixel</entry>
293      <entry></entry>
294      <entry>XtDefaultForeground</entry>
295    </row>
296    <row>
297      <entry>pointerColorBackground</entry>
298      <entry>Background</entry>
299      <entry>Pixel</entry>
300      <entry></entry>
301      <entry>XtDefaultBackground</entry>
302    </row>
303    <row>
304      <entry>repeatDelay</entry>
305      <entry>Delay</entry>
306      <entry>Int</entry>
307      <entry></entry>
308      <entry>50</entry>
309    </row>
310    <row>
311      <entry>resize</entry>
312      <entry>Resize</entry>
313      <entry>Boolean</entry>
314      <entry></entry>
315      <entry>True</entry>
316    </row>
317    <row>
318      <entry>screen</entry>
319      <entry>Screen</entry>
320      <entry>Pointer</entry>
321      <entry>R</entry>
322      <entry>Parent's Screen</entry>
323    </row>
324    <row>
325      <entry>sensitive</entry>
326      <entry>Sensitive</entry>
327      <entry>Boolean</entry>
328      <entry></entry>
329      <entry>True</entry>
330    </row>
331    <row>
332      <entry>shapeStyle</entry>
333      <entry>ShapeStyle</entry>
334      <entry>ShapeStyle</entry>
335      <entry></entry>
336      <entry>Rectangle</entry>
337    </row>
338    <row>
339      <entry>startCallback</entry>
340      <entry>StartCallback</entry>
341      <entry>Callback</entry>
342      <entry></entry>
343      <entry>NULL</entry>
344    </row>
345    <row>
346      <entry>stopCallback</entry>
347      <entry>StopCallback</entry>
348      <entry>Callback</entry>
349      <entry></entry>
350      <entry>NULL</entry>
351    </row>
352    <row>
353      <entry>translations</entry>
354      <entry>Translations</entry>
355      <entry>TranslationTable</entry>
356      <entry></entry>
357      <entry>See below</entry>
358    </row>
359    <row>
360      <entry>width</entry>
361      <entry>Width</entry>
362      <entry>Dimension</entry>
363      <entry>A</entry>
364      <entry>graphic width + 2 * <function>internalWidth</function></entry>
365    </row>
366    <row>
367      <entry>x</entry>
368      <entry>Position</entry>
369      <entry>Position</entry>
370      <entry></entry>
371      <entry>0</entry>
372    </row>
373    <row>
374      <entry>y</entry>
375      <entry>Position</entry>
376      <entry>Position</entry>
377      <entry></entry>
378      <entry>0</entry>
379    </row>
380  </tbody>
381  </tgroup>
382</informaltable>
383\" Resource Descriptions
384<!-- .Ac -->
385<!-- .As -->
386<!-- .Bg -->
387<!-- .Gp -->
388<!-- .Bm -->
389<!-- .Bc -->
390<!-- .Bp -->
391<!-- .Bw -->
392<!-- .Cb -->
393<!-- .Cm -->
394<!-- .Cr -->
395<!-- .Cu -->
396<!-- .Cn -->
397<variablelist>
398  <varlistentry>
399    <term>
400      <function>decay</function>
401    </term>
402    <listitem>
403      <para>
404The number of milliseconds that should be subtracted from each succeeding
405interval while the Repeater button is being held down until the interval
406has reached <function>minimumDelay</function> milliseconds.
407<!-- .Dp -->
408<!-- .Dc -->
409<!-- .Le -->
410      </para>
411    </listitem>
412  </varlistentry>
413  <varlistentry>
414    <term>
415      <function>flash</function>
416    </term>
417    <listitem>
418      <para>
419Whether or not to flash the Repeater button whenever the timer goes off.
420<!-- .Lf -->
421<!-- .Ls -->
422<!-- .Lg -->
423<!-- .Hw -->
424<!-- .Ht -->
425      </para>
426    </listitem>
427  </varlistentry>
428  <varlistentry>
429    <term>
430      <function>initialDelay</function>
431    </term>
432    <listitem>
433      <para>
434The number of milliseconds between the beginning of the Repeater button
435being held down and the first invocation of the <function>callback</function> function.
436<!-- .Ib -->
437<!-- .Ih -->
438<!-- .In -->
439<!-- .Ju -->
440<!-- .La -->
441<!-- .Ll -->
442<!-- .Mm -->
443      </para>
444    </listitem>
445  </varlistentry>
446  <varlistentry>
447    <term>
448      <function>minimumDelay</function>
449    </term>
450    <listitem>
451      <para>
452The minimum time between callbacks in milliseconds.
453<!-- .Pf -->
454<!-- .Pb -->
455      </para>
456    </listitem>
457  </varlistentry>
458  <varlistentry>
459    <term>
460      <function>repeatDelay</function>
461    </term>
462    <listitem>
463      <para>
464The number of milliseconds between each callback after the first (minus an
465increasing number of <function>decay</function>s).
466<!-- .Re -->
467<!-- .Sc -->
468<!-- .Se -->
469<!-- .Ss -->
470      </para>
471    </listitem>
472  </varlistentry>
473  <varlistentry>
474    <term>
475      <function>startCallback</function>
476    </term>
477    <listitem>
478      <para>
479The list of functions to invoke by the <function>start</function> action (typically
480when the Repeater button is first pressed).  The callback data parameter
481is set to NULL.
482      </para>
483    </listitem>
484  </varlistentry>
485  <varlistentry>
486    <term>
487      <function>stopCallback</function>
488    </term>
489    <listitem>
490      <para>
491The list of functions to invoke by the <function>stop</function> action (typically
492when the Repeater button is released).  The callback data parameter
493is set to NULL.
494<!-- .Tr -->
495<!-- .Xy -->
496    </para>
497  </listitem>
498  </varlistentry>
499</variablelist>
500</para>
501</sect2>
502<sect2 id="Repeater_Actions">
503<title>Repeater Actions</title>
504<indexterm><primary>Repeater widget</primary><secondary>actions</secondary></indexterm>
505<para>
506<!-- .LP -->
507The Repeater widget supports the following actions beyond those of the Command
508button:
509<variablelist>
510  <varlistentry>
511    <term>
512      <function>start</function>()
513    </term>
514    <listitem>
515      <para>
516This invokes the functions on the <function>startCallback</function> and <function>callback</function> lists
517and sets a timer to go off in <function>initialDelay</function> milliseconds.  The timer
518will cause the <function>callback</function> functions to be invoked with increasing
519frequency until the <function>stop</function> action occurs.
520      </para>
521    </listitem>
522  </varlistentry>
523  <varlistentry>
524    <term>
525      <function>stop</function>()
526    </term>
527    <listitem>
528      <para>
529This invokes the functions on the <function>stopCallback</function> list and prevents any
530further timers from occurring until the next <function>start</function> action.
531    </para>
532  </listitem>
533  </varlistentry>
534</variablelist>
535</para>
536<para>
537<!-- .LP -->
538<!-- .sp -->
539<indexterm><primary>Repeater widget</primary><secondary>translation bindings</secondary></indexterm>
540The following are the default translation bindings used by the
541Repeater widget:
542</para>
543<para>
544<!-- .LP -->
545<literallayout class="monospaced">
546<!-- .TA .5i 2.25i -->
547<!-- .ta .5i 2.25i -->
548	&lt;EnterWindow&gt;:	highlight(&#x2006;)
549	&lt;LeaveWindow&gt;:	unhighlight(&#x2006;)
550	&lt;Btn1Down&gt;:	set(&#x2006;) start(&#x2006;)
551	&lt;Btn1Up&gt;:	stop(&#x2006;) unset(&#x2006;)
552</literallayout>
553</para>
554<para>
555<!-- .LP -->
556
557</para>
558</sect2>
559</sect1>
560