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

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

Misc. updates.

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