1XmDragIcon(library call) XmDragIcon(library call)
2
3
4
6 XmDragIcon — The DragIcon widget class
7
9 #include <Xm/DragDrop.h>
10
12 A DragIcon is a component of the visual used to represent the source
13 data in a drag and drop transaction. During a drag operation, a real or
14 simulated X cursor provides drag-over visuals consisting of a static
15 portion that represents the object being dragged, and dynamic cues that
16 provide visual feedback during the drag operation. The visual is
17 attained by blending together various XmDragIcons specified in the
18 XmDragContext associated with the drag operation.
19
20 The static portion of the drag-over visual is the graphic representa‐
21 tion that identifies the drag source. For example, when a user drags
22 several items within a list, a DragIcon depicting a list might be sup‐
23 plied as the visual. The XmDragContext resources, XmNsourceCursorIcon
24 or XmNsourcePixmapIcon, specify a DragIcon to use for the static por‐
25 tion of the visual.
26
27 A drag-over visual incorporates dynamic cues in order to provide visual
28 feedback in response to the user's actions. For instance, the drag-over
29 visual might use different indicators to identify the type of operation
30 (copy, link, or move) being performed. Dynamic cues could also alert
31 the user that a drop site is valid or invalid as the pointer traverses
32 the drop site. The XmNoperationCursorIcon and XmNstateCursorIcon
33 resources of XmDragContext specify DragIcons for dynamic cues.
34
35 A drag-over visual typically consists of a source, operation and state
36 DragIcon. The XmNblendModel resource of XmDragContext offers several
37 options that determine which icons are blended to produce the drag-over
38 visual. DragIcon resources control the relative position of the opera‐
39 tion and state icons (if used). If a particular DragIcon is not speci‐
40 fied, the toolkit uses the XmScreen default DragIcons.
41
42 An application initializes a DragIcon with the function XmCreateDragI‐
43 con or through entries in the resource database. If a pixmap and its
44 mask (optional) are specified in the resource database, the toolkit
45 converts the values in the X11 Bitmap file format and assigns values to
46 the corresponding resources.
47
48 Classes
49 DragIcon inherits behavior and a resource from Object.
50
51 The class pointer is xmDragIconObjectClass.
52
53 The class name is XmDragIcon.
54
55 New Resources
56 The following table defines a set of widget resources used by the pro‐
57 grammer to specify data. The programmer can also set the resource val‐
58 ues for the inherited classes to set attributes for this widget. To
59 reference a resource by name or by class in a .Xdefaults file, remove
60 the XmN or XmC prefix and use the remaining letters. To specify one of
61 the defined values for a resource in a .Xdefaults file, remove the Xm
62 prefix and use the remaining letters (in either lowercase or uppercase,
63 but include any underscores between words). The codes in the access
64 column indicate if the given resource can be set at creation time (C),
65 set by using XtSetValues (S), retrieved by using XtGetValues (G), or is
66 not applicable (N/A).
67
68 ┌──────────────────────────────────────────────────────────────────────────────┐
69 │ │ XmD│ragIcon Resource│Set │ │
70 │Name │ Class │ Type │ Default │ Access │
71 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
72 │XmNattachment │ XmCAttachment │ unsigned char │ XmATTACH_NORTH_WEST │ CSG │
73 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
74 │XmNdepth │ XmCDepth │ int │ 1 │ CSG │
75 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
76 │XmNheight │ XmCHeight │ Dimension │ 0 │ CSG │
77 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
78 │XmNhotX │ XmCHot │ Position │ 0 │ CSG │
79 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
80 │XmNhotY │ XmCHot │ Position │ 0 │ CSG │
81 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
82 │XmNmask │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
83 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
84 │XmNoffsetX │ XmCOffset │ Position │ 0 │ CSG │
85 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
86 │XmNoffsetY │ XmCOffset │ Position │ 0 │ CSG │
87 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
88 │XmNpixmap │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
89 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
90 │XmNwidth │ XmCWidth │ Dimension │ 0 │ CSG │
91 ├──────────────┼───────────────┼───────────────┼──────────────────────┼────────┤
92 └──────────────┴───────────────┴───────────────┴──────────────────────┴────────┘
93 XmNattachment
94 Specifies a relative location on the source icon for the
95 attachment of the state or operation icon. The origin of the
96 state and operation icons is aligned with the specified com‐
97 pass point on the source icon. The XmNoffsetX and XmNoffsetY
98 resources can be used to further refine the icon positions.
99 The possible values are
100
101 XmATTACH_NORTH_WEST
102 Attaches the origin of the state or operation icon
103 to the northwest point on the source icon.
104
105 XmATTACH_NORTH
106 Attaches the origin of the state or operation icon
107 to the north point on the source icon.
108
109 XmATTACH_NORTH_EAST
110 Attaches the origin of the state or operation icon
111 to the northeast point on the source icon.
112
113 XmATTACH_EAST
114 Attaches the origin of the state or operation icon
115 to the east point on the source icon.
116
117 XmATTACH_SOUTH_EAST
118 Attaches the origin of the state or operation icon
119 to the southeast point on the source icon.
120
121 XmATTACH_SOUTH
122 Attaches the origin of the state or operation icon
123 to the south point on the source icon.
124
125 XmATTACH_SOUTH_WEST
126 Attaches the origin of the state or operation icon
127 to the southwest point on the source icon.
128
129 XmATTACH_WEST
130 Attaches the origin of the state or operation icon
131 to the west point on the source icon.
132
133 XmATTACH_CENTER
134 Attaches the origin of the state or operation icon
135 to the center of the source icon. The XmNoffsetX
136 and XmNoffsetY resources may be used to center the
137 attached icon.
138
139 XmATTACH_HOT
140 Attaches the hotspot coordinates of a state or
141 operation DragIcon to an x,y position on the source
142 icon. The x,y coordinate is taken from the event
143 passed to the XmDragStart function, and made rela‐
144 tive to the widget passed as an argument to the
145 same function.
146
147 XmNdepth Specifies the depth of the pixmap.
148
149 XmNheight Specifies the height of the pixmap.
150
151 XmNhotX Specifies the x-coordinate of the hotspot of a cursor DragI‐
152 con in relation to the origin of the pixmap bounding box.
153
154 XmNhotY Specifies the y-coordinate of the hotspot of a cursor DragI‐
155 con in relation to the origin of the pixmap bounding box.
156
157 XmNmask Specifies a pixmap of depth 1 to use as the DragIcon mask
158 pixmap.
159
160 XmNoffsetX
161 Specifies a horizontal offset (in pixels) of the origin of
162 the state or operation icon relative to the attachment point
163 on the source icon. A positive offset value moves the origin
164 to the right; a negative value moves the origin to the left.
165
166 XmNoffsetY
167 Specifies a vertical offset (in pixels) of the origin of the
168 state or operation icon relative to the attachment point on
169 the source icon. A positive offset value moves the origin
170 down; a negative value moves the origin up.
171
172 XmNpixmap Specifies a pixmap to use as the DragIcon pixmap.
173
174 XmNwidth Specifies the width of the pixmap.
175
176 Inherited Resources
177 DragIcon inherits behavior and a resource from Object. For a complete
178 description of this resource, refer to the Object reference page.
179
180 ┌─────────────────────────────────────────────────────────────────────┐
181 │ │ Object Re│source Set │ │ │
182 │Name │ Class │ Type │ Default │ Access │
183 ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
184 │XmNdestroyCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
185 ├───────────────────┼─────────────┼────────────────┼─────────┼────────┤
186 └───────────────────┴─────────────┴────────────────┴─────────┴────────┘
188 Object(3), XmCreateDragIcon(3), XmDisplay(3), XmDragContext(3), XmDrop‐
189 Site(3), XmDropTransfer(3), and XmScreen(3).
190
191
192
193 XmDragIcon(library call)