source: trunk/include/helpers/comctl.h@ 53

Last change on this file since 53 was 52, checked in by umoeller, 24 years ago

misc. changes.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 34.2 KB
Line 
1
2/*
3 *@@sourcefile comctl.h:
4 * header file for comctl.c. See remarks there.
5 *
6 * Note: Version numbering in this file relates to XWorkplace version
7 * numbering.
8 */
9
10/* Copyright (C) 1997-2000 Ulrich M”ller.
11 * This file is part of the "XWorkplace helpers" source package.
12 * This is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published
14 * by the Free Software Foundation, in version 2 as it comes in the
15 * "COPYING" file of the XWorkplace main distribution.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 *@@include #define INCL_WINWINDOWMGR
22 *@@include #define INCL_WINMESSAGEMGR
23 *@@include #define INCL_WINDIALOGS
24 *@@include #define INCL_WINSTDCNR // for checkbox containers
25 *@@include #define INCL_WININPUT
26 *@@include #define INCL_WINSYS
27 *@@include #define INCL_WINSHELLDATA
28 *@@include #include <os2.h>
29 *@@include #include "comctl.h"
30 */
31
32#if __cplusplus
33extern "C" {
34#endif
35
36#ifndef COMCTL_HEADER_INCLUDED
37 #define COMCTL_HEADER_INCLUDED
38
39 /* ******************************************************************
40 *
41 * "Menu button" control
42 *
43 ********************************************************************/
44
45 VOID ctlDisplayButtonMenu(HWND hwndButton,
46 HWND hwndMenu);
47
48 BOOL ctlMakeMenuButton(HWND hwndButton,
49 HMODULE hmodMenu,
50 ULONG idMenu);
51
52 /* ******************************************************************
53 *
54 * Progress bars
55 *
56 ********************************************************************/
57
58 /*
59 *@@ PROGRESSBARDATA:
60 * structure for progress bar data,
61 * saved at QWL_USER window ulong.
62 */
63
64 typedef struct _PROGRESSBARDATA
65 {
66 ULONG ulNow,
67 ulMax,
68 ulPaintX,
69 ulOldPaintX;
70 ULONG ulAttr;
71 PFNWP OldStaticProc;
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 // V0.9.7 (2001-01-03) [umoeller]: removed this win95 crap
441 // #define TTF_CENTERBELOW 0x0002
442 // #define TTF_CENTERABOVE 0x0004
443 // #define TTF_RTLREADING 0x0004
444 // V0.9.7 (2001-01-03) [umoeller]: removed this win95 crap
445
446 #define TTF_SUBCLASS 0x0008
447 // non-Win95 flags
448 #define TTF_SHYMOUSE 0x0010
449
450 // new flags with V0.9.7 (2001-01-20) [umoeller]
451 #define TTF_CENTER_X_ON_TOOL 0x0020
452 #define TTF_POS_Y_ABOVE_TOOL 0x0040
453 #define TTF_POS_Y_BELOW_TOOL 0x0080
454
455 #define PSZ_TEXTCALLBACK (PSZ)-1
456
457 #define TT_SHADOWOFS 10
458 #define TT_ROUNDING 8
459
460 /*
461 *@@ TOOLINFO:
462 * info structure to register a tool with a
463 * tooltip control. Used with TTM_ADDTOOL
464 * and many other TTM_* messages.
465 *
466 *@@changed V0.9.7 (2001-01-03) [umoeller]: removed all that win95 crap
467 */
468
469 typedef struct _TOOLINFO
470 {
471 ULONG ulFlags;
472 // in: flags for the tool, any combination of:
473 // -- TTF_SUBCLASS: Indicates that the tooltip control should
474 // subclass hwndTool to intercept messages,
475 // such as WM_MOUSEMOVE. See TTM_RELAYEVENT.
476 // -- TTF_SHYMOUSE: shy away from mouse pointer;
477 // always position the tool tip such that it is never
478 // covered by the mouse pointer (for readability);
479 // added V0.9.1 (2000-02-04) [umoeller]
480 // -- TTF_CENTER_X_ON_TOOL: position tooltip X so that
481 // it's centered on the tool (doesn't affect Y)
482 // -- TTF_POS_Y_ABOVE_TOOL: position tooltip Y above
483 // the tool; cannot be used with TTF_POS_Y_BELOW_TOOL
484 // -- TTF_POS_Y_BELOW_TOOL: position tooltip Y below
485 // the tool; cannot be used with TTF_POS_Y_ABOVE_TOOL
486 HWND hwndToolOwner;
487 // in: handle to the window that contains the tool. If
488 // lpszText includes the PSZ_TEXTCALLBACK value, this
489 // member identifies the window that receives TTN_NEEDTEXT
490 // notification messages.
491 HWND hwndTool;
492 // in: window handle of the tool.
493 // ### simple rectangles of hwndToolOwner not yet supported
494 PSZ pszText;
495 // in: pointer to the buffer that contains the text for the
496 // tool (if the hiword is != NULL), or identifier of the string
497 // resource that contains the text (if the hiword == NULL).
498 // If this member is set to the PSZ_TEXTCALLBACK value,
499 // the control sends the TTN_NEEDTEXT notification message to
500 // hwndToolOwner to retrieve the text.
501 } TOOLINFO, *PTOOLINFO;
502
503 #define TTM_FIRST (WM_USER + 1000)
504
505 #define TTM_ACTIVATE (TTM_FIRST + 1)
506
507 #define TTM_ADDTOOL (TTM_FIRST + 2)
508
509 #define TTM_DELTOOL (TTM_FIRST + 3)
510
511 #define TTM_NEWTOOLRECT (TTM_FIRST + 4)
512
513 #define TTM_RELAYEVENT (TTM_FIRST + 5)
514
515 // flags for TTM_SETDELAYTIME
516 #define TTDT_AUTOMATIC 1
517 #define TTDT_AUTOPOP 2
518 #define TTDT_INITIAL 3
519 #define TTDT_RESHOW 4
520
521 #define TTM_SETDELAYTIME (TTM_FIRST + 6)
522
523 #define TTFMT_PSZ 0x01
524 #define TTFMT_STRINGRES 0x02
525
526 /*
527 *@@ TOOLTIPTEXT:
528 * identifies a tool for which text is to be displayed and
529 * receives the text for the tool. The tool must fill all
530 * fields of this structure.
531 *
532 * This structure is used with the TTN_NEEDTEXT notification.
533 *
534 *@@changed V0.9.7 (2001-01-03) [umoeller]: got rid of this win95 crap
535 */
536
537 typedef struct _TOOLTIPTEXT
538 {
539 HWND hwndTooltip;
540 // in: tooltip control who's sending this.
541 HWND hwndTool;
542 // in: tool for which the text is needed.
543 ULONG ulFormat;
544 // out: one of:
545 // -- TTFMT_PSZ: pszText contains the new, zero-terminated string.
546 // -- TTFMT_STRINGRES: hmod and idResource specify a string resource
547 // to be loaded.
548 PSZ pszText;
549 // out: with TTFMT_PSZ, pointer to a string that contains the
550 // tool text. Note that this is not copied into the tooltip...
551 // so this must point to a static buffer.
552 HMODULE hmod;
553 // out: with TTFMT_STRINGRES, the module handle of the resource.
554 ULONG idResource;
555 // out: with TTFMT_STRINGRES, the string resource ID.
556 } TOOLTIPTEXT, *PTOOLTIPTEXT;
557
558 #define TTM_GETTEXT (TTM_FIRST + 7)
559
560 #define TTM_UPDATETIPTEXT (TTM_FIRST + 8)
561
562 /*
563 *@@ TT_HITTESTINFO:
564 * contains information that a tooltip control uses to determine whether
565 * a point is in the bounding rectangle of the specified tool. If the point
566 * is in the rectangle, the structure receives information about the tool.
567 *
568 * This structure is used with the TTM_HITTEST message.
569 */
570
571 typedef struct _TT_HITTESTINFO
572 {
573 HWND hwnd; // in: handle to the tool or window with the specified tool.
574 POINTL /* POINT */ pt;
575 // in: client coordinates of the point to test (Win95: POINT)
576 TOOLINFO ti; // out: receives information about the specified tool.
577 } TTHITTESTINFO, *PHITTESTINFO;
578
579 #define TTM_HITTEST (TTM_FIRST + 9)
580
581 #define TTM_WINDOWFROMPOINT (TTM_FIRST + 10)
582
583 #define TTM_ENUMTOOLS (TTM_FIRST + 11)
584
585 #define TTM_GETCURRENTTOOL (TTM_FIRST + 12)
586
587 #define TTM_GETTOOLCOUNT (TTM_FIRST + 13)
588
589 #define TTM_GETTOOLINFO (TTM_FIRST + 14)
590
591 #define TTM_SETTOOLINFO (TTM_FIRST + 15)
592
593 // non-Win95 messages
594
595 #define TTM_SHOWTOOLTIPNOW (TTM_FIRST + 16)
596
597 /*
598 *@@ TTN_NEEDTEXT:
599 * notification code used with WM_CONTROL when a tooltip
600 * needs a tooltip text for a tool.
601 *
602 * Parameters:
603 *
604 * -- SHORT1FROMMP(mp1) usID: ID of the tooltip control).
605 *
606 * -- SHORT2FROMMP(mp1) usNotifyCode: TTN_NEEDTEXT.
607 *
608 * -- PTOOLTIPTEXT mp2: pointer to a TOOLTIPTEXT structure.
609 * hwndTool identifies the tool for which text is needed.
610 *
611 * This notification message is sent to the window specified
612 * in the hwndToolOwner member of the TOOLINFO structure for the tool.
613 * This notification is sent only if the PSZ_TEXTCALLBACK
614 * value is specified when the tool is added to a tooltip control.
615 *
616 * To specify the text, the target window (hwndToolOwner) must:
617 *
618 * 1. Set TOOLTIPTEXT.ulFormat to one of the format flags.
619 *
620 * 2. Fill the corresponding field(s) in TOOLTIPTEXT.
621 *
622 * Specifying PSZ_TEXTCALLBACK in TOOLINFO.lpszText with
623 * TTM_ADDTOOL is the only way under OS/2 to have strings
624 * displayed which are longer than 256 characters, since
625 * string resources are limited to 256 characters with OS/2.
626 * It is the responsibility of the application to set the
627 * pszText member to a _static_ string buffer which holds
628 * the string for the tool. A common error would be to have
629 * that member point to some variable which has only been
630 * allocated on the stack... this will lead to problems.
631 */
632
633 #define TTN_NEEDTEXT 1000
634
635 /*
636 *@@ TTN_SHOW:
637 * control notification sent with the WM_NOTIFY (Win95)
638 * and WM_CONTROL (OS/2) messages.
639 *
640 * Parameters (OS/2, incompatible with Win95):
641 * -- mp1 USHORT usID;
642 * USHORT usNotifyCode == TTN_NEEDTEXT
643 * -- ULONG mp2: identifier of the tool, as in TOOLINFO.uId.
644 *
645 * Return value: always 0.
646 *
647 * The TTN_SHOW notification message notifies the owner window
648 * that a tooltip is about to be displayed.
649 */
650
651 #define TTN_SHOW 1001
652
653 /*
654 *@@ TTN_POP:
655 * control notification sent with the WM_NOTIFY (Win95)
656 * and WM_CONTROL (OS/2) messages.
657 *
658 * Parameters (OS/2, incompatible with Win95):
659 * -- mp1 USHORT usID;
660 * USHORT usNotifyCode == TTN_NEEDTEXT
661 * -- ULONG mp2: identifier of the tool, as in TOOLINFO.uId.
662 *
663 * Return value: always 0.
664 *
665 * The TTN_SHOW notification message notifies the owner window
666 * that a tooltip is about to be hidden.
667 */
668
669 #define TTN_POP 1002
670
671 #define COMCTL_TOOLTIP_CLASS "ComctlTooltipClass"
672
673 BOOL ctlRegisterTooltip(HAB hab);
674
675 MRESULT EXPENTRY ctl_fnwpTooltip(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
676
677 /* ******************************************************************
678 *
679 * Checkbox container record cores
680 *
681 ********************************************************************/
682
683 BOOL ctlDrawCheckbox(HPS hps,
684 LONG x,
685 LONG y,
686 USHORT usRow,
687 USHORT usColumn,
688 BOOL fHalftoned);
689
690 #ifdef INCL_WINSTDCNR
691
692 /*
693 *@@ CN_RECORDCHECKED:
694 * extra WM_CONTROL notification code.
695 * See ctlMakeCheckboxContainer for
696 * details.
697 */
698
699 #define CN_RECORDCHECKED 999
700
701 /*
702 *@@ CHECKBOXRECORDCORE:
703 * extended record core structure used
704 * with checkbox containers. See
705 * ctlMakeCheckboxContainer for details.
706 *
707 * The check box painting is determined
708 * by the following flags:
709 *
710 * -- Only if (ulStyle & WS_VISIBLE), the check
711 * box is painted at all. Otherwise hptrIcon
712 * is painted. (Is this true?)
713 *
714 * -- In that case, usCheckState determines
715 * whether the check box is painted checked,
716 * unchecked, or indeterminate.
717 *
718 * -- In addition, if RECORDCORE.flRecordAttr
719 * has the CRA_DISABLED bit set, the check
720 * box is painted disabled (halftoned).
721 *
722 *@@changed V0.9.9 (2001-03-27) [umoeller]: made item id a ULONG
723 */
724
725 typedef struct _CHECKBOXRECORDCORE
726 {
727 RECORDCORE recc;
728 // standard record core structure
729 ULONG ulStyle;
730 // any combination of the following:
731 // -- WS_VISIBLE
732 // -- none or one of the following:
733 // BS_AUTOCHECKBOX, BS_AUTO3STATE, BS_3STATE
734 // Internally, we use BS_BITMAP to identify
735 // the depressed checkbox button.
736 ULONG ulItemID;
737 // this identifies the record; must be
738 // unique within the container
739 // changed V0.9.9 (2001-03-27) [umoeller]: turned USHORT into ULONG
740 USHORT usCheckState;
741 // current check state as with checkboxes
742 // (0, 1, or 2 for tri-state).
743 HPOINTER hptrIcon;
744 // if this is != NULLHANDLE, this icon
745 // will always be used for painting,
746 // instead of the default check box
747 // bitmaps. Useful for non-auto check
748 // box records to implement something
749 // other than checkboxes.
750 } CHECKBOXRECORDCORE, *PCHECKBOXRECORDCORE;
751
752 BOOL ctlMakeCheckboxContainer(HWND hwndCnrOwner,
753 USHORT usCnrID);
754
755 PCHECKBOXRECORDCORE ctlFindCheckRecord(HWND hwndCnr,
756 ULONG ulItemID);
757
758 BOOL ctlSetRecordChecked(HWND hwndCnr,
759 ULONG ulItemID,
760 USHORT usCheckState);
761
762 ULONG ctlQueryRecordChecked(HWND hwndCnr,
763 ULONG ulItemID,
764 USHORT usCheckState);
765
766 BOOL ctlEnableRecord(HWND hwndCnr,
767 ULONG ulItemID,
768 BOOL fEnable);
769 #endif
770
771 /* ******************************************************************
772 *
773 * Hotkey entry field
774 *
775 ********************************************************************/
776
777 /*
778 *@@ EN_HOTKEY:
779 * extra notification code with WM_CONTROL
780 * and subclassed hotkey entry fields.
781 * This is SENT to the entry field's owner
782 * every time a key is pressed. Note that
783 * this is only sent for key-down events
784 * and if all the KC_DEADKEY | KC_COMPOSITE | KC_INVALIDCOMP
785 * flags are not set.
786 *
787 * WM_CONTROL parameters in this case:
788 * -- mp1: USHORT id,
789 * USHORT usNotifyCode == EN_HOTKEY
790 * -- mp2: PHOTKEYNOTIFY struct pointer
791 *
792 * The receiving owner must check if the key
793 * combo described in HOTKEYNOTIFY makes up
794 * a valid hotkey and return a ULONG composed
795 * of the following flags:
796 *
797 * -- HEFL_SETTEXT: if this is set, the text
798 * of the entry field is set to the
799 * text in HOTKEYNOTIFY.szDescription.
800 *
801 * -- HEFL_FORWARD2OWNER: if this is set, the
802 * WM_CHAR message is instead passed
803 * to the owner. Use this for the tab
804 * key and such.
805 *
806 *@@added V0.9.1 (99-12-19) [umoeller]
807 *@@changed V0.9.4 (2000-08-03) [umoeller]: added HEFL_* flags
808 */
809
810 #define EN_HOTKEY 0x1000
811
812 #define HEFL_SETTEXT 0x0001
813 #define HEFL_FORWARD2OWNER 0x0002
814
815 typedef struct _HOTKEYNOTIFY
816 {
817 USHORT usFlags, // in: as in WM_CHAR
818 usvk, // in: as in WM_CHAR
819 usch; // in: as in WM_CHAR
820 UCHAR ucScanCode; // in: as in WM_CHAR
821 USHORT usKeyCode; // in: if KC_VIRTUAL is set, this has usKeyCode;
822 // otherwise usCharCode
823 CHAR szDescription[100]; // out: key description
824 } HOTKEYNOTIFY, *PHOTKEYNOTIFY;
825
826 BOOL ctlMakeHotkeyEntryField(HWND hwndHotkeyEntryField);
827
828#endif
829
830#if __cplusplus
831}
832#endif
833
Note: See TracBrowser for help on using the repository browser.