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

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

Tons of updates.

  • 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 18 2001-01-01 15:30:29Z 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 #define TTF_CENTERTIP 0x0002
443 #define TTF_RTLREADING 0x0004
444 #define TTF_SUBCLASS 0x0008
445 // non-Win95 flags
446 #define TTF_SHYMOUSE 0x0010
447
448 #define LPSTR_TEXTCALLBACK (PSZ)-1
449
450 #define TT_SHADOWOFS 10
451 #define TT_ROUNDING 8
452
453 /*
454 *@@ TOOLINFO:
455 * info structure to register a tool with a
456 * tooltip control. Used with TTM_ADDTOOL
457 * and many other TTM_* messages.
458 */
459
460 typedef struct _TOOLINFO
461 {
462 ULONG /* UINT */ cbSize; // in: sizeof(TOOLINFO)
463 ULONG /* UINT */ uFlags;
464 // in: flags for the tool, any combination of:
465 // -- TTF_IDISHWND: Indicates that the uId member is the window
466 // handle to the tool. If this flag is not set, uId is
467 // the identifier of the tool.
468 // -- TTF_CENTERTIP: Centers the tooltip window below the
469 // tool specified by the uId member.
470 // -- TTF_RTLREADING: Windows 95 only: Displays text using
471 // right-to-left reading order on Hebrew or Arabic systems.
472 // (Ignored on OS/2).
473 // -- TTF_SUBCLASS: Indicates that the tooltip control should
474 // subclass the tool's window 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 hwnd;
481 // in: handle to the window that contains the tool. If
482 // lpszText includes the LPSTR_TEXTCALLBACK value, this
483 // member identifies the window that receives TTN_NEEDTEXT
484 // notification messages.
485 ULONG /* UINT */ uId;
486 // in: application-defined identifier of the tool. If uFlags
487 // includes the TTF_IDISHWND value, uId must specify the
488 // window handle to the tool.
489 RECTL /* RECT */ rect;
490 // in: coordinates of the bounding rectangle of the tool.
491 // The coordinates are relative to the upper-left corner of
492 // the client area of the window identified by hwnd. If
493 // uFlags includes the TTF_IDISHWND value, this member is
494 // ignored.
495 HMODULE /* HINSTANCE */ hinst;
496 // in: handle to the instance that contains the string
497 // resource for the tool. If lpszText specifies the identifier
498 // of a string resource, this member is used.
499 // Note: On Win32, this is an HINSTANCE field. On OS/2,
500 // this is a HMODULE field. The field name is retained for
501 // compatibility.
502 PSZ /* LPTSTR */ lpszText;
503 // in: pointer to the buffer that contains the text for the
504 // tool (if the hiword is != NULL), or identifier of the string
505 // resource that contains the text (if the hiword == NULL).
506 // If this member is set to the LPSTR_TEXTCALLBACK value,
507 // the control sends the TTN_NEEDTEXT notification message to
508 // the owner window to retrieve the text.
509 } TOOLINFO, *PTOOLINFO;
510
511 #define TTM_FIRST (WM_USER + 1000)
512
513 #define TTM_ACTIVATE (TTM_FIRST + 1)
514
515 #define TTM_ADDTOOL (TTM_FIRST + 2)
516
517 #define TTM_DELTOOL (TTM_FIRST + 3)
518
519 #define TTM_NEWTOOLRECT (TTM_FIRST + 4)
520
521 #define TTM_RELAYEVENT (TTM_FIRST + 5)
522
523 // flags for TTM_SETDELAYTIME
524 #define TTDT_AUTOMATIC 1
525 #define TTDT_AUTOPOP 2
526 #define TTDT_INITIAL 3
527 #define TTDT_RESHOW 4
528
529 #define TTM_SETDELAYTIME (TTM_FIRST + 6)
530
531 /*
532 *@@ NMHDR:
533 * structure used with TOOLTIPTEXT;
534 * under Win32, this is a generic structure which
535 * comes with all WM_NOTIFY messages.
536 */
537
538 typedef struct _NMHDR
539 {
540 HWND hwndFrom; // control sending the message
541 ULONG idFrom; // ID of that control
542 USHORT code; // notification code
543 } NMHDR, *PNMHDR;
544
545 /*
546 *@@ TOOLTIPTEXT:
547 * identifies a tool for which text is to be displayed and
548 * receives the text for the tool.
549 *
550 * This structure is used with the TTN_NEEDTEXT notification.
551 */
552
553 typedef struct _TOOLTIPTEXT
554 {
555 NMHDR hdr; // on Win95, this is required for all WM_NOTIFY msgs
556 PSZ /* LPTSTR */ lpszText;
557 // out: pointer to a string that contains or receives the text
558 // for a tool. If hinst specifies an instance handle, this
559 // member must be the identifier of a string resource.
560 char szText[80];
561 // out: buffer that receives the tooltip text. An application can
562 // copy the text to this buffer as an alternative to specifying a
563 // string address or string resource.
564 HMODULE /* HINSTANCE */ hinst;
565 // out: handle to the instance (OS/2: module) that contains a string
566 // resource to be used as the tooltip text. If lpszText is the
567 // pointer to the tooltip text, this member is NULL.
568 // Note: On Win32, this is an HINSTANCE field. On OS/2,
569 // this is a HMODULE field. The field name is retained for
570 // compatibility.
571 ULONG /* UINT */ uFlags;
572 // in: flag that indicates how to interpret the idFrom member of
573 // the NMHDR structure that is included in the structure. If this
574 // member is the TTF_IDISHWND value, idFrom is the handle of the
575 // tool. Otherwise, idFrom is the identifier of the tool.
576 // Windows 95 only: If this member is the TTF_RTLREADING value,
577 // then text on Hebrew or Arabic systems is displayed using
578 // right-to-left reading order. (Ignored on OS/2.)
579 } TOOLTIPTEXT, *PTOOLTIPTEXT;
580
581 #define TTM_GETTEXT (TTM_FIRST + 7)
582
583 #define TTM_UPDATETIPTEXT (TTM_FIRST + 8)
584
585 /*
586 *@@ TT_HITTESTINFO:
587 * contains information that a tooltip control uses to determine whether
588 * a point is in the bounding rectangle of the specified tool. If the point
589 * is in the rectangle, the structure receives information about the tool.
590 *
591 * This structure is used with the TTM_HITTEST message.
592 */
593
594 typedef struct _TT_HITTESTINFO
595 {
596 HWND hwnd; // in: handle to the tool or window with the specified tool.
597 POINTL /* POINT */ pt;
598 // in: client coordinates of the point to test (Win95: POINT)
599 TOOLINFO ti; // out: receives information about the specified tool.
600 } TTHITTESTINFO, *PHITTESTINFO;
601
602 #define TTM_HITTEST (TTM_FIRST + 9)
603
604 #define TTM_WINDOWFROMPOINT (TTM_FIRST + 10)
605
606 #define TTM_ENUMTOOLS (TTM_FIRST + 11)
607
608 #define TTM_GETCURRENTTOOL (TTM_FIRST + 12)
609
610 #define TTM_GETTOOLCOUNT (TTM_FIRST + 13)
611
612 #define TTM_GETTOOLINFO (TTM_FIRST + 14)
613
614 #define TTM_SETTOOLINFO (TTM_FIRST + 15)
615
616 // non-Win95 messages
617
618 #define TTM_SHOWTOOLTIPNOW (TTM_FIRST + 16)
619
620 /*
621 *@@ TTN_NEEDTEXT:
622 * control notification sent with the WM_NOTIFY (Win95)
623 * and WM_CONTROL (OS/2) messages.
624 *
625 * Parameters (OS/2, incompatible with Win95):
626 * -- mp1 USHORT usID;
627 * USHORT usNotifyCode == TTN_NEEDTEXT
628 * -- PTOOLTIPTEXT mp2: pointer to a TOOLTIPTEXT structure.
629 * The hdr member identifies the tool for which text is needed. The
630 * receiving window can specify the string by taking one of the
631 * following actions:
632 * -- Copying the text to the buffer specified by the szText member.
633 * -- Copying the address of the buffer that contains the text to the
634 * lpszText member.
635 * -- Copying the identifier of a string resource to the lpszText
636 * member and copying the handle of the instance that contains
637 * the resource to the hinst member.
638 *
639 * This notification message is sent to the window specified
640 * in the hwnd member of the TOOLINFO structure for the tool.
641 * This notification is sent only if the LPSTR_TEXTCALLBACK
642 * value is specified when the tool is added to a tooltip control.
643 *
644 * Windows 95 only: When a TTN_NEEDTEXT notification is received,
645 * the application can set or clear the TTF_RTLREADING value
646 * in the uFlags member of the TOOLTIPTEXT structure pointed to
647 * by lpttt as required. This is the only flag that can be changed
648 * during the notification callback.
649 *
650 * OS/2 only: Specifying LPSTR_TEXTCALLBACK in TOOLINFO.lpszText
651 * with TTM_ADDTOOL is the only way under OS/2 to have strings
652 * displayed which are longer than 256 characters, since string
653 * resources are limited to 256 characters with OS/2. It is the
654 * responsibility of the application to set the lpszText member
655 * to a static string buffer which holds the string for the tool.
656 * A common error would be to have that member point to some
657 * variable which has only been allocated on the stack.
658 */
659
660 #define TTN_NEEDTEXT 1000
661
662 /*
663 *@@ TTN_SHOW:
664 * control notification sent with the WM_NOTIFY (Win95)
665 * and WM_CONTROL (OS/2) messages.
666 *
667 * Parameters (OS/2, incompatible with Win95):
668 * -- mp1 USHORT usID;
669 * USHORT usNotifyCode == TTN_NEEDTEXT
670 * -- ULONG mp2: identifier of the tool, as in TOOLINFO.uId.
671 *
672 * Return value: always 0.
673 *
674 * The TTN_SHOW notification message notifies the owner window
675 * that a tooltip is about to be displayed.
676 */
677
678 #define TTN_SHOW 1001
679
680 /*
681 *@@ TTN_POP:
682 * control notification sent with the WM_NOTIFY (Win95)
683 * and WM_CONTROL (OS/2) messages.
684 *
685 * Parameters (OS/2, incompatible with Win95):
686 * -- mp1 USHORT usID;
687 * USHORT usNotifyCode == TTN_NEEDTEXT
688 * -- ULONG mp2: identifier of the tool, as in TOOLINFO.uId.
689 *
690 * Return value: always 0.
691 *
692 * The TTN_SHOW notification message notifies the owner window
693 * that a tooltip is about to be hidden.
694 */
695
696 #define TTN_POP 1002
697
698 #define COMCTL_TOOLTIP_CLASS "ComctlTooltipClass"
699
700 BOOL ctlRegisterTooltip(HAB hab);
701
702 MRESULT EXPENTRY ctl_fnwpTooltip(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
703
704 /* ******************************************************************
705 *
706 * Checkbox container record cores
707 *
708 ********************************************************************/
709
710 BOOL ctlDrawCheckbox(HPS hps,
711 LONG x,
712 LONG y,
713 USHORT usRow,
714 USHORT usColumn,
715 BOOL fHalftoned);
716
717 #ifdef INCL_WINSTDCNR
718
719 /*
720 *@@ CN_RECORDCHECKED:
721 * extra WM_CONTROL notification code.
722 * See ctlMakeCheckboxContainer for
723 * details.
724 */
725
726 #define CN_RECORDCHECKED 999
727
728 /*
729 *@@ CHECKBOXRECORDCORE:
730 * extended record core structure used
731 * with checkbox containers. See
732 * ctlMakeCheckboxContainer for details.
733 */
734
735 typedef struct _CHECKBOXRECORDCORE
736 {
737 RECORDCORE recc;
738 // standard record core structure
739 ULONG ulStyle;
740 // any combination of the following:
741 // -- WS_VISIBLE
742 // -- none or one of the following:
743 // BS_AUTOCHECKBOX, BS_AUTO3STATE, BS_3STATE
744 // Internally, we use BS_BITMAP to identify
745 // the depressed checkbox button.
746 USHORT usItemID;
747 // this identifies the record. Must be
748 // unique within the container.
749 USHORT usCheckState;
750 // current check state as with checkboxes
751 // (0, 1, or 2 for tri-state).
752 HPOINTER hptrIcon;
753 // if this is != NULLHANDLE, this icon
754 // will always be used for painting,
755 // instead of the default check box
756 // bitmaps. Useful for non-auto check
757 // box records to implement something
758 // other than checkboxes.
759 } CHECKBOXRECORDCORE, *PCHECKBOXRECORDCORE;
760
761 BOOL ctlMakeCheckboxContainer(HWND hwndCnrOwner,
762 USHORT usCnrID);
763
764 PCHECKBOXRECORDCORE ctlFindCheckRecord(HWND hwndCnr,
765 ULONG ulItemID);
766
767 BOOL ctlSetRecordChecked(HWND hwndCnr,
768 ULONG ulItemID,
769 USHORT usCheckState);
770
771 ULONG ctlQueryRecordChecked(HWND hwndCnr,
772 ULONG ulItemID,
773 USHORT usCheckState);
774
775 BOOL ctlEnableRecord(HWND hwndCnr,
776 ULONG ulItemID,
777 BOOL fEnable);
778 #endif
779
780 /* ******************************************************************
781 *
782 * Hotkey entry field
783 *
784 ********************************************************************/
785
786 /*
787 *@@ EN_HOTKEY:
788 * extra notification code with WM_CONTROL
789 * and subclassed hotkey entry fields.
790 * This is SENT to the entry field's owner
791 * every time a key is pressed. Note that
792 * this is only sent for key-down events
793 * and if all the KC_DEADKEY | KC_COMPOSITE | KC_INVALIDCOMP
794 * flags are not set.
795 *
796 * WM_CONTROL parameters in this case:
797 * -- mp1: USHORT id,
798 * USHORT usNotifyCode == EN_HOTKEY
799 * -- mp2: PHOTKEYNOTIFY struct pointer
800 *
801 * The receiving owner must check if the key
802 * combo described in HOTKEYNOTIFY makes up
803 * a valid hotkey and return a ULONG composed
804 * of the following flags:
805 *
806 * -- HEFL_SETTEXT: if this is set, the text
807 * of the entry field is set to the
808 * text in HOTKEYNOTIFY.szDescription.
809 *
810 * -- HEFL_FORWARD2OWNER: if this is set, the
811 * WM_CHAR message is instead passed
812 * to the owner. Use this for the tab
813 * key and such.
814 *
815 *@@added V0.9.1 (99-12-19) [umoeller]
816 *@@changed V0.9.4 (2000-08-03) [umoeller]: added HEFL_* flags
817 */
818
819 #define EN_HOTKEY 0x1000
820
821 #define HEFL_SETTEXT 0x0001
822 #define HEFL_FORWARD2OWNER 0x0002
823
824 typedef struct _HOTKEYNOTIFY
825 {
826 USHORT usFlags, // in: as in WM_CHAR
827 usvk, // in: as in WM_CHAR
828 usch; // in: as in WM_CHAR
829 UCHAR ucScanCode; // in: as in WM_CHAR
830 USHORT usKeyCode; // in: if KC_VIRTUAL is set, this has usKeyCode;
831 // otherwise usCharCode
832 CHAR szDescription[100]; // out: key description
833 } HOTKEYNOTIFY, *PHOTKEYNOTIFY;
834
835 BOOL ctlMakeHotkeyEntryField(HWND hwndHotkeyEntryField);
836
837#endif
838
839#if __cplusplus
840}
841#endif
842
Note: See TracBrowser for help on using the repository browser.