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

  1. .NH 2
  2. Command Widget
  3. .XS
  4.     Command Widget
  5. .XE
  6. .IN "Command widget" "" "@DEF@"
  7. .Ds 0
  8. .TA 2.0i
  9. .ta 2.0i
  10. .sp
  11. Application header file    <X11/Xaw/Command.h>
  12. .IN "Command.h" ""
  13. Class header file    <X11/Xaw/CommandP.h>
  14. .IN "CommandP.h" ""
  15. Class    commandWidgetClass
  16. .IN "commandWidgetClass" ""
  17. Class Name    Command
  18. .IN "Command widget" "class name"
  19. Superclass    Label
  20. .sp
  21. .De
  22. .LP
  23. The Command widget is an area, often rectangular, that contains a text
  24. label or bitmap image.  Those selectable areas are often referred to as
  25. "buttons".  When the pointer cursor is on a button, it becomes
  26. highlighted by drawing a rectangle around its perimeter.  This
  27. highlighting indicates that the button is ready for selection.  When
  28. pointer button 1 is pressed, the Command widget indicates that it has
  29. been selected by reversing its foreground and background colors.  When
  30. the button is released, the Command widget's \fBnotify\fP action will be
  31. invoked, calling all functions on its callback list.  If the pointer is
  32. moved out of the widget before the button is released, the widget
  33. reverts to its normal foreground and background colors, and releasing
  34. the button has no effect.  This behavior allows the user to cancel an
  35. action.
  36. .NH 3
  37. Resources
  38. .LP
  39. When creating a Command widget instance, the following resources are
  40. retrieved from the argument list or from the resource database:
  41. .LP
  42. .IN "Command 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. ancestorSensitive    AncestorSensitive    Boolean    D    True
  61. background    Background    Pixel        XtDefaultBackground
  62. backgroundPixmap    Pixmap    Pixmap        XtUnspecifiedPixmap
  63. bitmap    Bitmap    Pixmap        None
  64. borderColor    BorderColor    Pixel        XtDefaultForeground
  65. borderPixmap    Pixmap    Pixmap        XtUnspecifiedPixmap
  66. borderWidth    BorderWidth    Dimension        1
  67. callback    Callback    XtCallbackList        NULL
  68. colormap    Colormap    Colormap        Parent's Colormap
  69. cornerRoundPercent    CornerRoundPercent    Dimension        25
  70. cursor    Cursor    Cursor        None
  71. cursorName    Cursor    String        NULL
  72. depth    Depth    int    C    Parent's Depth
  73. destroyCallback    Callback    XtCallbackList        NULL
  74. encoding    Encoding    UnsignedChar        XawTextEncoding8bit
  75. font    Font    XFontStruct        XtDefaultFont
  76. foreground    Foreground    Pixel        XtDefaultForeground
  77. height    Height    Dimension    A    Font height + 2 * \fBinternalHeight\fP
  78. highlightThickness    Thickness    Dimension    A    2 (0 if Shaped)
  79. insensitiveBorder    Insensitive    Pixmap        GreyPixmap
  80. leftBitmap    LeftBitmap    Bitmap        None
  81. internalHeight    Height    Dimension        2
  82. internalWidth    Width    Dimension        4
  83. justify    Justify    Justify        XtJustifyCenter (center)
  84. label    Label    String        name of widget
  85. leftBitmap    LeftBitmap    Bitmap        None
  86. mappedWhenManaged    MappedWhenManaged    Boolean        True
  87. pointerColor    Foreground    Pixel        XtDefaultForeground
  88. pointerColorBackground    Background    Pixel        XtDefaultBackground
  89. resize    Resize    Boolean        True
  90. screen    Screen    Screen    R    Parent's Screen
  91. sensitive    Sensitive    Boolean        True
  92. shapeStyle    ShapeStyle    ShapeStyle        Rectangle
  93. translations    Translations    TranslationTable        See below
  94. width    Width    Dimension    A    \fBlabel\fP width + 2 * \fBinternalWidth\fP
  95. x    Position    Position        0
  96. y    Position    Position        0
  97. .sp 3p
  98. _
  99. .TE
  100. .ps 11
  101. .nr PS 11
  102. .vs 13
  103. .nr VS 13
  104. \" Resource Descriptions
  105. .Ac
  106. .As
  107. .Bg
  108. .Gp
  109. .Bm
  110. .Bc
  111. .Bp
  112. .Bw
  113. .Cb Bold
  114. .Cm
  115. .Cr Bold
  116. .Cu
  117. .Pn
  118. .Dp
  119. .Dc
  120. .Le
  121. .Lf
  122. .Lg
  123. .Hw
  124. .Ht Bold
  125. .Ib
  126. .Ih
  127. .Ju
  128. .La
  129. .Ll
  130. .Mm
  131. .Pf
  132. .Pb
  133. .Re
  134. .Sc
  135. .Se
  136. .Ss Bold
  137. .Tr
  138. .Xy
  139. .NH 3
  140. Command Actions
  141. .IN "Command widget" "actions"
  142. .LP
  143. The Command widget supports the following actions:
  144. .IP \(bu 5
  145. Switching the button's interior between the foreground and background
  146. colors with \fBset\fP, \fBunset\fP, and \fBreset\fP.
  147. .IP \(bu 5
  148. Processing application callbacks with \fBnotify\fP
  149. .IP \(bu 5
  150. Switching the internal border between highlighted
  151. and unhighlighted states with \fBhighlight\fP and \fBunhighlight\fP
  152. .LE
  153. .LP
  154. .IN "Command widget" "translation bindings"
  155. The following are the default translation bindings used by the
  156. Command widget: 
  157. .LP
  158. .Ds 0
  159. .TA .5i 2.25i
  160. .ta .5i 2.25i
  161.     <EnterWindow>:    highlight(\|)
  162.     <LeaveWindow>:    reset(\|)
  163.     <Btn1Down>:    set(\|)
  164.     <Btn1Up>:    notify(\|) unset(\|)
  165. .De
  166. .LP
  167. The full list of actions supported by Command is:
  168. .IP \fBhighlight\fP(\fIcondition\fP) 1.5i
  169. Displays the internal highlight border in the color (\fBforeground\fP
  170. or \fBbackground\fP ) that contrasts with the interior color of the
  171. Command widget.  The conditions \fBWhenUnset\fP and \fBAlways\fP are
  172. understood by this action procedure.  If no argument is passed,
  173. \fBWhenUnset\fP is assumed.
  174. .IP \fBunhighlight\fP(\|) 1.5i
  175. Displays the internal highlight border in the color (\fBforeground\fP
  176. or \fBbackground\fP ) that matches the interior color of the
  177. Command widget.  
  178. .IP \fBset\fP(\|) 1.5i
  179. Enters the \fIset\fP state, in which \fBnotify\fP is possible.  This
  180. action causes the button to display its interior in the
  181. \fBforeground\fP color.  The label or bitmap is displayed in the
  182. \fBbackground\fP color. 
  183. .IP \fBunset\fP(\|) 1.5i
  184. Cancels the \fIset\fP state and displays the interior of the button in the
  185. \fBbackground\fP color.  The label or bitmap is displayed in the
  186. \fBforeground\fP color.
  187. .IP \fBreset\fP(\|) 1.5i
  188. Cancels any \fIset\fP or \fIhighlight\fP and displays the interior of the
  189. button in the \fBbackground\fP color, with the label or bitmap displayed
  190. in the \fBforeground\fP color.
  191. .IP \fBnotify\fP(\|) 1.5i
  192. When the button is in the \fBset\fP state this action calls all functions in
  193. the callback list named by the \fBcallback\fP resource.  The value of
  194. the \fIcall_data\fP argument passed to these functions is undefined. 
  195. .LP
  196. .NT
  197. When a bitmap of depth greater that one (1) is specified the
  198. \fIset\fP(), \fIunset\fP(), and \fIreset\fP() actions have no effect,
  199. since there are no foreground and background colors used in a
  200. multi-plane pixmap.
  201. .NE
  202.