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

Last change on this file since 25 was 21, checked in by umoeller, 25 years ago

Final changes for 0.9.7, i hope...

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