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

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

Major updates; timers, LVM, miscellaneous.

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