home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / doc / Xaw / Panner < prev    next >
Encoding:
Text File  |  1991-07-31  |  7.5 KB  |  251 lines

  1. .NH 2
  2. Panner Widget
  3. .LP
  4. .XS
  5.     Panner Widget
  6. .XE
  7. .IN "Panner widget" "" "@DEF@"
  8. .Ds 0
  9. .TA 2.0i
  10. .ta 2.0i
  11. .sp
  12. Application header file    <X11/Xaw/Panner.h>
  13. .IN "Panner.h" ""
  14. Class header file    <X11/Xaw/PannerP.h>
  15. .IN "PannerP.h" ""
  16. Class        pannerWidgetClass
  17. .IN "pannerWidgetClass" ""
  18. Class Name    Panner
  19. .IN "Panner widget" "class name"
  20. Superclass    Simple
  21. .sp
  22. .De
  23. .LP
  24. The Panner widget represents a rectangular region (called the ``canvas'') of 
  25. which only a smaller, enclosed rectangular region (called the ``slider'') by
  26. is visible at any given time.  It is typically
  27. used with a Porthole widget to scroll a third widget in two dimensions.
  28. .LP
  29. When a Panner is created, it is drawn with the slider in a contrasting
  30. color.  The slider may be moved around the canvas by pressing, dragging,
  31. and then releasing Button1.
  32. While scrolling is in progress, the application receives notification
  33. through callback procedures which it may use to update any associated 
  34. widgets.  Notification may be done either continuously whenever the slider
  35. moves or discretely whenever the slider has been given a new location.
  36. .NH 3
  37. Resources
  38. .LP
  39. When creating a Panner widget instance, the following resources are
  40. retrieved from the argument list or from the resource database:
  41. .LP
  42. .IN "Panner widget" "resources"
  43. .ps 9
  44. .nr PS 9
  45. .vs 11
  46. .nr VS 11
  47. .TS H
  48. expand;
  49. lw(1i) lw(1i) lw(1i) lw(.5i) lw(2i).
  50. _
  51. .sp 3p
  52. .TB
  53. Name    Class    Type    Notes    Default Value
  54. .sp 3p
  55. _
  56. .TH
  57. .R
  58. .sp 3p
  59. accelerators    Accelerators    AcceleratorTable        NULL
  60. allowOff    AllowOff    Boolean        False
  61. ancestorSensitive    AncestorSensitive    Boolean    D    True
  62. background    Background    Pixel        XtDefaultBackground
  63. backgroundPixmap    Pixmap    Pixmap        XtUnspecifiedPixmap
  64. backgroundStipple    BackgroundStipple    String        NULL
  65. borderColor    BorderColor    Pixel        XtDefaultForeground
  66. borderPixmap    Pixmap    Pixmap        XtUnspecifiedPixmap
  67. borderWidth    BorderWidth    Dimension        1
  68. canvasHeight    CanvasHeight    Dimension        0
  69. canvasWidth    CanvasWidth    Dimension        0
  70. colormap    Colormap    Colormap        Parent's Colormap
  71. cursor    Cursor    Cursor        None
  72. cursorName    Cursor    String        NULL
  73. defaultScale    DefaultScale    Dimension        8
  74. depth    Depth    int    C    Parent's Depth
  75. destroyCallback    Callback    XtCallbackList        NULL
  76. foreground    Foreground    Pixel        XtDefaultForeground
  77. height    Height    Dimension    A    depends on orientation
  78. internalSpace    InternalSpace    Dimension        4
  79. lineWidth    LineWidth    Dimension        0
  80. mappedWhenManaged    MappedWhenManaged    Boolean        True
  81. pointerColor    Foreground    Pixel        XtDefaultForeground
  82. pointerColorBackground    Background    Pixel        XtDefaultBackground
  83. reportCallback    ReportCallback    Callback        NULL
  84. resize    Resize    Boolean        True
  85. rubberBand    RubberBand    Boolean        False
  86. screen    Screen    Screen    R    Parent's Screen
  87. sensitive    Sensitive    Boolean        True
  88. shadowColor    ShadowColor    Pixel        XtDefaultForeground
  89. shadowThickness    ShadowThickness    Dimension        2
  90. sliderX    SliderX    Position        0
  91. sliderY    SliderY    Position        0
  92. sliderHeight    SliderHeight    Dimension        0
  93. sliderWidth    SliderWidth    Dimension        0
  94. translations    Translations    TranslationTable        See below
  95. width    Width    Dimension    A    depends on orientation
  96. x    Position    Position        0
  97. y    Position    Position        0
  98. .sp 3p
  99. _
  100. .TE
  101. .ps 11
  102. .nr PS 11
  103. .vs 13
  104. .nr VS 13
  105. .Ac
  106. .IP \fBallowOff\fP 1.5i
  107. Whether to allow the edges of the slider to go off the edges of the canvas.
  108. .As
  109. .Bg
  110. .Gp
  111. .IP \fBbackgroundStipple\fP 1.5i
  112. The name of a bitmap pattern to be used as the background for
  113. the area representing the canvas.
  114. .Bc
  115. .Bp
  116. .Bw
  117. .IP \fBcanvasHeight\fP 1.5i
  118. .br
  119. .ns
  120. .IP \fBcanvasWidth\fP 1.5i
  121. The size of the canvas.
  122. .Cm
  123. .Cu
  124. .Pn
  125. .IP \fBdefaultScale\fP 1.5i
  126. The percentage size that the Panner widget should have relative
  127. to the size of the canvas.
  128. .Dp
  129. .Dc
  130. .IP \fBforeground\fP 1.5i
  131. A pixel value which indexes the widget's colormap to derive the color
  132. used to draw the slider.
  133. .Hw
  134. .IP \fBinternalSpace\fP 1.5i
  135. The width of internal border in pixels between a slider representing the 
  136. full size of the canvas
  137. and the edge of the Panner widget.
  138. .IP \fBlineWidth\fP 1.5i
  139. The width of the lines in the rubberbanding rectangle when rubberbanding
  140. is in effect instead of continuous scrolling.  The default is 0.
  141. .Mm
  142. .Pf
  143. .Pb
  144. .IP \fBreportCallback\fP 1.5i
  145. All functions on this callback list are called when the
  146. \fBnotify\fP action is invoked.  See the \fBPanner Actions\fP section 
  147. for details.
  148. .IP \fBresize\fP 1.5i
  149. Whether or not to resize the panner whenever the canvas size is changed so
  150. that the \fBdefaultScale\fP is maintained.
  151. .IP \fBrubberBand\fP 1.5i
  152. Whether or not scrolling should be discrete (only moving a rubberbanded
  153. rectangle until the scrolling is done) or continuous (moving the slider
  154. itself).  This controls whether or not the \fBmove\fP action procedure also
  155. invokes the \fBnotify\fP action procedure.
  156. .Sc
  157. .Se
  158. .IP \fBshadowColor\fP 1.5i
  159. The color of the shadow underneath the slider.
  160. .IP \fBshadowThickness\fP 1.5i
  161. The width of the shadow underneath the slider.
  162. .IP \fBsliderX\fP 1.5i
  163. .br
  164. .ns
  165. .IP \fBsliderY\fP 1.5i
  166. The location of the slider in the coordinates of the canvas.
  167. .IP \fBsliderHeight\fP 1.5i
  168. .br
  169. .ns
  170. .IP \fBsliderWidth\fP 1.5i
  171. The size of the slider.
  172. .Tr
  173. .Xy
  174. .NH 3 
  175. Panner Actions
  176. .IN "Panner widget" "actions"
  177. .LP
  178. The actions supported by the Panner widget are:
  179. .IP \fBstart\fP() 1.5i
  180. This action begins movement of the slider.
  181. .IP \fBstop\fP() 1.5i
  182. This action ends movement of the slider.
  183. .IP \fBabort\fP() 1.5i
  184. This action ends movement of the slider and restores it to the position it
  185. held when the \fBstart\fP action was invoked.
  186. .IP \fBmove\fP() 1.5i
  187. This action moves the outline of the slider (if the \fBrubberBand\fP resource
  188. is True) or the slider itself (by invoking the \fBnotify\fP
  189. action procedure).
  190. .IP \fBpage\fP(\fIxamount\fP,\fIyamount\fP) 1.5i
  191. This action moves the slider by the specified amounts.  The format
  192. for the amounts is a signed or unsigned floating-point number (e.g., +1.0
  193. or \-.5) followed
  194. by either \fBp\fP indicating pages (slider sizes), or \fBc\fP indicating
  195. canvas sizes.  Thus, \fIpage(+0,+.5p)\fP represents vertical movement down
  196. one-half the height of the slider and \fIpage(0,0)\fP represents moving to
  197. the upper left corner of the canvas.
  198. .IP \fBnotify\fP() 1.5i
  199. This action informs the application of the slider's current position by 
  200. invoking the \fBreportCallback\fP functions registered by the application.
  201. .IP \fBset\fP(\fIwhat\fP,\fIvalue\fP) 1.5i
  202. This action changes the behavior of the Panner.  The \fIwhat\fP argument 
  203. must currently be the string \fBrubberband\fP and controls the value of 
  204. the \fBrubberBand\fP resource.  The \fIvalue\fP argument 
  205. may have one of the values \fBon\fP, \fBoff\fP, or \fBtoggle\fP.
  206. .LP
  207. .sp
  208. The default bindings for Panner are:
  209. .IN "Panner widget" "default translation table"
  210. .LP
  211. .Ds 0
  212. .TA .5i 1.75i
  213. .ta .5i 1.75i
  214.     <Btn1Down>:    start(\|)
  215.     <Btn1Motion>:    move(\|)
  216.     <Btn1Up>:    notify(\|) stop(\|)
  217.     <Btn2Down>:    abort(\|)
  218.     <Key>KP_Enter:    set(rubberband,toggle)
  219.     <Key>space:    page(+1p,+1p)
  220.     <Key>Delete:    page(\-1p,\-1p)
  221.     <Key>BackSpace:    page(\-1p,\-1p)
  222.     <Key>Left:    page(\-.5p,+0)
  223.     <Key>Right:    page(+.5p,+0)
  224.     <Key>Up:    page(+0,\-.5p)
  225.     <Key>Down:    page(+0,+.5p)
  226.     <Key>Home:    page(0,0)
  227. .De
  228. .NH 3
  229. Panner Callbacks
  230. .IN "Panner widget" "callbacks"
  231. .LP
  232. The functions registered on the \fBreportCallback\fP list are invoked by
  233. the \fBnotify\fP action as follows:
  234. .IN "ReportProc" "" "@DEF@"
  235. .FD 0
  236. void ReportProc(\fIpanner\fP, \fIclient_data\fP, \fIreport\fP)
  237. .br
  238.     Widget \fIpanner\fP;
  239. .br
  240.     XtPointer \fIclient_data\fP;
  241. .br
  242.     XtPointer \fIreport\fP;    /* (XawPannerReport *) */
  243. .FN
  244. .IP \fIpanner\fP 1i
  245. Specifies the Panner widget.
  246. .IP \fIclient_data\fP 1i
  247. Specifies the client data.
  248. .IP \fIreport\fP 1i
  249. Specifies a pointer to an \fBXawPannerReport\fP structure containing
  250. the location and size of the slider and the size of the canvas.
  251.