1XmArrowButtonGadget(library call) XmArrowButtonGadget(library call)
2
3
4
6 XmArrowButtonGadget — The ArrowButtonGadget widget class
7
9 #include <Xm/ArrowBG.h>
10
12 ArrowButtonGadget consists of a directional arrow surrounded by a bor‐
13 der shadow. When it is selected, the shadow changes to give the
14 appearance that the ArrowButtonGadget has been pressed in. When it is
15 unselected, the shadow reverts to give the appearance that the button
16 is released, or out.
17
18 ArrowButtonGadget holds the XmQTactivatable trait.
19
20 Classes
21 ArrowButtonGadget inherits behavior, resources, and traits from the
22 Object, RectObj, and XmGadget classes.
23
24 The class pointer is xmArrowButtonGadgetClass.
25
26 The class name is XmArrowButtonGadget.
27
28 New Resources
29 The following table defines a set of widget resources used by the pro‐
30 grammer to specify data. The programmer can also set the resource val‐
31 ues for the inherited classes to set attributes for this widget. To
32 reference a resource by name or by class in a .Xdefaults file, remove
33 the XmN or XmC prefix and use the remaining letters. To specify one of
34 the defined values for a resource in a .Xdefaults file, remove the Xm
35 prefix and use the remaining letters (in either lowercase or uppercase,
36 but include any underscores between words). The codes in the access
37 column indicate if the given resource can be set at creation time (C),
38 set by using XtSetValues (S), retrieved by using XtGetValues (G), or is
39 not applicable (N/A).
40
41 ┌───────────────────────────────────────────────────────────────────────────────────────────┐
42 │ │ XmArrowButtonGadget Res│ource Set │ │ │
43 │Name │ Class │ Type │ Default │ Access │
44 ├─────────────────────────┼──────────────────────────┼────────────────┼────────────┼────────┤
45 │XmNactivateCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
46 ├─────────────────────────┼──────────────────────────┼────────────────┼────────────┼────────┤
47 │XmNarmCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
48 ├─────────────────────────┼──────────────────────────┼────────────────┼────────────┼────────┤
49 │XmNarrowDirection │ XmCArrowDirection │ unsigned char │ XmARROW_UP │ CSG │
50 ├─────────────────────────┼──────────────────────────┼────────────────┼────────────┼────────┤
51 │XmNdetailShadowThickness │ XmCDetailShadowThickness │ Dimension │ 2 │ CSG │
52 ├─────────────────────────┼──────────────────────────┼────────────────┼────────────┼────────┤
53 │XmNdisarmCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
54 ├─────────────────────────┼──────────────────────────┼────────────────┼────────────┼────────┤
55 │XmNmultiClick │ XmCMultiClick │ unsigned char │ dynamic │ CSG │
56 ├─────────────────────────┼──────────────────────────┼────────────────┼────────────┼────────┤
57 └─────────────────────────┴──────────────────────────┴────────────────┴────────────┴────────┘
58 XmNactivateCallback
59 Specifies a list of callbacks that is called when the Arrow‐
60 ButtonGadget is activated. To activate the button, press and
61 release BSelect while the pointer is inside the ArrowButton‐
62 Gadget. Activating the ArrowButtonGadget also disarms it.
63 The reason sent by this callback is XmCR_ACTIVATE. This
64 callback uses the XmQTactivatable trait.
65
66 XmNarmCallback
67 Specifies a list of callbacks that is called when the Arrow‐
68 ButtonGadget is armed. To arm this widget, press BSelect
69 while the pointer is inside the ArrowButtonGadget. The rea‐
70 son sent by this callback is XmCR_ARM.
71
72 XmNarrowDirection
73 Sets the arrow direction. The values for this resource are
74
75 · XmARROW_UP
76
77 · XmARROW_DOWN
78
79 · XmARROW_LEFT
80
81 · XmARROW_RIGHT
82
83 XmNdetailShadowThickness
84 Specifies the thickness of the inside arrow shadows. The
85 default thickness is 2 pixels.
86
87 XmNdisarmCallback
88 Specifies a list of callbacks that is called when the Arrow‐
89 ButtonGadget is disarmed. To disarm this widget, press and
90 release BSelect while the pointer is inside the ArrowButton‐
91 Gadget. The reason sent by this callback is XmCR_DISARM.
92
93 XmNmultiClick
94 If a button click is followed by another button click within
95 the time span specified by the display's multiclick time and
96 this resource is set to XmMULTICLICK_DISCARD, the second
97 click is not processed. If this resource is set to XmMUL‐
98 TICLICK_KEEP, the event is processed and click_count is
99 incremented in the callback structure. When the ArrowButton‐
100 Gadget is not in a menu, the default value is XmMUL‐
101 TICLICK_KEEP.
102
103 Inherited Resources
104 XmArrowButtonGadget inherits behavior and resources from the super‐
105 classes described in the following tables. For a complete description
106 of each resource, refer to the reference page for that superclass.
107
108 ┌─────────────────────────────────────────────────────────────────────────────────────────────────┐
109 │ │ XmGadget │Resource Set │ │ │
110 │Name │ Class │ Type │ Default │ Access │
111 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
112 │XmNbackground │ XmCBackground │ Pixel │ dynamic │ CSG │
113 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
114 │XmNbackgroundPixmap │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
115 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
116 │XmNbottomShadowColor │ XmCBottomShadowColor │ Pixel │ dynamic │ CSG │
117 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
118 │XmNbottomShadowPixmap │ XmCBottomShadowPixmap │ Pixmap │ dynamic │ CSG │
119 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
120 │XmNhelpCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
121 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
122 │XmNforeground │ XmCForeground │ Pixel │ dynamic │ CSG │
123 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
124 │XmNhighlightColor │ XmCHighlightColor │ Pixel │ dynamic │ CSG │
125 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
126 │XmNhighlightOnEnter │ XmCHighlightOnEnter │ Boolean │ False │ CSG │
127 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
128 │XmNhighlightPixmap │ XmCHighlightPixmap │ Pixmap │ dynamic │ CSG │
129 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
130 │XmNhighlightThickness │ XmCHighlightThickness │ Dimension │ 2 │ CSG │
131 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
132 │XmNlayoutDirection │ XmNCLayoutDirection │ XmDirection │ dynamic │ CG │
133 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
134 │XmNnavigationType │ XmCNavigationType │ XmNavigationType │ XmNONE │ CSG │
135 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
136 │XmNshadowThickness │ XmCShadowThickness │ Dimension │ 2 │ CSG │
137 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
138 │XmNtopShadowColor │ XmCTopShadowColor │ Pixel │ dynamic │ CSG │
139 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
140 │XmNtopShadowPixmap │ XmCTopShadowPixmap │ Pixmap │ dynamic │ CSG │
141 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
142 │XmNtraversalOn │ XmCTraversalOn │ Boolean │ True │ CSG │
143 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
144 │XmNunitType │ XmCUnitType │ unsigned char │ dynamic │ CSG │
145 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
146 │XmNuserData │ XmCUserData │ XtPointer │ NULL │ CSG │
147 ├──────────────────────┼───────────────────────┼──────────────────┼──────────────────────┼────────┤
148 └──────────────────────┴───────────────────────┴──────────────────┴──────────────────────┴────────┘
149 ┌─────────────────────────────────────────────────────────────────────┐
150 │ │ RectObj Resour│ce Set │ │ │
151 │Name │ Class │ Type │ Default │ Access │
152 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
153 │XmNancestorSensitive │ XmCSensitive │ Boolean │ dynamic │ G │
154 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
155 │XmNborderWidth │ XmCBorderWidth │ Dimension │ 0 │ N/A │
156 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
157 │XmNheight │ XmCHeight │ Dimension │ dynamic │ CSG │
158 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
159 │XmNsensitive │ XmCSensitive │ Boolean │ True │ CSG │
160 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
161 │XmNwidth │ XmCWidth │ Dimension │ dynamic │ CSG │
162 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
163 │XmNx │ XmCPosition │ Position │ 0 │ CSG │
164 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
165 │XmNy │ XmCPosition │ Position │ 0 │ CSG │
166 ├─────────────────────┼────────────────┼───────────┼─────────┼────────┤
167 └─────────────────────┴────────────────┴───────────┴─────────┴────────┘
168 ┌─────────────────────────────────────────────────────────────────────┐
169 │ │ Object Re│source Set │ │ │
170 │Name │ Class │ Type │ Default │ Access │
171 ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
172 │XmNdestroyCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
173 ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
174 └───────────────────┴─────────────┴────────────────┴─────────┴────────┘
175 Callback Information
176 A pointer to the following structure is passed to each callback:
177
178 typedef struct
179 {
180 int reason;
181 XEvent * event;
182 int click_count;
183 } XmArrowButtonCallbackStruct;
184
185 reason Indicates why the callback was invoked.
186
187 event Points to the XEvent that triggered the callback.
188
189 click_count
190 This value is valid only when the reason is XmCR_ACTIVATE.
191 It contains the number of clicks in the last multiclick
192 sequence if the XmNmultiClick resource is set to XmMUL‐
193 TICLICK_KEEP, otherwise it contains 1. The activate callback
194 is invoked for each click if XmNmultiClick is set to XmMUL‐
195 TICLICK_KEEP.
196
197 Behavior
198 XmArrowButtonGadget includes behavior from XmGadget. The following
199 list describes additional XmArrowButtonGadget behavior:
200
201 <Btn1Down>:
202 Draws the shadow in the selected state and calls the call‐
203 backs for XmNarmCallback.
204
205 <Btn1Down> or <Btn1Up>:
206 Draws the shadow in the unselected state. If the pointer is
207 within the ArrowButtonGadget, calls the callbacks for XmNac‐
208 tivateCallback. Calls the callbacks for XmNdisarmCallback.
209
210 <Btn1Down>(2+):
211 If XmNmultiClick is XmMULTICLICK_DISCARD, this action does
212 nothing. If XmNmultiClick is XmMULTICLICK_KEEP, this action
213 draws the shadow in the selected state and calls the call‐
214 backs for XmNarmCallback.
215
216 <Btn1Up>(2+):
217 If XmNmultiClick is XmMULTICLICK_DISCARD, this action does
218 nothing.
219
220 If XmNmultiClick is XmMULTICLICK_KEEP, this action increments
221 click_count in the callback structure and draws the shadow in
222 the unselected state. If the pointer is within the ArrowBut‐
223 tonGadget, this action calls the callbacks for XmNactivate‐
224 Callback and XmNdisarmCallback.
225
226 <Key><osfSelect>:
227 Draws the shadow in the selected state and calls the call‐
228 backs for XmNarmCallback. Arranges for the shadow to be
229 drawn in the unselected state and the callbacks for XmNacti‐
230 vateCallback and XmNdisarmCallback to be called, either imme‐
231 diately or at a later time.
232
233 <Key><osfHelp>:
234 Calls the callbacks for XmNhelpCallback if any exist. If
235 there are no help callbacks for this widget, this action
236 calls the help callbacks for the nearest ancestor that has
237 them.
238
239 <Enter>: Draws the ArrowButtonGadget shadow in its selected state if
240 the pointer leaves and re-enters the gadget while <Btn1> is
241 pressed.
242
243 <Leave>: Draws the ArrowButtonGadget shadow in its unselected state if
244 the pointer leaves the gadget while <Btn1> is pressed.
245
246 Virtual Bindings
247 The bindings for virtual keys are vendor specific. For information
248 about bindings for virtual buttons and keys, see VirtualBindings(3).
249
251 Object(3), RectObj(3), XmCreateArrowButtonGadget(3), XmGadget(3),
252 XmVaCreateArrowButtonGadget(3), and XmVaCreateManagedArrowButtonGad‐
253 get(3).
254
255
256
257 XmArrowButtonGadget(library call)