1 | /* $Id: comctl.h 7 2000-10-27 21:27:02Z umoeller $ */
|
---|
2 |
|
---|
3 |
|
---|
4 | /*
|
---|
5 | *@@sourcefile comctl.h:
|
---|
6 | * header file for comctl.c. See remarks there.
|
---|
7 | *
|
---|
8 | * Note: Version numbering in this file relates to XWorkplace version
|
---|
9 | * numbering.
|
---|
10 | */
|
---|
11 |
|
---|
12 | /* Copyright (C) 1997-2000 Ulrich Mller.
|
---|
13 | * This file is part of the XWorkplace source package.
|
---|
14 | * XWorkplace is free software; you can redistribute it and/or modify
|
---|
15 | * it under the terms of the GNU General Public License as published
|
---|
16 | * by the Free Software Foundation, in version 2 as it comes in the
|
---|
17 | * "COPYING" file of the XWorkplace main distribution.
|
---|
18 | * This program is distributed in the hope that it will be useful,
|
---|
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
21 | * GNU General Public License for more details.
|
---|
22 | *
|
---|
23 | *@@include #define INCL_WINWINDOWMGR
|
---|
24 | *@@include #define INCL_WINMESSAGEMGR
|
---|
25 | *@@include #define INCL_WINDIALOGS
|
---|
26 | *@@include #define INCL_WINSTDCNR // for checkbox containers
|
---|
27 | *@@include #define INCL_WININPUT
|
---|
28 | *@@include #define INCL_WINSYS
|
---|
29 | *@@include #define INCL_WINSHELLDATA
|
---|
30 | *@@include #include <os2.h>
|
---|
31 | *@@include #include "comctl.h"
|
---|
32 | */
|
---|
33 |
|
---|
34 | #if __cplusplus
|
---|
35 | extern "C" {
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | #ifndef COMCTL_HEADER_INCLUDED
|
---|
39 | #define COMCTL_HEADER_INCLUDED
|
---|
40 |
|
---|
41 | /* ******************************************************************
|
---|
42 | * *
|
---|
43 | * "Menu button" control *
|
---|
44 | * *
|
---|
45 | ********************************************************************/
|
---|
46 |
|
---|
47 | BOOL ctlMakeMenuButton(HWND hwndButton,
|
---|
48 | HMODULE hmodMenu,
|
---|
49 | ULONG idMenu);
|
---|
50 |
|
---|
51 | /* ******************************************************************
|
---|
52 | * *
|
---|
53 | * Progress bars *
|
---|
54 | * *
|
---|
55 | ********************************************************************/
|
---|
56 |
|
---|
57 | /*
|
---|
58 | *@@ PROGRESSBARDATA:
|
---|
59 | * structure for progress bar data,
|
---|
60 | * saved at QWL_USER window ulong.
|
---|
61 | */
|
---|
62 |
|
---|
63 | typedef struct _PROGRESSBARDATA
|
---|
64 | {
|
---|
65 | ULONG ulNow,
|
---|
66 | ulMax,
|
---|
67 | ulPaintX,
|
---|
68 | ulOldPaintX;
|
---|
69 | ULONG ulAttr;
|
---|
70 | PFNWP OldStaticProc;
|
---|
71 | RECTL rclBar;
|
---|
72 | } PROGRESSBARDATA, *PPROGRESSBARDATA;
|
---|
73 |
|
---|
74 | #define WM_UPDATEPROGRESSBAR WM_USER+1000
|
---|
75 |
|
---|
76 | // status bar style attributes
|
---|
77 | #define PBA_NOPERCENTAGE 0x0000
|
---|
78 | #define PBA_ALIGNLEFT 0x0001
|
---|
79 | #define PBA_ALIGNRIGHT 0x0002
|
---|
80 | #define PBA_ALIGNCENTER 0x0003
|
---|
81 | #define PBA_PERCENTFLAGS 0x0003
|
---|
82 | #define PBA_BUTTONSTYLE 0x0010
|
---|
83 |
|
---|
84 | BOOL ctlProgressBarFromStatic(HWND hwndStatic, ULONG ulAttr);
|
---|
85 |
|
---|
86 | /* ******************************************************************
|
---|
87 | * *
|
---|
88 | * Chart Control *
|
---|
89 | * *
|
---|
90 | ********************************************************************/
|
---|
91 |
|
---|
92 | /*
|
---|
93 | *@@ CHARTDATA:
|
---|
94 | * chart data. This represents the
|
---|
95 | * data to be displayed.
|
---|
96 | *
|
---|
97 | * Used with the CHTM_SETCHARTDATA message
|
---|
98 | * and stored within CHARTCDATA (below).
|
---|
99 | */
|
---|
100 |
|
---|
101 | typedef struct _CHARTDATA
|
---|
102 | {
|
---|
103 | USHORT usStartAngle,
|
---|
104 | // angle to start with (0%).
|
---|
105 | // This must be in the range of 0 to 360 degrees,
|
---|
106 | // with 0 degrees being the rightmost point
|
---|
107 | // of the arc.
|
---|
108 | // All degree values are counter-clockwise from that point.
|
---|
109 | // Example: 90 will start the arc at the top.
|
---|
110 | usSweepAngle;
|
---|
111 | // the maximum angle to use for 100%.
|
---|
112 | // This must be in the range of 0 to 360 degrees,
|
---|
113 | // with 0 degrees being usStartAngle.
|
---|
114 | // All degree values are counter-clockwise from that point.
|
---|
115 | // Example 1: usStartAngle = 0 and usSweepAngle = 360
|
---|
116 | // will draw a full circle from the right.
|
---|
117 | // Example 2: usStartAngle = 180 and usSweepAngle = 270
|
---|
118 | // will draw a three-quarter angle from the left.
|
---|
119 | ULONG cValues;
|
---|
120 | // data item count; the arrays in *padValues and *palColors
|
---|
121 | // (and also *papszDescriptions, if CHS_DESCRIPTIONS is
|
---|
122 | // enabled in CHARTSTYLE) must have this many items.
|
---|
123 | double* padValues;
|
---|
124 | // pointer to an array of double values;
|
---|
125 | // the sum of all these will make up 100%
|
---|
126 | // in the chart (i.e. the usSweepAngle angle).
|
---|
127 | // If this is NULL, the chart displays nothing.
|
---|
128 | // Otherwise, this array must have cValues items.
|
---|
129 | LONG* palColors;
|
---|
130 | // pointer to an array of LONG RGB colors;
|
---|
131 | // each item in this array must correspond
|
---|
132 | // to an item in padValues.
|
---|
133 | // This _must_ be specified if padValues is != NULL.
|
---|
134 | // This array must have cValues items.
|
---|
135 | PSZ* papszDescriptions;
|
---|
136 | // pointer to an array of PSZs containing
|
---|
137 | // data descriptions. If this pointer is
|
---|
138 | // NULL, or CHARTSTYLE.ulStyle does not have
|
---|
139 | // CHS_DESCRIPTIONS set, no texts will be displayed.
|
---|
140 | // Otherwise, this array must have cValues items.
|
---|
141 | } CHARTDATA, *PCHARTDATA;
|
---|
142 |
|
---|
143 | // chart display mode: currently only PCF_PIECHART is supported.
|
---|
144 | #define CHS_PIECHART 0x0000
|
---|
145 |
|
---|
146 | // chart display flags (CHARTSTYLE.ulStyle):
|
---|
147 | #define CHS_SHADOW 0x0100 // draw shadow
|
---|
148 | #define CHS_3D_BRIGHT 0x0200 // draw 3D block in same color as surface;
|
---|
149 | // CHARTSTYLE.ulThickness defines thickness
|
---|
150 | #define CHS_3D_DARKEN 0x0600 // draw 3D block too, but darker
|
---|
151 | // compared to surface;
|
---|
152 | // CHARTSTYLE.ulThickness defines thickness
|
---|
153 |
|
---|
154 | #define CHS_DESCRIPTIONS 0x1000 // show descriptions
|
---|
155 | #define CHS_DESCRIPTIONS_3D 0x3000 // same as CHS_DESCRIPTIONS, but shaded
|
---|
156 |
|
---|
157 | #define CHS_SELECTIONS 0x4000 // allow data items to be selected
|
---|
158 |
|
---|
159 | /*
|
---|
160 | *@@ CHARTSTYLE:
|
---|
161 | *
|
---|
162 | */
|
---|
163 |
|
---|
164 | typedef struct _CHARTSTYLE
|
---|
165 | {
|
---|
166 | ULONG ulStyle; // CHS_* flags
|
---|
167 | ULONG ulThickness; // pie thickness (with CHS_3D_xxx) in pixels
|
---|
168 | double dPieSize; // size of the pie chart relative to the control
|
---|
169 | // size. A value of 1 would make the pie chart
|
---|
170 | // consume all available space. A value of .5
|
---|
171 | // would make the pie chart consume half of the
|
---|
172 | // control's space. The pie chart is always
|
---|
173 | // centered within the control.
|
---|
174 | double dDescriptions; // position of the slice descriptions on the pie
|
---|
175 | // relative to the window size. To calculate the
|
---|
176 | // description positions, the control calculates
|
---|
177 | // an invisible pie slice again, for which this
|
---|
178 | // value is used. So a value of 1 would make the
|
---|
179 | // descriptions appear on the outer parts of the
|
---|
180 | // window (not recommended). A value of .5 would
|
---|
181 | // make the descriptions appear in the center of
|
---|
182 | // an imaginary line between the pie's center
|
---|
183 | // and the pie slice's outer border.
|
---|
184 | // This should be chosen in conjunction with
|
---|
185 | // dPieSize as well. If this is equal to dPieSize,
|
---|
186 | // the descriptions appear on the border of the
|
---|
187 | // slice. If this is half dPieSize, the descriptions
|
---|
188 | // appear in the center of the pie slice. If this
|
---|
189 | // is larger than dPieSize, the descriptions appear
|
---|
190 | // outside the slice.
|
---|
191 | } CHARTSTYLE, *PCHARTSTYLE;
|
---|
192 |
|
---|
193 | /*
|
---|
194 | *@@ CHARTCDATA:
|
---|
195 | * pie chart control data. Composed from the various
|
---|
196 | * chart initialization data.
|
---|
197 | * Stored in QWL_USER of the subclassed static control.
|
---|
198 | * Not available to the application.
|
---|
199 | */
|
---|
200 |
|
---|
201 | typedef struct _CHARTCDATA
|
---|
202 | {
|
---|
203 | // data which is initialized upon creation:
|
---|
204 | PFNWP OldStaticProc; // old static window procedure (from WinSubclassWindow)
|
---|
205 |
|
---|
206 | // data which is initialized upon CHTM_SETCHARTDATA/CHTM_SETCHARTSTYLE:
|
---|
207 | HDC hdcMem; // memory device context for bitmap
|
---|
208 | HPS hpsMem; // memory presentation space for bitmap
|
---|
209 | CHARTDATA cd; // chart data: initialized to null values
|
---|
210 | CHARTSTYLE cs; // chart style: initialized to null values
|
---|
211 |
|
---|
212 | HBITMAP hbmChart; // chart bitmap (for quick painting)
|
---|
213 | HRGN* paRegions; // pointer to array of GPI regions for each data item
|
---|
214 |
|
---|
215 | // user interaction data:
|
---|
216 | LONG lSelected; // zero-based index of selected chart item, or -1 if none
|
---|
217 | BOOL fHasFocus;
|
---|
218 | } CHARTCDATA, *PCHARTCDATA;
|
---|
219 |
|
---|
220 | HBITMAP ctlCreateChartBitmap(HPS hpsMem,
|
---|
221 | LONG lcx,
|
---|
222 | LONG lcy,
|
---|
223 | PCHARTDATA pChartData,
|
---|
224 | PCHARTSTYLE pChartStyle,
|
---|
225 | LONG lBackgroundColor,
|
---|
226 | LONG lTextColor,
|
---|
227 | HRGN* paRegions);
|
---|
228 |
|
---|
229 | BOOL ctlChartFromStatic(HWND hwndStatic);
|
---|
230 |
|
---|
231 | #define CHTM_SETCHARTDATA WM_USER + 2
|
---|
232 |
|
---|
233 | #define CHTM_SETCHARTSTYLE WM_USER + 3
|
---|
234 |
|
---|
235 | #define CHTM_ITEMFROMPOINT WM_USER + 4
|
---|
236 |
|
---|
237 | /* ******************************************************************
|
---|
238 | * *
|
---|
239 | * Split bars *
|
---|
240 | * *
|
---|
241 | ********************************************************************/
|
---|
242 |
|
---|
243 | #define WC_SPLITWINDOW "SplitWindowClass"
|
---|
244 |
|
---|
245 | #define SBCF_VERTICAL 0x0000
|
---|
246 | #define SBCF_HORIZONTAL 0x0001
|
---|
247 |
|
---|
248 | #define SBCF_PERCENTAGE 0x0002
|
---|
249 | #define SBCF_3DSUNK 0x0100
|
---|
250 | #define SBCF_MOVEABLE 0x1000
|
---|
251 |
|
---|
252 | /*
|
---|
253 | *@@ SPLITBARCDATA:
|
---|
254 | * split bar creation data
|
---|
255 | */
|
---|
256 |
|
---|
257 | typedef struct _SPLITBARCDATA
|
---|
258 | {
|
---|
259 | ULONG ulSplitWindowID;
|
---|
260 | // window ID of the split window
|
---|
261 | ULONG ulCreateFlags;
|
---|
262 | // split window style flags.
|
---|
263 | // One of the following:
|
---|
264 | // -- SBCF_VERTICAL: the split bar will be vertical.
|
---|
265 | // -- SBCF_HORIZONTAL: the split bar will be horizontal.
|
---|
266 | // plus any or none of the following:
|
---|
267 | // -- SBCF_PERCENTAGE: lPos does not specify absolute
|
---|
268 | // coordinates, but a percentage of the window
|
---|
269 | // width or height. In that case, the split
|
---|
270 | // bar position is not fixed, but always recalculated
|
---|
271 | // as a percentage.
|
---|
272 | // Otherwise, the split bar will be fixed.
|
---|
273 | // -- SBCF_3DSUNK: draw a "sunk" 3D frame around the
|
---|
274 | // split windows.
|
---|
275 | // -- SBCF_MOVEABLE: the split bar may be moved with
|
---|
276 | // the mouse.
|
---|
277 | LONG lPos;
|
---|
278 | // position of the split bar within hwndParentAndOwner.
|
---|
279 | // If SBCF_PERCENTAGE, this has the percentage;
|
---|
280 | // otherwise:
|
---|
281 | // if this value is positive, it's considered
|
---|
282 | // an offset from the left/bottom of the frame;
|
---|
283 | // if it's negative, it's from the right
|
---|
284 | ULONG ulLeftOrBottomLimit,
|
---|
285 | ulRightOrTopLimit;
|
---|
286 | // when moving the split bar (SBCF_MOVEABLE), these
|
---|
287 | // are the minimum and maximum values.
|
---|
288 | // ulLeftOrBottomLimit is the left (or bottom) limit,
|
---|
289 | // ulRightOrTopLimit is the right (or top) limit.
|
---|
290 | // Both are offsets in window coordinates from the
|
---|
291 | // left (or bottom) and right (or top) boundaries of
|
---|
292 | // the split window. If both are 0, the whole split
|
---|
293 | // window is allowed (not recommended).
|
---|
294 | HWND hwndParentAndOwner;
|
---|
295 | // the owner and parent of the split bar
|
---|
296 | // and other windows; this must be the FID_CLIENT
|
---|
297 | // of a frame or another split window (when nesting)
|
---|
298 | } SPLITBARCDATA, *PSPLITBARCDATA;
|
---|
299 |
|
---|
300 | /*
|
---|
301 | *@@ SPLITBARDATA:
|
---|
302 | * internal split bar data,
|
---|
303 | * stored in QWL_USER window ulong
|
---|
304 | */
|
---|
305 |
|
---|
306 | typedef struct _SPLITBARDATA
|
---|
307 | {
|
---|
308 | SPLITBARCDATA sbcd;
|
---|
309 | PFNWP OldStaticProc;
|
---|
310 | // RECTL rclBar;
|
---|
311 | HPOINTER hptrOld, // old pointer stored upon WM_MOUSEMOVE
|
---|
312 | hptrMove; // PM move pointer, either vertical or horizontal
|
---|
313 | BOOL fCaptured;
|
---|
314 | POINTS ptsMousePos;
|
---|
315 | POINTL ptlDrawLineFrom,
|
---|
316 | ptlDrawLineTo;
|
---|
317 | HPS hpsTrackBar;
|
---|
318 | HWND hwndLinked1,
|
---|
319 | // the left/bottom window to link
|
---|
320 | hwndLinked2;
|
---|
321 | // the right/top window to link
|
---|
322 | } SPLITBARDATA, *PSPLITBARDATA;
|
---|
323 |
|
---|
324 | #define ID_SPLITBAR 5000 // fixed ID of the split bar
|
---|
325 | // (child of split window)
|
---|
326 |
|
---|
327 | /*
|
---|
328 | *@@ SPLM_SETLINKS:
|
---|
329 | * this specifies the windows which the
|
---|
330 | * split window will link. This updates
|
---|
331 | * the internal SPLITBARDATA and changes
|
---|
332 | * the parents of the two subwindows to
|
---|
333 | * the split window.
|
---|
334 | *
|
---|
335 | * Parameters:
|
---|
336 | * HWND mp1: left or bottom subwindow
|
---|
337 | * HWND mp2: right or top subwindow
|
---|
338 | */
|
---|
339 |
|
---|
340 | #define SPLM_SETLINKS (WM_USER + 500)
|
---|
341 |
|
---|
342 | HWND ctlCreateSplitWindow(HAB hab,
|
---|
343 | PSPLITBARCDATA psbcd);
|
---|
344 |
|
---|
345 | BOOL ctlUpdateSplitWindow(HWND hwndSplit);
|
---|
346 |
|
---|
347 | BOOL ctlSetSplitFrameWindowPos(HWND hwndFrame,
|
---|
348 | HWND hwndInsertBehind,
|
---|
349 | LONG x,
|
---|
350 | LONG y,
|
---|
351 | LONG cx,
|
---|
352 | LONG cy,
|
---|
353 | ULONG fl,
|
---|
354 | HWND *pahwnd,
|
---|
355 | ULONG cbhwnd);
|
---|
356 |
|
---|
357 | LONG ctlQuerySplitPos(HWND hwndSplit);
|
---|
358 |
|
---|
359 | /* ******************************************************************
|
---|
360 | * *
|
---|
361 | * Subclassed Static Bitmap Control *
|
---|
362 | * *
|
---|
363 | ********************************************************************/
|
---|
364 |
|
---|
365 | // flags for ANIMATIONDATA.ulFlags
|
---|
366 | #define ANF_ICON 0x0001
|
---|
367 | #define ANF_BITMAP 0x0002
|
---|
368 | #define ANF_PROPORTIONAL 0x0004
|
---|
369 |
|
---|
370 | /*
|
---|
371 | *@@ ANIMATIONDATA:
|
---|
372 | * this structure gets stored in QWL_USER
|
---|
373 | * before subclassing the static control
|
---|
374 | *
|
---|
375 | *@@changed V0.9.0: added fields for bitmap support
|
---|
376 | */
|
---|
377 |
|
---|
378 | typedef struct _ANIMATIONDATA
|
---|
379 | {
|
---|
380 | // the following need to be initialized before
|
---|
381 | // subclassing
|
---|
382 | HAB hab; // (added V0.9.0)
|
---|
383 | ULONG ulFlags;
|
---|
384 | // one of the following:
|
---|
385 | // -- ANF_ICON: display icons
|
---|
386 | // -- ANF_BITMAP: display bitmaps
|
---|
387 | // -- ANF_BITMAP | ANF_PROPORTIONAL: display bitmaps, but preserve proportions
|
---|
388 | RECTL rclIcon; // size of static control
|
---|
389 | PFNWP OldStaticProc; // original WC_STATIC wnd proc
|
---|
390 |
|
---|
391 | // the following are set by fnwpSubclassedStatic upon
|
---|
392 | // receiving SM_SETHANDLE (in all modes) or later
|
---|
393 | HBITMAP hbm, // bitmap to be painted upon WM_PAINT
|
---|
394 | hbmHalftoned; // bitmap in case of WS_DISABLED (added V0.9.0)
|
---|
395 | HPOINTER hptr; // icon handle passed to SM_SETHANDLE
|
---|
396 | HBITMAP hbmSource; // bitmap handle passed to SM_SETHANDLE
|
---|
397 | // (this can be deleted later) (added V0.9.0)
|
---|
398 |
|
---|
399 | // the following need to be initialized
|
---|
400 | // for icon mode only (ANF_ICON)
|
---|
401 | ULONG ulDelay; // delay per animation step in ms
|
---|
402 | USHORT usAniCurrent; // current animation step (>= 0)
|
---|
403 |
|
---|
404 | USHORT usAniCount; // no. of animation steps
|
---|
405 | HPOINTER ahptrAniIcons[1]; // variable-size array of animation steps;
|
---|
406 | // there must be usAniCount items
|
---|
407 | } ANIMATIONDATA, *PANIMATIONDATA;
|
---|
408 |
|
---|
409 | PANIMATIONDATA ctlPrepareStaticIcon(HWND hwndStatic, USHORT usAnimCount);
|
---|
410 |
|
---|
411 | BOOL ctlPrepareAnimation(HWND hwndStatic,
|
---|
412 | USHORT usAnimCount,
|
---|
413 | HPOINTER *pahptr,
|
---|
414 | ULONG ulDelay,
|
---|
415 | BOOL fStartAnimation);
|
---|
416 |
|
---|
417 | BOOL ctlStartAnimation(HWND hwndStatic);
|
---|
418 |
|
---|
419 | BOOL ctlStopAnimation(HWND hwndStatic);
|
---|
420 |
|
---|
421 | PANIMATIONDATA ctlPrepareStretchedBitmap(HWND hwndStatic,
|
---|
422 | BOOL fPreserveProportions);
|
---|
423 |
|
---|
424 |
|
---|
425 | /* ******************************************************************
|
---|
426 | * *
|
---|
427 | * "Tooltip" control *
|
---|
428 | * *
|
---|
429 | ********************************************************************/
|
---|
430 |
|
---|
431 | // addt'l tooltip window styles: use lower 16 bits
|
---|
432 | #define TTS_ALWAYSTIP 0x0001
|
---|
433 | #define TTS_NOPREFIX 0x0002
|
---|
434 | // non-Win95 flags
|
---|
435 | #define TTS_ROUNDED 0x0004
|
---|
436 | #define TTS_SHADOW 0x0008
|
---|
437 |
|
---|
438 | // TOOLINFO.uFlags flags (ORed)
|
---|
439 | #define TTF_IDISHWND 0x0001
|
---|
440 | #define TTF_CENTERTIP 0x0002
|
---|
441 | #define TTF_RTLREADING 0x0004
|
---|
442 | #define TTF_SUBCLASS 0x0008
|
---|
443 | // non-Win95 flags
|
---|
444 | #define TTF_SHYMOUSE 0x0010
|
---|
445 |
|
---|
446 | #define LPSTR_TEXTCALLBACK (PSZ)-1
|
---|
447 |
|
---|
448 | #define TT_SHADOWOFS 10
|
---|
449 | #define TT_ROUNDING 8
|
---|
450 |
|
---|
451 | /*
|
---|
452 | *@@ TOOLINFO:
|
---|
453 | * info structure to register a tool with a
|
---|
454 | * tooltip control. Used with TTM_ADDTOOL
|
---|
455 | * and many other TTM_* messages.
|
---|
456 | */
|
---|
457 |
|
---|
458 | typedef struct _TOOLINFO
|
---|
459 | {
|
---|
460 | ULONG /* UINT */ cbSize; // in: sizeof(TOOLINFO)
|
---|
461 | ULONG /* UINT */ uFlags;
|
---|
462 | // in: flags for the tool, any combination of:
|
---|
463 | // -- TTF_IDISHWND: Indicates that the uId member is the window
|
---|
464 | // handle to the tool. If this flag is not set, uId is
|
---|
465 | // the identifier of the tool.
|
---|
466 | // -- TTF_CENTERTIP: Centers the tooltip window below the
|
---|
467 | // tool specified by the uId member.
|
---|
468 | // -- TTF_RTLREADING: Windows 95 only: Displays text using
|
---|
469 | // right-to-left reading order on Hebrew or Arabic systems.
|
---|
470 | // (Ignored on OS/2).
|
---|
471 | // -- TTF_SUBCLASS: Indicates that the tooltip control should
|
---|
472 | // subclass the tool's window to intercept messages,
|
---|
473 | // such as WM_MOUSEMOVE. See TTM_RELAYEVENT.
|
---|
474 | // -- TTF_SHYMOUSE (OS/2 only): shy away from mouse pointer;
|
---|
475 | // always position the tool tip such that it is never
|
---|
476 | // covered by the mouse pointer (for readability);
|
---|
477 | // added V0.9.1 (2000-02-04) [umoeller]
|
---|
478 | HWND hwnd;
|
---|
479 | // in: handle to the window that contains the tool. If
|
---|
480 | // lpszText includes the LPSTR_TEXTCALLBACK value, this
|
---|
481 | // member identifies the window that receives TTN_NEEDTEXT
|
---|
482 | // notification messages.
|
---|
483 | ULONG /* UINT */ uId;
|
---|
484 | // in: application-defined identifier of the tool. If uFlags
|
---|
485 | // includes the TTF_IDISHWND value, uId must specify the
|
---|
486 | // window handle to the tool.
|
---|
487 | RECTL /* RECT */ rect;
|
---|
488 | // in: coordinates of the bounding rectangle of the tool.
|
---|
489 | // The coordinates are relative to the upper-left corner of
|
---|
490 | // the client area of the window identified by hwnd. If
|
---|
491 | // uFlags includes the TTF_IDISHWND value, this member is
|
---|
492 | // ignored.
|
---|
493 | HMODULE /* HINSTANCE */ hinst;
|
---|
494 | // in: handle to the instance that contains the string
|
---|
495 | // resource for the tool. If lpszText specifies the identifier
|
---|
496 | // of a string resource, this member is used.
|
---|
497 | // Note: On Win32, this is an HINSTANCE field. On OS/2,
|
---|
498 | // this is a HMODULE field. The field name is retained for
|
---|
499 | // compatibility.
|
---|
500 | PSZ /* LPTSTR */ lpszText;
|
---|
501 | // in: pointer to the buffer that contains the text for the
|
---|
502 | // tool (if the hiword is != NULL), or identifier of the string
|
---|
503 | // resource that contains the text (if the hiword == NULL).
|
---|
504 | // If this member is set to the LPSTR_TEXTCALLBACK value,
|
---|
505 | // the control sends the TTN_NEEDTEXT notification message to
|
---|
506 | // the owner window to retrieve the text.
|
---|
507 | } TOOLINFO, *PTOOLINFO;
|
---|
508 |
|
---|
509 | #define TTM_FIRST (WM_USER + 1000)
|
---|
510 |
|
---|
511 | #define TTM_ACTIVATE (TTM_FIRST + 1)
|
---|
512 |
|
---|
513 | #define TTM_ADDTOOL (TTM_FIRST + 2)
|
---|
514 |
|
---|
515 | #define TTM_DELTOOL (TTM_FIRST + 3)
|
---|
516 |
|
---|
517 | #define TTM_NEWTOOLRECT (TTM_FIRST + 4)
|
---|
518 |
|
---|
519 | #define TTM_RELAYEVENT (TTM_FIRST + 5)
|
---|
520 |
|
---|
521 | // flags for TTM_SETDELAYTIME
|
---|
522 | #define TTDT_AUTOMATIC 1
|
---|
523 | #define TTDT_AUTOPOP 2
|
---|
524 | #define TTDT_INITIAL 3
|
---|
525 | #define TTDT_RESHOW 4
|
---|
526 |
|
---|
527 | #define TTM_SETDELAYTIME (TTM_FIRST + 6)
|
---|
528 |
|
---|
529 | /*
|
---|
530 | *@@ NMHDR:
|
---|
531 | * structure used with TOOLTIPTEXT;
|
---|
532 | * under Win32, this is a generic structure which
|
---|
533 | * comes with all WM_NOTIFY messages.
|
---|
534 | */
|
---|
535 |
|
---|
536 | typedef struct _NMHDR
|
---|
537 | {
|
---|
538 | HWND hwndFrom; // control sending the message
|
---|
539 | ULONG idFrom; // ID of that control
|
---|
540 | USHORT code; // notification code
|
---|
541 | } NMHDR, *PNMHDR;
|
---|
542 |
|
---|
543 | /*
|
---|
544 | *@@ TOOLTIPTEXT:
|
---|
545 | * identifies a tool for which text is to be displayed and
|
---|
546 | * receives the text for the tool.
|
---|
547 | *
|
---|
548 | * This structure is used with the TTN_NEEDTEXT notification.
|
---|
549 | */
|
---|
550 |
|
---|
551 | typedef struct _TOOLTIPTEXT
|
---|
552 | {
|
---|
553 | NMHDR hdr; // on Win95, this is required for all WM_NOTIFY msgs
|
---|
554 | PSZ /* LPTSTR */ lpszText;
|
---|
555 | // out: pointer to a string that contains or receives the text
|
---|
556 | // for a tool. If hinst specifies an instance handle, this
|
---|
557 | // member must be the identifier of a string resource.
|
---|
558 | char szText[80];
|
---|
559 | // out: buffer that receives the tooltip text. An application can
|
---|
560 | // copy the text to this buffer as an alternative to specifying a
|
---|
561 | // string address or string resource.
|
---|
562 | HMODULE /* HINSTANCE */ hinst;
|
---|
563 | // out: handle to the instance (OS/2: module) that contains a string
|
---|
564 | // resource to be used as the tooltip text. If lpszText is the
|
---|
565 | // pointer to the tooltip text, this member is NULL.
|
---|
566 | // Note: On Win32, this is an HINSTANCE field. On OS/2,
|
---|
567 | // this is a HMODULE field. The field name is retained for
|
---|
568 | // compatibility.
|
---|
569 | ULONG /* UINT */ uFlags;
|
---|
570 | // in: flag that indicates how to interpret the idFrom member of
|
---|
571 | // the NMHDR structure that is included in the structure. If this
|
---|
572 | // member is the TTF_IDISHWND value, idFrom is the handle of the
|
---|
573 | // tool. Otherwise, idFrom is the identifier of the tool.
|
---|
574 | // Windows 95 only: If this member is the TTF_RTLREADING value,
|
---|
575 | // then text on Hebrew or Arabic systems is displayed using
|
---|
576 | // right-to-left reading order. (Ignored on OS/2.)
|
---|
577 | } TOOLTIPTEXT, *PTOOLTIPTEXT;
|
---|
578 |
|
---|
579 | #define TTM_GETTEXT (TTM_FIRST + 7)
|
---|
580 |
|
---|
581 | #define TTM_UPDATETIPTEXT (TTM_FIRST + 8)
|
---|
582 |
|
---|
583 | /*
|
---|
584 | *@@ TT_HITTESTINFO:
|
---|
585 | * contains information that a tooltip control uses to determine whether
|
---|
586 | * a point is in the bounding rectangle of the specified tool. If the point
|
---|
587 | * is in the rectangle, the structure receives information about the tool.
|
---|
588 | *
|
---|
589 | * This structure is used with the TTM_HITTEST message.
|
---|
590 | */
|
---|
591 |
|
---|
592 | typedef struct _TT_HITTESTINFO
|
---|
593 | {
|
---|
594 | HWND hwnd; // in: handle to the tool or window with the specified tool.
|
---|
595 | POINTL /* POINT */ pt;
|
---|
596 | // in: client coordinates of the point to test (Win95: POINT)
|
---|
597 | TOOLINFO ti; // out: receives information about the specified tool.
|
---|
598 | } TTHITTESTINFO, *PHITTESTINFO;
|
---|
599 |
|
---|
600 | #define TTM_HITTEST (TTM_FIRST + 9)
|
---|
601 |
|
---|
602 | #define TTM_WINDOWFROMPOINT (TTM_FIRST + 10)
|
---|
603 |
|
---|
604 | #define TTM_ENUMTOOLS (TTM_FIRST + 11)
|
---|
605 |
|
---|
606 | #define TTM_GETCURRENTTOOL (TTM_FIRST + 12)
|
---|
607 |
|
---|
608 | #define TTM_GETTOOLCOUNT (TTM_FIRST + 13)
|
---|
609 |
|
---|
610 | #define TTM_GETTOOLINFO (TTM_FIRST + 14)
|
---|
611 |
|
---|
612 | #define TTM_SETTOOLINFO (TTM_FIRST + 15)
|
---|
613 |
|
---|
614 | // non-Win95 messages
|
---|
615 |
|
---|
616 | #define TTM_SHOWTOOLTIPNOW (TTM_FIRST + 16)
|
---|
617 |
|
---|
618 | /*
|
---|
619 | *@@ TTN_NEEDTEXT:
|
---|
620 | * control notification sent with the WM_NOTIFY (Win95)
|
---|
621 | * and WM_CONTROL (OS/2) messages.
|
---|
622 | *
|
---|
623 | * Parameters (OS/2, incompatible with Win95):
|
---|
624 | * -- mp1 USHORT usID;
|
---|
625 | * USHORT usNotifyCode == TTN_NEEDTEXT
|
---|
626 | * -- PTOOLTIPTEXT mp2: pointer to a TOOLTIPTEXT structure.
|
---|
627 | * The hdr member identifies the tool for which text is needed. The
|
---|
628 | * receiving window can specify the string by taking one of the
|
---|
629 | * following actions:
|
---|
630 | * -- Copying the text to the buffer specified by the szText member.
|
---|
631 | * -- Copying the address of the buffer that contains the text to the
|
---|
632 | * lpszText member.
|
---|
633 | * -- Copying the identifier of a string resource to the lpszText
|
---|
634 | * member and copying the handle of the instance that contains
|
---|
635 | * the resource to the hinst member.
|
---|
636 | *
|
---|
637 | * This notification message is sent to the window specified
|
---|
638 | * in the hwnd member of the TOOLINFO structure for the tool.
|
---|
639 | * This notification is sent only if the LPSTR_TEXTCALLBACK
|
---|
640 | * value is specified when the tool is added to a tooltip control.
|
---|
641 | *
|
---|
642 | * Windows 95 only: When a TTN_NEEDTEXT notification is received,
|
---|
643 | * the application can set or clear the TTF_RTLREADING value
|
---|
644 | * in the uFlags member of the TOOLTIPTEXT structure pointed to
|
---|
645 | * by lpttt as required. This is the only flag that can be changed
|
---|
646 | * during the notification callback.
|
---|
647 | *
|
---|
648 | * OS/2 only: Specifying LPSTR_TEXTCALLBACK in TOOLINFO.lpszText
|
---|
649 | * with TTM_ADDTOOL is the only way under OS/2 to have strings
|
---|
650 | * displayed which are longer than 256 characters, since string
|
---|
651 | * resources are limited to 256 characters with OS/2. It is the
|
---|
652 | * responsibility of the application to set the lpszText member
|
---|
653 | * to a static string buffer which holds the string for the tool.
|
---|
654 | * A common error would be to have that member point to some
|
---|
655 | * variable which has only been allocated on the stack.
|
---|
656 | */
|
---|
657 |
|
---|
658 | #define TTN_NEEDTEXT 1000
|
---|
659 |
|
---|
660 | /*
|
---|
661 | *@@ TTN_SHOW:
|
---|
662 | * control notification sent with the WM_NOTIFY (Win95)
|
---|
663 | * and WM_CONTROL (OS/2) messages.
|
---|
664 | *
|
---|
665 | * Parameters (OS/2, incompatible with Win95):
|
---|
666 | * -- mp1 USHORT usID;
|
---|
667 | * USHORT usNotifyCode == TTN_NEEDTEXT
|
---|
668 | * -- ULONG mp2: identifier of the tool, as in TOOLINFO.uId.
|
---|
669 | *
|
---|
670 | * Return value: always 0.
|
---|
671 | *
|
---|
672 | * The TTN_SHOW notification message notifies the owner window
|
---|
673 | * that a tooltip is about to be displayed.
|
---|
674 | */
|
---|
675 |
|
---|
676 | #define TTN_SHOW 1001
|
---|
677 |
|
---|
678 | /*
|
---|
679 | *@@ TTN_POP:
|
---|
680 | * control notification sent with the WM_NOTIFY (Win95)
|
---|
681 | * and WM_CONTROL (OS/2) messages.
|
---|
682 | *
|
---|
683 | * Parameters (OS/2, incompatible with Win95):
|
---|
684 | * -- mp1 USHORT usID;
|
---|
685 | * USHORT usNotifyCode == TTN_NEEDTEXT
|
---|
686 | * -- ULONG mp2: identifier of the tool, as in TOOLINFO.uId.
|
---|
687 | *
|
---|
688 | * Return value: always 0.
|
---|
689 | *
|
---|
690 | * The TTN_SHOW notification message notifies the owner window
|
---|
691 | * that a tooltip is about to be hidden.
|
---|
692 | */
|
---|
693 |
|
---|
694 | #define TTN_POP 1002
|
---|
695 |
|
---|
696 | #define COMCTL_TOOLTIP_CLASS "ComctlTooltipClass"
|
---|
697 |
|
---|
698 | BOOL ctlRegisterTooltip(HAB hab);
|
---|
699 |
|
---|
700 | MRESULT EXPENTRY ctl_fnwpTooltip(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
701 |
|
---|
702 | /* ******************************************************************
|
---|
703 | * *
|
---|
704 | * Checkbox container record cores *
|
---|
705 | * *
|
---|
706 | ********************************************************************/
|
---|
707 |
|
---|
708 | BOOL ctlDrawCheckbox(HPS hps,
|
---|
709 | LONG x,
|
---|
710 | LONG y,
|
---|
711 | USHORT usRow,
|
---|
712 | USHORT usColumn,
|
---|
713 | BOOL fHalftoned);
|
---|
714 |
|
---|
715 | #ifdef INCL_WINSTDCNR
|
---|
716 |
|
---|
717 | /*
|
---|
718 | *@@ CN_RECORDCHECKED:
|
---|
719 | * extra WM_CONTROL notification code.
|
---|
720 | * See ctlMakeCheckboxContainer for
|
---|
721 | * details.
|
---|
722 | */
|
---|
723 |
|
---|
724 | #define CN_RECORDCHECKED 999
|
---|
725 |
|
---|
726 | /*
|
---|
727 | *@@ CHECKBOXRECORDCORE:
|
---|
728 | * extended record core structure used
|
---|
729 | * with checkbox containers. See
|
---|
730 | * ctlMakeCheckboxContainer for details.
|
---|
731 | */
|
---|
732 |
|
---|
733 | typedef struct _CHECKBOXRECORDCORE
|
---|
734 | {
|
---|
735 | RECORDCORE recc;
|
---|
736 | // standard record core structure
|
---|
737 | ULONG ulStyle;
|
---|
738 | // any combination of the following:
|
---|
739 | // -- WS_VISIBLE
|
---|
740 | // -- none or one of the following:
|
---|
741 | // BS_AUTOCHECKBOX, BS_AUTO3STATE, BS_3STATE
|
---|
742 | // Internally, we use BS_BITMAP to identify
|
---|
743 | // the depressed checkbox button.
|
---|
744 | USHORT usItemID;
|
---|
745 | // this identifies the record. Must be
|
---|
746 | // unique within the container.
|
---|
747 | USHORT usCheckState;
|
---|
748 | // current check state as with checkboxes
|
---|
749 | // (0, 1, or 2 for tri-state).
|
---|
750 | HPOINTER hptrIcon;
|
---|
751 | // if this is != NULLHANDLE, this icon
|
---|
752 | // will always be used for painting,
|
---|
753 | // instead of the default check box
|
---|
754 | // bitmaps. Useful for non-auto check
|
---|
755 | // box records to implement something
|
---|
756 | // other than checkboxes.
|
---|
757 | } CHECKBOXRECORDCORE, *PCHECKBOXRECORDCORE;
|
---|
758 |
|
---|
759 | BOOL ctlMakeCheckboxContainer(HWND hwndCnrOwner,
|
---|
760 | USHORT usCnrID);
|
---|
761 |
|
---|
762 | PCHECKBOXRECORDCORE ctlFindCheckRecord(HWND hwndCnr,
|
---|
763 | ULONG ulItemID);
|
---|
764 |
|
---|
765 | BOOL ctlSetRecordChecked(HWND hwndCnr,
|
---|
766 | ULONG ulItemID,
|
---|
767 | USHORT usCheckState);
|
---|
768 |
|
---|
769 | ULONG ctlQueryRecordChecked(HWND hwndCnr,
|
---|
770 | ULONG ulItemID,
|
---|
771 | USHORT usCheckState);
|
---|
772 |
|
---|
773 | BOOL ctlEnableRecord(HWND hwndCnr,
|
---|
774 | ULONG ulItemID,
|
---|
775 | BOOL fEnable);
|
---|
776 | #endif
|
---|
777 |
|
---|
778 | /* ******************************************************************
|
---|
779 | * *
|
---|
780 | * Hotkey entry field *
|
---|
781 | * *
|
---|
782 | ********************************************************************/
|
---|
783 |
|
---|
784 | /*
|
---|
785 | *@@ EN_HOTKEY:
|
---|
786 | * extra notification code with WM_CONTROL
|
---|
787 | * and subclassed hotkey entry fields.
|
---|
788 | * This is SENT to the entry field's owner
|
---|
789 | * every time a key is pressed. Note that
|
---|
790 | * this is only sent for key-down events
|
---|
791 | * and if all the KC_DEADKEY | KC_COMPOSITE | KC_INVALIDCOMP
|
---|
792 | * flags are not set.
|
---|
793 | *
|
---|
794 | * WM_CONTROL parameters in this case:
|
---|
795 | * -- mp1: USHORT id,
|
---|
796 | * USHORT usNotifyCode == EN_HOTKEY
|
---|
797 | * -- mp2: PHOTKEYNOTIFY struct pointer
|
---|
798 | *
|
---|
799 | * The receiving owner must check if the key
|
---|
800 | * combo described in HOTKEYNOTIFY makes up
|
---|
801 | * a valid hotkey and return a ULONG composed
|
---|
802 | * of the following flags:
|
---|
803 | *
|
---|
804 | * -- HEFL_SETTEXT: if this is set, the text
|
---|
805 | * of the entry field is set to the
|
---|
806 | * text in HOTKEYNOTIFY.szDescription.
|
---|
807 | *
|
---|
808 | * -- HEFL_FORWARD2OWNER: if this is set, the
|
---|
809 | * WM_CHAR message is instead passed
|
---|
810 | * to the owner. Use this for the tab
|
---|
811 | * key and such.
|
---|
812 | *
|
---|
813 | *@@added V0.9.1 (99-12-19) [umoeller]
|
---|
814 | *@@changed V0.9.4 (2000-08-03) [umoeller]: added HEFL_* flags
|
---|
815 | */
|
---|
816 |
|
---|
817 | #define EN_HOTKEY 0x1000
|
---|
818 |
|
---|
819 | #define HEFL_SETTEXT 0x0001
|
---|
820 | #define HEFL_FORWARD2OWNER 0x0002
|
---|
821 |
|
---|
822 | typedef struct _HOTKEYNOTIFY
|
---|
823 | {
|
---|
824 | USHORT usFlags, // in: as in WM_CHAR
|
---|
825 | usvk, // in: as in WM_CHAR
|
---|
826 | usch; // in: as in WM_CHAR
|
---|
827 | UCHAR ucScanCode; // in: as in WM_CHAR
|
---|
828 | USHORT usKeyCode; // in: if KC_VIRTUAL is set, this has usKeyCode;
|
---|
829 | // otherwise usCharCode
|
---|
830 | CHAR szDescription[100]; // out: key description
|
---|
831 | } HOTKEYNOTIFY, *PHOTKEYNOTIFY;
|
---|
832 |
|
---|
833 | BOOL ctlMakeHotkeyEntryField(HWND hwndHotkeyEntryField);
|
---|
834 |
|
---|
835 | #endif
|
---|
836 |
|
---|
837 | #if __cplusplus
|
---|
838 | }
|
---|
839 | #endif
|
---|
840 |
|
---|