1 <sect1 id="Viewport_Widget">
2 <title>Viewport Widget</title>
6 <!-- Viewport Widget -->
8 <!-- .IN "Viewport widget" "" "@DEF@" -->
9 <literallayout class="monospaced">
13 Application Header file <X11/Xaw/Viewport.h>
14 <!-- .IN "Viewport.h" "" -->
15 Class Header file <X11/Xaw/ViewportP.h>
16 <!-- .IN "ViewportP.h" "" -->
17 Class viewportWidgetClass
18 <!-- .IN "viewportWidgetClass" "" -->
20 <!-- .IN "Viewport widget" "class name" -->
27 The Viewport widget consists of a frame window, one or two Scrollbars,
28 and an inner window. The size of the frame window is determined by the
29 viewing size of the data that is to be displayed and the dimensions to
30 which the Viewport is created. The inner window is the full size of the
31 data that is to be displayed and is clipped by the frame window. The
32 Viewport widget controls the scrolling of the data directly. No
33 application callbacks are required for scrolling.
37 When the geometry of the frame window is equal in size to the inner
38 window, or when the data does not require scrolling, the Viewport widget
39 automatically removes any scrollbars. The <function>forceBars</function> option causes
40 the Viewport widget to display all scrollbars permanently.
42 <sect2 id='Viewport::Resources'>
43 <title>Resources</title>
46 When creating a Viewport widget instance, the following resources are
47 retrieved from the argument list or the resource database:
51 <!-- .IN "Viewport widget" "resources" -->
53 <tgroup cols='5' align='center'>
54 <colspec colname='c1'/>
55 <colspec colname='c2'/>
56 <colspec colname='c3'/>
57 <colspec colname='c4'/>
58 <colspec colname='c5'/>
65 <entry>Default Value</entry>
70 <entry>accelerators</entry>
71 <entry>Accelerators</entry>
72 <entry>AcceleratorTable</entry>
77 <entry>allowHoriz</entry>
78 <entry>Boolean</entry>
79 <entry>Boolean</entry>
84 <entry>allowVert</entry>
85 <entry>Boolean</entry>
86 <entry>Boolean</entry>
91 <entry>ancestorSensitive</entry>
92 <entry>AncestorSensitive</entry>
93 <entry>Boolean</entry>
98 <entry>background</entry>
99 <entry>Background</entry>
102 <entry>XtDefaultBackground</entry>
105 <entry>backgroundPixmap</entry>
106 <entry>Pixmap</entry>
107 <entry>Pixmap</entry>
109 <entry>XtUnspecifiedPixmap</entry>
112 <entry>borderColor</entry>
113 <entry>BorderColor</entry>
116 <entry>XtDefaultForeground</entry>
119 <entry>borderPixmap</entry>
120 <entry>Pixmap</entry>
121 <entry>Pixmap</entry>
123 <entry>XtUnspecifiedPixmap</entry>
126 <entry>borderWidth</entry>
127 <entry>BorderWidth</entry>
128 <entry>Dimension</entry>
133 <entry>children</entry>
134 <entry>ReadOnly</entry>
135 <entry>WidgetList</entry>
140 <entry>colormap</entry>
141 <entry>Colormap</entry>
142 <entry>Colormap</entry>
144 <entry>Parent's Colormap</entry>
151 <entry>Parent's Depth</entry>
154 <entry>destroyCallback</entry>
155 <entry>Callback</entry>
156 <entry>XtCallbackList</entry>
161 <entry>forceBars</entry>
162 <entry>Boolean</entry>
163 <entry>Boolean</entry>
168 <entry>height</entry>
169 <entry>Height</entry>
170 <entry>Dimension</entry>
172 <entry>height of the child</entry>
175 <entry>mappedWhenManaged</entry>
176 <entry>MappedWhenManaged</entry>
177 <entry>Boolean</entry>
182 <entry>numChildren</entry>
183 <entry>ReadOnly</entry>
184 <entry>Cardinal</entry>
189 <entry>reportCallback</entry>
190 <entry>ReportCallback</entry>
191 <entry>XtCallbackList</entry>
196 <entry>screen</entry>
197 <entry>Screen</entry>
198 <entry>Screen</entry>
200 <entry>Parent's Screen</entry>
203 <entry>sensitive</entry>
204 <entry>Sensitive</entry>
205 <entry>Boolean</entry>
210 <entry>translations</entry>
211 <entry>Translations</entry>
212 <entry>TranslationTable</entry>
217 <entry>useBottom</entry>
218 <entry>Boolean</entry>
219 <entry>Boolean</entry>
224 <entry>useRight</entry>
225 <entry>Boolean</entry>
226 <entry>Boolean</entry>
233 <entry>Dimension</entry>
235 <entry>width of the child</entry>
239 <entry>Position</entry>
240 <entry>Position</entry>
246 <entry>Position</entry>
247 <entry>Position</entry>
261 <function>allowHoriz</function>
272 <function>allowVert</function>
276 If these resources are <function>False</function> then the Viewport will never create
277 a scrollbar in this direction. If it is <function>True</function> then the scrollbar will
278 only appear when it is needed, unless <function>forceBars</function> is <function>True</function>.
294 <function>forceBars</function>
298 When <function>True</function> the scrollbars that have been <emphasis remap='I'>allowed</emphasis> will always be
299 visible on the screen. If <function>False</function> the scrollbars will be visible only
300 when the inner window is larger than the frame.
309 <function>reportCallback</function>
313 These callbacks will be executed whenever the Viewport adjusts the viewed
314 area of the child. The call_data parameter is a pointer to an XawPannerReport
324 <function>useBottom</function>
335 <function>useRight</function>
339 By default the scrollbars appear on the left and top of the screen.
340 These resources allow the vertical scrollbar to be placed on the right
341 edge of the Viewport, and the horizontal scrollbar on the bottom edge of
350 <sect2 id='Viewport::Layout_Semantics'>
351 <title>Layout Semantics</title>
354 <!-- .IN "Viewport widget" "layout semantics" -->
355 The Viewport widget manages a single child widget. When the size of the
356 child is larger than the size of the Viewport, the user can interactively
357 move the child within the Viewport by repositioning the scrollbars.
361 The default size of the Viewport before it is realized is the width and/or
362 height of the child. After it is realized, the Viewport will allow its
363 child to grow vertically or horizontally if <function>allowVert</function> or
364 <function>allowHoriz</function> are set, respectively. If the corresponding vertical
365 or horizontal scrollbar is not enabled, the Viewport will propagate the
366 geometry request to its own parent and the child will be allowed to change
367 size only if the Viewport's parent allows it. Regardless of whether or not
368 scrollbars are enabled in the corresponding direction, if the child requests
369 a new size smaller than the Viewport size, the change will be allowed only
370 if the parent of the Viewport allows the Viewport to shrink to the
371 appropriate dimension.
375 The scrollbar children of the Viewport are named <function>horizontal</function> and
376 <function>vertical</function>. By using these names the programmer can specify resources
377 for the individual scrollbars. <xref linkend='XtSetValues' xrefstyle='select: title'/> can be used to modify
378 the resources dynamically once the widget ID has been obtained with
379 <function>XtNameToWidget</function>.
380 <!-- .IN "XtNameToWidget" "" -->
384 Although the Viewport is a Subclass of the Form, no resources for the Form
385 may be supplied for any of the children of the Viewport. These constraints
386 are managed internally and are not meant for public consumption.