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

Last change on this file since 337 was 265, checked in by pr, 21 years ago

Fixed spelling errors.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 54.0 KB
Line 
1
2/*
3 *@@sourcefile comctl.h:
4 * header file for comctl.c. See remarks there.
5 *
6 * Note: Version numbering in this file relates to XWorkplace version
7 * numbering.
8 */
9
10/* Copyright (C) 1997-2000 Ulrich M”ller.
11 * This file is part of the "XWorkplace helpers" source package.
12 * This is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published
14 * by the Free Software Foundation, in version 2 as it comes in the
15 * "COPYING" file of the XWorkplace main distribution.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 *@@include #define INCL_WINWINDOWMGR
22 *@@include #define INCL_WINMESSAGEMGR
23 *@@include #define INCL_WINDIALOGS
24 *@@include #define INCL_WINSTDCNR // for checkbox containers
25 *@@include #define INCL_WININPUT
26 *@@include #define INCL_WINSYS
27 *@@include #define INCL_WINSHELLDATA
28 *@@include #include <os2.h>
29 *@@include #include "helpers\comctl.h"
30 */
31
32#if __cplusplus
33extern "C" {
34#endif
35
36#ifndef COMCTL_HEADER_INCLUDED
37 #define COMCTL_HEADER_INCLUDED
38
39 /* ******************************************************************
40 *
41 * Shared stuff
42 *
43 ********************************************************************/
44
45 MRESULT ctlSendWmControl(HWND hwndControl,
46 USHORT usCode,
47 MPARAM mp2);
48
49 BOOL ctlPostWmControl(HWND hwndControl,
50 USHORT usCode,
51 MPARAM mp2);
52
53 /*
54 *@@ CCTLCOLOR:
55 *
56 *@@added V1.0.1 (2002-11-30) [umoeller]
57 */
58
59 typedef struct _CCTLCOLOR
60 {
61 BOOL fInheritPP;
62 ULONG ulPP,
63 ulSysColor;
64 } CCTLCOLOR, *PCCTLCOLOR;
65
66 #define CTLCOL_BGND 0
67 #define CTLCOL_FGND 1
68
69 #define CCS_NOSENDCTLPTR 0x0001
70
71 /*
72 *@@ DEFWINDOWDATA:
73 *
74 *@@added V1.0.1 (2002-11-30) [umoeller]
75 */
76
77 typedef struct _DEFWINDATA
78 {
79 HWND hwnd;
80 HAB hab;
81
82 PFNWP pDefWindowProc;
83
84 ULONG flCtl; // CTL_* flags
85
86 SIZEL szlWin; // current window dimensions
87
88 PSZ pszText; // window text or NULL
89
90 const CCTLCOLOR *paCtlColors;
91 ULONG cCtlColors;
92
93 PLONG palColorValues;
94
95 } DEFWINDATA, *PDEFWINDATA;
96
97 VOID ctlInitDWD(HWND hwnd,
98 MPARAM mp2,
99 PDEFWINDATA pdwd,
100 PFNWP pDefWindowProc,
101 ULONG flCtl,
102 const CCTLCOLOR *paCtlColors,
103 ULONG cCtlColors);
104
105 VOID ctlRefreshColors(PDEFWINDATA pdwd);
106
107 LONG ctlQueryColor(PDEFWINDATA pdwd, ULONG ulIndex);
108
109 MRESULT ctlDefWindowProc(PDEFWINDATA pdwd, ULONG msg, MPARAM mp1, MPARAM mp2);
110
111 /* ******************************************************************
112 *
113 * "Separator line" control
114 *
115 ********************************************************************/
116
117 #define WC_CCTL_SEPARATOR "ComctlSeparator"
118
119 #define SEPS_HORIZONTAL 0x0000
120 #define SEPS_VERTICAL 0x0001
121
122 BOOL ctlRegisterSeparatorLine(HAB hab);
123
124 /* ******************************************************************
125 *
126 * "Menu button" control
127 *
128 ********************************************************************/
129
130 VOID ctlDisplayButtonMenu(HWND hwndButton,
131 HWND hwndMenu);
132
133 BOOL ctlMakeMenuButton(HWND hwndButton,
134 HMODULE hmodMenu,
135 ULONG idMenu);
136
137 /* ******************************************************************
138 *
139 * Progress bars
140 *
141 ********************************************************************/
142
143 /*
144 *@@ PROGRESSBARDATA:
145 * structure for progress bar data,
146 * saved at QWL_USER window ulong.
147 */
148
149 typedef struct _PROGRESSBARDATA
150 {
151 ULONG ulNow,
152 ulMax,
153 ulPaintX,
154 ulOldPaintX;
155 ULONG ulAttr;
156 PFNWP OldStaticProc;
157 } PROGRESSBARDATA, *PPROGRESSBARDATA;
158
159 #define WM_UPDATEPROGRESSBAR WM_USER+1000
160
161 // status bar style attributes
162 #define PBA_NOPERCENTAGE 0x0000
163 #define PBA_ALIGNLEFT 0x0001
164 #define PBA_ALIGNRIGHT 0x0002
165 #define PBA_ALIGNCENTER 0x0003
166 #define PBA_PERCENTFLAGS 0x0003
167 #define PBA_BUTTONSTYLE 0x0010
168
169 BOOL ctlProgressBarFromStatic(HWND hwndStatic, ULONG ulAttr);
170
171 /* ******************************************************************
172 *
173 * Chart Control
174 *
175 ********************************************************************/
176
177 /*
178 *@@ CHARTDATA:
179 * chart data. This represents the
180 * data to be displayed.
181 *
182 * Used with the CHTM_SETCHARTDATA message
183 * and stored within CHARTCDATA (below).
184 */
185
186 typedef struct _CHARTDATA
187 {
188 USHORT usStartAngle,
189 // for "pie chart" mode, angle to start with (0%).
190 // This must be in the range of 0 to 360 degrees,
191 // with 0 degrees being the rightmost point
192 // of the arc.
193
194 // All degree values are counter-clockwise from that point.
195 // Example: 90 will start the arc at the top.
196
197 // 90ø
198 // +++++++
199 // + +
200 // + +
201 // + +
202 // + +
203 // + +
204 // 180ø + X + 0ø
205 // + +
206 // + +
207 // + +
208 // + +
209 // + +
210 // +++++++
211 // 270ø
212
213 usSweepAngle;
214 // the maximum angle to use for 100%, in addition to
215 // usStartAngle.
216 // This must be in the range of 0 to 360 degrees,
217 // with 0 degrees being usStartAngle.
218 // All degree values are counter-clockwise from that point.
219 // Example: Specify usStartAngle = 180 (1) to start the pie
220 // at the left and usSweepAngle = 270 (2) to draw a
221 // three-quarter total pie.
222
223 // 90ø
224 // ++++
225 // + _ +
226 // + |\ +
227 // + \ +
228 // + \ +
229 // + | +
230 // (1) 180ø +++++++++++ | + 0ø
231 // + / +
232 // + \ (2) +
233 // + \ / +
234 // + ------ +
235 // + +
236 // +++++++
237 // 270ø
238
239 ULONG cValues;
240 // data item count; the arrays in *padValues and *palColors
241 // (and also *papszDescriptions, if CHS_DESCRIPTIONS is
242 // enabled in CHARTSTYLE) must have this many items.
243 double* padValues;
244 // pointer to an array of double values;
245 // the sum of all these will make up 100%
246 // in the chart. In "pie chart" mode, the
247 // sum of all these values corresponds to
248 // the usSweepAngle angle; in "bar chart" mode,
249 // the sum corresponds to the width of the control.
250 // If this ptr is NULL, the chart displays nothing.
251 // Otherwise, this array must have cValues items.
252 LONG* palColors;
253 // pointer to an array of LONG RGB colors;
254 // each item in this array must correspond
255 // to an item in padValues and specifies the color
256 // to paint the corresponding data item with.
257 // This _must_ be specified if padValues is != NULL.
258 // This array must have cValues items.
259 PSZ* papszDescriptions;
260 // pointer to an array of PSZs containing
261 // data descriptions. If this pointer is
262 // NULL, or CHARTSTYLE.ulStyle does not have
263 // CHS_DESCRIPTIONS set, no texts will be displayed.
264 // Otherwise, this array must have cValues items.
265 } CHARTDATA, *PCHARTDATA;
266
267 // chart display mode:
268 #define CHS_PIECHART 0x0000
269 #define CHS_BARCHART 0x0001
270
271 // chart display flags (CHARTSTYLE.ulStyle):
272 #define CHS_SHADOW 0x0100 // (pie chart only) draw shadow
273 #define CHS_3D_BRIGHT 0x0200 // (pie chart only)
274 // // draw 3D block in same color as surface;
275 // CHARTSTYLE.ulThickness defines thickness
276 #define CHS_3D_DARKEN 0x0600 // (pie chart only)
277 // draw 3D block too, but darker
278 // compared to surface;
279 // CHARTSTYLE.ulThickness defines thickness
280
281 #define CHS_DRAWLINES 0x0800 // draw lines between pie slices
282 // added V0.9.12 (2001-05-03) [umoeller]
283
284 #define CHS_DESCRIPTIONS 0x1000 // show descriptions
285 #define CHS_DESCRIPTIONS_3D 0x3000 // same as CHS_DESCRIPTIONS, but shaded
286
287 #define CHS_SELECTIONS 0x4000 // allow data items to be selected using
288 // mouse and keyboard; this also enables
289 // WM_CONTROL notifications
290
291 /*
292 *@@ CHARTSTYLE:
293 *
294 */
295
296 typedef struct _CHARTSTYLE
297 {
298 ULONG ulStyle; // CHS_* flags
299
300 ULONG ulThickness; // (pie chart only)
301 // pie thickness (with CHS_3D_xxx) in pixels
302
303 double dPieSize; // (pie chart only)
304 // // size of the pie chart relative to the control
305 // size. A value of 1 would make the pie chart
306 // consume all available space. A value of .5
307 // would make the pie chart consume half of the
308 // control's space. The pie chart is always
309 // centered within the control.
310
311 double dDescriptions; // (pie chart only)
312 // position of the slice descriptions on the pie
313 // relative to the window size. To calculate the
314 // description positions, the control calculates
315 // an invisible pie slice again, for which this
316 // value is used. So a value of 1 would make the
317 // descriptions appear on the outer parts of the
318 // window (not recommended). A value of .5 would
319 // make the descriptions appear in the center of
320 // an imaginary line between the pie's center
321 // and the pie slice's outer border.
322 // This should be chosen in conjunction with
323 // dPieSize as well. If this is equal to dPieSize,
324 // the descriptions appear on the border of the
325 // slice. If this is half dPieSize, the descriptions
326 // appear in the center of the pie slice. If this
327 // is larger than dPieSize, the descriptions appear
328 // outside the slice.
329 } CHARTSTYLE, *PCHARTSTYLE;
330
331 HBITMAP ctlCreateChartBitmap(HPS hpsMem,
332 LONG lcx,
333 LONG lcy,
334 PCHARTDATA pChartData,
335 PCHARTSTYLE pChartStyle,
336 LONG lBackgroundColor,
337 LONG lTextColor,
338 HRGN* paRegions);
339
340 BOOL ctlChartFromStatic(HWND hwndStatic);
341
342 #define CHTM_SETCHARTDATA (WM_USER + 2)
343
344 #define CHTM_SETCHARTSTYLE (WM_USER + 3)
345
346 #define CHTM_ITEMFROMPOINT (WM_USER + 4)
347
348 #define CHTM_SETEMPHASIS (WM_USER + 5)
349
350 // WM_CONTROL notification codes
351
352 /*
353 *@@ CHTN_EMPHASISCHANGED:
354 * WM_CONTROL notification code sent (!)
355 * by a chart control to its owner when
356 * selections change in the control.
357 *
358 * This is only sent if the CHS_SELECTIONS
359 * style bit is set in the control.
360 *
361 * Parameters:
362 *
363 * -- USHORT SHORT1FROMMP(mp1): usid (control ID).
364 * -- USHORT SHORT2FROMMP(mp1): CHTN_EMPHASISCHANGED.
365 *
366 * -- mp2: pointer to EMPHASISNOTIFY structure.
367 *
368 * Note: The control only sends one such notification,
369 * even if an old selection was undone. That is, if
370 * item 1 was previously selected and item 2 is then
371 * selected, only one notification for item 2 is sent.
372 *
373 *@@added V0.9.12 (2001-05-03) [umoeller]
374 */
375
376 #define CHTN_EMPHASISCHANGED 1001
377
378 /*
379 *@@ CHTN_CONTEXTMENU:
380 * WM_CONTROL notification code sent (!)
381 * by a chart control to its owner when
382 * a context menu was requested on the
383 * control.
384 *
385 * This is only sent if the CHS_SELECTIONS
386 * style bit is set in the control.
387 *
388 * Parameters:
389 *
390 * -- USHORT SHORT1FROMMP(mp1): usid (control ID).
391 * -- USHORT SHORT2FROMMP(mp1): CHTN_EMPHASISCHANGED.
392 *
393 * -- mp2: pointer to EMPHASISNOTIFY structure.
394 * If the context menu was requested on a chart
395 * slice, lIndex has the index of the slice.
396 * Otherwise (e.g. whitespace), lIndex will
397 * be -1.
398 *
399 *@@added V0.9.12 (2001-05-03) [umoeller]
400 */
401
402 #define CHTN_CONTEXTMENU 1002
403
404 /*
405 *@@ CHTN_ENTER:
406 * WM_CONTROL notification code sent (!)
407 * by a chart control to its owner when
408 * the user double-clicked on a data item.
409 *
410 * This is only sent if the CHS_SELECTIONS
411 * style bit is set in the control.
412 *
413 * Parameters:
414 *
415 * -- USHORT SHORT1FROMMP(mp1): usid (control ID).
416 * -- USHORT SHORT2FROMMP(mp1): CHTN_ENTER.
417 *
418 * -- mp2: pointer to EMPHASISNOTIFY structure.
419 * If the double click occurred on a chart
420 * slice, lIndex has the index of the slice.
421 * Otherwise (e.g. whitespace), lIndex will
422 * be -1.
423 *
424 *@@added V0.9.12 (2001-05-03) [umoeller]
425 */
426
427 #define CHTN_ENTER 1003
428
429 /*
430 *@@ CHTN_SETFOCUS:
431 * WM_CONTROL notification code sent (!)
432 * by a chart control to its owner when
433 * gaining focus.
434 *
435 * Parameters:
436 *
437 * -- USHORT SHORT1FROMMP(mp1): usid (control ID).
438 * -- USHORT SHORT2FROMMP(mp1): CHTN_SETFOCUS.
439 *
440 * -- mp2: pointer to EMPHASISNOTIFY structure.
441 *
442 *@@added V0.9.20 (2002-07-17) [pr]
443 */
444
445 #define CHTN_SETFOCUS 1004
446
447 /*
448 *@@ CHTN_KILLFOCUS:
449 * WM_CONTROL notification code sent (!)
450 * by a chart control to its owner when
451 * losing focus.
452 *
453 * Parameters:
454 *
455 * -- USHORT SHORT1FROMMP(mp1): usid (control ID).
456 * -- USHORT SHORT2FROMMP(mp1): CHTN_KILLFOCUS.
457 *
458 * -- mp2: pointer to EMPHASISNOTIFY structure.
459 *
460 *@@added V0.9.20 (2002-07-17) [pr]
461 */
462
463 #define CHTN_KILLFOCUS 1005
464
465 /*
466 *@@ EMPHASISNOTIFY:
467 * structure used with CHTN_EMPHASISCHANGED,
468 * CHTN_ENTER, and CHTN_CONTEXTMENU.
469 *
470 *@@added V0.9.12 (2001-05-03) [umoeller]
471 */
472
473 typedef struct _EMPHASISNOTIFY
474 {
475 HWND hwndSource;
476 // window handle of the chart control
477 ULONG ulEmphasis;
478 // with CHTN_EMPHASISCHANGED: emphasis which has changed
479 // (0 for selection, 1 for source emphasis).
480 // Otherwise undefined.
481 LONG lIndex;
482 // with CHTN_EMPHASISCHANGED: index of the data
483 // item for which emphasis has changed (counting
484 // from 0); if -1, a previous emphasis has been undone.
485 // With CHTN_CONTEXTMENU and CHTN_ENTER, index of the
486 // data item for which the request occurred, or -1 for
487 // a request on the control's whitespace.
488 POINTL ptl;
489 // exact window coordinates where mouse
490 // click occurred (e.g. for context menu).
491 // This is undefined (-1) if the event was not
492 // caused by a mouse click.
493 } EMPHASISNOTIFY, *PEMPHASISNOTIFY;
494
495 /* ******************************************************************
496 *
497 * Super Combo Box
498 *
499 ********************************************************************/
500
501 BOOL ctlComboFromEntryField(HWND hwnd,
502 ULONG flStyle);
503
504 /* ******************************************************************
505 *
506 * Split bars
507 *
508 ********************************************************************/
509
510 #define WC_SPLITWINDOW "SplitWindowClass"
511
512 #define SBCF_VERTICAL 0x0000
513 #define SBCF_HORIZONTAL 0x0001
514
515 #define SBCF_PERCENTAGE 0x0002
516 #define SBCF_3DSUNK 0x0100
517 #define SBCF_3DEXPLORERSTYLE 0x0200
518 // new with V1.0.0 (2002-08-21) [umoeller]
519 // this simulates the Warp 4 entry field margins around the
520 // right split window, but leaves the left window flat
521 #define SBCF_MOVEABLE 0x1000
522
523 /*
524 *@@ SPLITBARCDATA:
525 * split bar creation data
526 */
527
528 typedef struct _SPLITBARCDATA
529 {
530 ULONG ulSplitWindowID;
531 // window ID of the split window
532 ULONG ulCreateFlags;
533 // split window style flags.
534 // One of the following:
535 // -- SBCF_VERTICAL: the split bar will be vertical.
536 // -- SBCF_HORIZONTAL: the split bar will be horizontal.
537 // plus any or none of the following:
538 // -- SBCF_PERCENTAGE: lPos does not specify absolute
539 // coordinates, but a percentage of the window
540 // width or height. In that case, the split
541 // bar position is not fixed, but always recalculated
542 // as a percentage.
543 // Otherwise, the split bar will be fixed.
544 // -- SBCF_3DSUNK: draw a "sunk" 3D frame around the
545 // split windows.
546 // -- SBCF_MOVEABLE: the split bar may be moved with
547 // the mouse.
548 LONG lPos;
549 // position of the split bar within hwndParentAndOwner.
550 // If SBCF_PERCENTAGE, this has the percentage;
551 // otherwise:
552 // if this value is positive, it's considered
553 // an offset from the left/bottom of the frame;
554 // if it's negative, it's from the right
555 ULONG ulLeftOrBottomLimit,
556 ulRightOrTopLimit;
557 // when moving the split bar (SBCF_MOVEABLE), these
558 // are the minimum and maximum values.
559 // ulLeftOrBottomLimit is the left (or bottom) limit,
560 // ulRightOrTopLimit is the right (or top) limit.
561 // Both are offsets in window coordinates from the
562 // left (or bottom) and right (or top) boundaries of
563 // the split window. If both are 0, the whole split
564 // window is allowed (not recommended).
565 HWND hwndParentAndOwner;
566 // the owner and parent of the split bar
567 // and other windows; this must be the FID_CLIENT
568 // of a frame or another split window (when nesting)
569 } SPLITBARCDATA, *PSPLITBARCDATA;
570
571 /*
572 *@@ SPLITBARDATA:
573 * internal split bar data,
574 * stored in QWL_USER window ulong
575 */
576
577 typedef struct _SPLITBARDATA
578 {
579 SPLITBARCDATA sbcd;
580 PFNWP OldStaticProc;
581 HPOINTER hptrOld, // old pointer stored upon WM_MOUSEMOVE
582 hptrMove; // PM move pointer, either vertical or horizontal
583 BOOL fCaptured;
584 POINTS ptsMousePos;
585 POINTL ptlDrawLineFrom,
586 ptlDrawLineTo;
587 HPS hpsTrackBar;
588 HWND hwndLinked1,
589 // the left/bottom window to link
590 hwndLinked2;
591 // the right/top window to link
592 LONG lcol3DDark,
593 lcol3DLight,
594 lcolInactiveBorder;
595 } SPLITBARDATA, *PSPLITBARDATA;
596
597 #define ID_SPLITBAR 5000 // fixed ID of the split bar
598 // (child of split window)
599
600 /*
601 *@@ SPLM_SETLINKS:
602 * this specifies the windows which the
603 * split window will link. This updates
604 * the internal SPLITBARDATA and changes
605 * the parents of the two subwindows to
606 * the split window.
607 *
608 * Parameters:
609 * HWND mp1: left or bottom subwindow
610 * HWND mp2: right or top subwindow
611 */
612
613 #define SPLM_SETLINKS (WM_USER + 500)
614
615 HWND ctlCreateSplitWindow(HAB hab,
616 PSPLITBARCDATA psbcd);
617
618 BOOL ctlUpdateSplitWindow(HWND hwndSplit);
619
620 BOOL ctlSetSplitFrameWindowPos(HWND hwndFrame,
621 HWND hwndInsertBehind,
622 LONG x,
623 LONG y,
624 LONG cx,
625 LONG cy,
626 ULONG fl,
627 HWND *pahwnd,
628 ULONG cbhwnd);
629
630 LONG ctlQuerySplitPos(HWND hwndSplit);
631
632 /* ******************************************************************
633 *
634 * Subclassed Static Bitmap Control
635 *
636 ********************************************************************/
637
638 // flags for ANIMATIONDATA.ulFlags
639 #define ANF_ICON 0x0001
640 #define ANF_BITMAP 0x0002
641 #define ANF_PROPORTIONAL 0x0004
642
643 /*
644 *@@ ANIMATIONDATA:
645 * this structure gets stored in QWL_USER
646 * before subclassing the static control
647 *
648 *@@changed V0.9.0: added fields for bitmap support
649 *@@changed V0.9.16 (2001-10-15) [umoeller]: added lIconSize
650 *@@changed V0.9.19 (2002-06-18) [umoeller]: added szlIcon
651 */
652
653 typedef struct _ANIMATIONDATA
654 {
655 // the following need to be initialized before
656 // subclassing
657 HAB hab; // (added V0.9.0)
658 ULONG ulFlags;
659 // one of the following:
660 // -- ANF_ICON: display icons
661 // -- ANF_BITMAP: display bitmaps
662 // -- ANF_BITMAP | ANF_PROPORTIONAL: display bitmaps, but preserve proportions
663 SIZEL szlIcon; // system icon size V0.9.19 (2002-06-18) [umoeller]
664 RECTL rclIcon; // size of static control
665 PFNWP OldStaticProc; // original WC_STATIC wnd proc
666
667 // the following are set by fnwpSubclassedStatic upon
668 // receiving SM_SETHANDLE (in all modes) or later
669 HBITMAP hbm, // bitmap to be painted upon WM_PAINT
670 hbmHalftoned; // bitmap in case of WS_DISABLED (added V0.9.0)
671 HPOINTER hptr; // icon handle passed to SM_SETHANDLE
672 HBITMAP hbmSource; // bitmap handle passed to SM_SETHANDLE
673 // (this can be deleted later) (added V0.9.0)
674
675 // the following need to be initialized
676 // for icon mode only (ANF_ICON)
677 ULONG ulDelay; // delay per animation step in ms
678 USHORT usAniCurrent; // current animation step (>= 0)
679
680 USHORT usAniCount; // no. of animation steps
681 HPOINTER ahptrAniIcons[1]; // variable-size array of animation steps;
682 // there must be usAniCount items
683 } ANIMATIONDATA, *PANIMATIONDATA;
684
685 PANIMATIONDATA ctlPrepareStaticIcon(HWND hwndStatic, USHORT usAnimCount);
686
687 BOOL ctlPrepareAnimation(HWND hwndStatic,
688 USHORT usAnimCount,
689 HPOINTER *pahptr,
690 ULONG ulDelay,
691 BOOL fStartAnimation);
692
693 BOOL ctlStartAnimation(HWND hwndStatic);
694
695 BOOL ctlStopAnimation(HWND hwndStatic);
696
697 PANIMATIONDATA ctlPrepareStretchedBitmap(HWND hwndStatic,
698 BOOL fPreserveProportions);
699
700
701 /* ******************************************************************
702 *
703 * "Tooltip" control
704 *
705 ********************************************************************/
706
707 #define WC_CCTL_TOOLTIP "ComctlTooltipClass"
708 // define identifier changed V1.0.1 (2002-11-30) [umoeller]
709
710 // addt'l tooltip window styles: use lower 16 bits
711 #define TTS_ALWAYSTIP 0x0001
712 #define TTS_NOPREFIX 0x0002
713 // non-Win95 flags
714 #define TTS_ROUNDED 0x0004
715 #define TTS_SHADOW 0x0008
716
717 // TOOLINFO.uFlags flags (ORed)
718 // #define TTF_IDISHWND 0x0001
719 // V0.9.7 (2001-01-03) [umoeller]: removed this win95 crap
720 // #define TTF_CENTERBELOW 0x0002
721 // #define TTF_CENTERABOVE 0x0004
722 // #define TTF_RTLREADING 0x0004
723 // V0.9.7 (2001-01-03) [umoeller]: removed this win95 crap
724
725 #define TTF_SUBCLASS 0x0008
726 // non-Win95 flags
727 #define TTF_SHYMOUSE 0x0010
728
729 // new flags with V0.9.7 (2001-01-20) [umoeller]
730 #define TTF_CENTER_X_ON_TOOL 0x0020
731 #define TTF_POS_Y_ABOVE_TOOL 0x0040
732 #define TTF_POS_Y_BELOW_TOOL 0x0080
733
734 #define PSZ_TEXTCALLBACK (PSZ)-1
735
736 #define TT_SHADOWOFS 10
737 #define TT_ROUNDING 8
738
739 /*
740 *@@ TOOLINFO:
741 * info structure to register a tool with a
742 * tooltip control. Used with TTM_ADDTOOL
743 * and many other TTM_* messages.
744 *
745 *@@changed V0.9.7 (2001-01-03) [umoeller]: removed all that win95 crap
746 */
747
748 typedef struct _TOOLINFO
749 {
750 ULONG ulFlags;
751 // in: flags for the tool, any combination of:
752 // -- TTF_SUBCLASS: Indicates that the tooltip control should
753 // subclass hwndTool to intercept messages,
754 // such as WM_MOUSEMOVE. See TTM_RELAYEVENT.
755 // -- TTF_SHYMOUSE: shy away from mouse pointer;
756 // always position the tool tip such that it is never
757 // covered by the mouse pointer (for readability);
758 // added V0.9.1 (2000-02-04) [umoeller]
759 // -- TTF_CENTER_X_ON_TOOL: position tooltip X so that
760 // it's centered on the tool (doesn't affect Y)
761 // -- TTF_POS_Y_ABOVE_TOOL: position tooltip Y above
762 // the tool; cannot be used with TTF_POS_Y_BELOW_TOOL
763 // -- TTF_POS_Y_BELOW_TOOL: position tooltip Y below
764 // the tool; cannot be used with TTF_POS_Y_ABOVE_TOOL
765 HWND hwndToolOwner;
766 // in: handle to the window that contains the tool. If
767 // pszText includes the PSZ_TEXTCALLBACK value, this
768 // member identifies the window that receives TTN_NEEDTEXT
769 // notification messages.
770 HWND hwndTool;
771 // in: window handle of the tool.
772 PSZ pszText;
773 // in: pointer to the buffer that contains the text for the
774 // tool (if the hiword is != NULL), or identifier of the string
775 // resource that contains the text (if the hiword == NULL).
776 // If this member is set to the PSZ_TEXTCALLBACK value,
777 // the control sends the TTN_NEEDTEXT notification message to
778 // hwndToolOwner to retrieve the text.
779 } TOOLINFO, *PTOOLINFO;
780
781 /*
782 * tooltip messages
783 *
784 */
785
786 #define TTM_FIRST (WM_USER + 1000)
787
788 #define TTM_ACTIVATE (TTM_FIRST + 1)
789
790 #define TTM_ADDTOOL (TTM_FIRST + 2)
791
792 #define TTM_DELTOOL (TTM_FIRST + 3)
793
794 #define TTM_NEWTOOLRECT (TTM_FIRST + 4)
795
796 #define TTM_RELAYEVENT (TTM_FIRST + 5)
797
798 // flags for TTM_SETDELAYTIME
799 #define TTDT_AUTOMATIC 1
800 #define TTDT_AUTOPOP 2
801 #define TTDT_INITIAL 3
802 #define TTDT_RESHOW 4
803
804 #define TTM_GETDELAYTIME (TTM_FIRST + 6)
805 // added V0.9.12 (2001-04-28) [umoeller]
806
807 #define TTM_SETDELAYTIME (TTM_FIRST + 7)
808
809 #define TTFMT_PSZ 0x01
810 #define TTFMT_STRINGRES 0x02
811
812 /*
813 *@@ TOOLTIPTEXT:
814 * identifies a tool for which text is to
815 * be displayed and receives the text for
816 * the tool. The tool must fill all fields
817 * of this structure.
818 *
819 * This structure is used with the TTN_NEEDTEXT
820 * notification.
821 *
822 *@@changed V0.9.7 (2001-01-03) [umoeller]: got rid of this win95 crap
823 */
824
825 typedef struct _TOOLTIPTEXT
826 {
827 HWND hwndTooltip;
828 // in: tooltip control who's sending this.
829 HWND hwndTool;
830 // in: tool for which the text is needed.
831 ULONG ulFormat;
832 // out: one of:
833 // -- TTFMT_PSZ: pszText contains the new, zero-terminated string.
834 // -- TTFMT_STRINGRES: hmod and idResource specify a string resource
835 // to be loaded.
836 PSZ pszText;
837 // out: with TTFMT_PSZ, pointer to a string that contains the
838 // tool text. Note that this is not copied into the tooltip...
839 // so this must point to a static buffer that is valid while
840 // the tooltip is showing.
841 HMODULE hmod;
842 // out: with TTFMT_STRINGRES, the module handle of the resource.
843 ULONG idResource;
844 // out: with TTFMT_STRINGRES, the string resource ID.
845 } TOOLTIPTEXT, *PTOOLTIPTEXT;
846
847 #define TTM_GETTEXT (TTM_FIRST + 8)
848
849 #define TTM_UPDATETIPTEXT (TTM_FIRST + 9)
850
851 /*
852 *@@ TT_HITTESTINFO:
853 * contains information that a tooltip control uses to determine whether
854 * a point is in the bounding rectangle of the specified tool. If the point
855 * is in the rectangle, the structure receives information about the tool.
856 *
857 * This structure is used with the TTM_HITTEST message.
858 */
859
860 typedef struct _TT_HITTESTINFO
861 {
862 HWND hwnd; // in: handle to the tool or window with the specified tool.
863 POINTL /* POINT */ pt;
864 // in: client coordinates of the point to test (Win95: POINT)
865 TOOLINFO ti; // out: receives information about the specified tool.
866 } TTHITTESTINFO, *PHITTESTINFO;
867
868 #define TTM_HITTEST (TTM_FIRST + 10)
869
870 #define TTM_WINDOWFROMPOINT (TTM_FIRST + 11)
871
872 #define TTM_ENUMTOOLS (TTM_FIRST + 12)
873
874 #define TTM_GETCURRENTTOOL (TTM_FIRST + 13)
875
876 #define TTM_GETTOOLCOUNT (TTM_FIRST + 14)
877
878 #define TTM_GETTOOLINFO (TTM_FIRST + 15)
879
880 #define TTM_SETTOOLINFO (TTM_FIRST + 16)
881
882 // non-Win95 messages
883
884 #define TTM_SHOWTOOLTIPNOW (TTM_FIRST + 17)
885
886 /*
887 * tooltip notification codes (WM_CONTROL)
888 *
889 */
890
891 /*
892 *@@ TTN_NEEDTEXT:
893 * notification code used with WM_CONTROL when a tooltip
894 * needs a tooltip text for a tool.
895 *
896 * Parameters:
897 *
898 * -- SHORT1FROMMP(mp1) usID: ID of the tooltip control).
899 *
900 * -- SHORT2FROMMP(mp1) usNotifyCode: TTN_NEEDTEXT.
901 *
902 * -- PTOOLTIPTEXT mp2: pointer to a TOOLTIPTEXT structure.
903 * hwndTool identifies the tool for which text is needed.
904 *
905 * This notification message is sent to the window specified
906 * in the hwndToolOwner member of the TOOLINFO structure for the tool.
907 * This notification is sent only if the PSZ_TEXTCALLBACK
908 * value is specified when the tool is added to a tooltip control.
909 *
910 * To specify the text, the target window (hwndToolOwner) must:
911 *
912 * 1. Set TOOLTIPTEXT.ulFormat to one of the format flags.
913 *
914 * 2. Fill the corresponding field(s) in TOOLTIPTEXT.
915 *
916 * Specifying PSZ_TEXTCALLBACK in TOOLINFO.lpszText with
917 * TTM_ADDTOOL is the only way under OS/2 to have strings
918 * displayed which are longer than 256 characters, since
919 * string resources are limited to 256 characters with OS/2.
920 * It is the responsibility of the application to set the
921 * pszText member to a _static_ string buffer which holds
922 * the string for the tool. A common error would be to have
923 * that member point to some variable which has only been
924 * allocated on the stack... this will lead to problems.
925 */
926
927 #define TTN_NEEDTEXT 1000
928
929 /*
930 *@@ TTN_SHOW:
931 * control notification sent with the WM_NOTIFY (Win95)
932 * and WM_CONTROL (OS/2) messages.
933 *
934 * Parameters (OS/2, incompatible with Win95):
935 * -- mp1 USHORT usID;
936 * USHORT usNotifyCode == TTN_NEEDTEXT
937 * -- ULONG mp2: PTOOLINFO of the tool for which the
938 * tool is about to be displayed.
939 *
940 * Return value: always 0.
941 *
942 * The TTN_SHOW notification message notifies the owner window
943 * that a tooltip is about to be displayed.
944 */
945
946 #define TTN_SHOW 1001
947
948 /*
949 *@@ TTN_POP:
950 * control notification sent with the WM_NOTIFY (Win95)
951 * and WM_CONTROL (OS/2) messages.
952 *
953 * Parameters (OS/2, incompatible with Win95):
954 * -- mp1 USHORT usID;
955 * USHORT usNotifyCode == TTN_NEEDTEXT
956 * -- ULONG mp2: PTOOLINFO of the tool for which the
957 * tooltip was visible.
958 *
959 * Return value: always 0.
960 *
961 * The TTN_SHOW notification message notifies the owner window
962 * that a tooltip is about to be hidden.
963 */
964
965 #define TTN_POP 1002
966
967 BOOL ctlRegisterTooltip(HAB hab);
968
969 MRESULT EXPENTRY ctl_fnwpTooltip(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
970
971 /* ******************************************************************
972 *
973 * "Tool bar button" control
974 *
975 ********************************************************************/
976
977 #define WC_CCTL_TOOLBAR "ComctlToolbarClass"
978
979 // toolbar button styles: use lower 16 bits
980 #define TBBS_BIGICON 0x0001
981 #define TBBS_MINIICON 0x0002
982 #define TBBS_BITMAP 0x0004
983 #define TBBS_TEXT 0x0008
984
985 #define TBBS_CHECK 0x0010
986 #define TBBS_RADIO 0x0020
987 #define TBBS_CHECKINITIAL 0x0040
988
989 #define TBBS_AUTORESIZE 0x0100
990 #define TBBS_HILITE 0x0200
991 #define TBBS_FLAT 0x0400
992
993 #define TBBS_COMMAND 0x1000
994 #define TBBS_SYSCOMMAND 0x2000
995 #define TBBS_DROPMNEMONIC 0x4000
996
997 // tool bar button messages
998
999 #define TBBM_CHECK (WM_USER + 1)
1000
1001 #define TBBM_QUERYCHECK (WM_USER + 2)
1002
1003 /*
1004 *@@ XBUTTONDATA:
1005 * paint data for ctlPaintTBButton.
1006 *
1007 *@@added V0.9.13 (2001-06-21) [umoeller]
1008 */
1009
1010 typedef struct _XBUTTONDATA
1011 {
1012 DEFWINDATA dwd; // color for center (button background)
1013
1014 SIZEL szlIconOrBitmap;
1015
1016 HPOINTER hptr; // icon to paint or NULLHANDLE
1017
1018 } XBUTTONDATA, *PXBUTTONDATA;
1019
1020 /*
1021 *@@ XBUTTONSTATE:
1022 *
1023 *@@added V1.0.1 (2002-11-30) [umoeller]
1024 */
1025
1026 typedef struct _XBUTTONSTATE
1027 {
1028 BOOL fMB1Pressed; // if TRUE, mouse button is currently pressed
1029 BOOL fIgnoreMB1Up;
1030 BOOL fPaintButtonSunk; // if TRUE, button control is to be painted "down"
1031 BOOL fMouseCaptured; // if TRUE, mouse is currently captured
1032 BOOL fMouseOver;
1033 } XBUTTONSTATE, *PXBUTTONSTATE;
1034
1035 // the following styles are only for painting and not stored
1036 #define TBBS_BACKGROUND 0x00010000
1037 #define TBBS_INUSE 0x00020000
1038
1039 VOID ctlPaintTBButton(HPS hps,
1040 ULONG fl,
1041 PXBUTTONDATA pbd,
1042 PXBUTTONSTATE pbs);
1043
1044 MRESULT EXPENTRY ctl_fnwpToolbarButton(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
1045
1046 /* ******************************************************************
1047 *
1048 * "Tool bar" control
1049 *
1050 ********************************************************************/
1051
1052 #define WC_CCTL_TBBUTTON "ComCtlToolbarButton"
1053 // define identifier changed V1.0.1 (2002-11-30) [umoeller]
1054
1055 // tool bar window styles: use lower 16 bits
1056 #define TBS_TOOLTIPS 0x0001
1057 #define TBS_AUTORESIZE 0x0002
1058
1059 /*
1060 *@@ TOOLBARCONTROL:
1061 *
1062 *@@added V1.0.1 (2002-11-30) [umoeller]
1063 */
1064
1065 typedef struct _TOOLBARCONTROL
1066 {
1067 PCSZ pcszClass;
1068 PCSZ pcszTitle;
1069 ULONG flStyle;
1070 ULONG id;
1071 LONG cx,
1072 cy;
1073 } TOOLBARCONTROL, *PTOOLBARCONTROL;
1074
1075 /*
1076 *@@ TOOLBARCDATA:
1077 *
1078 *@@added V1.0.1 (2002-11-30) [umoeller]
1079 */
1080
1081 typedef struct _TOOLBARCDATA
1082 {
1083 USHORT cb;
1084
1085 HWND hwndControlsOwner;
1086
1087 ULONG cControls;
1088 PTOOLBARCONTROL patbc;
1089
1090 } TOOLBARCDATA, *PTOOLBARCDATA;
1091
1092 #define TBM_ADDCONTROLS (WM_USER + 1)
1093
1094 /*
1095 *@@ TBN_RESIZED:
1096 * notification code posted with WM_CONTROL when
1097 * a tool bar has resized itself, e.g. because
1098 * controls were added or removed.
1099 *
1100 * Parameters:
1101 *
1102 * -- SHORT1FROMMP(mp1): ID of the tool bar control.
1103 *
1104 * -- SHORT2FROMMP(mp1): TBN_RESIZED code.
1105 *
1106 * -- mp2: unused.
1107 *
1108 *@@added V1.0.1 (2002-11-30) [umoeller]
1109 */
1110
1111 #define TBN_RESIZED 1
1112
1113 MRESULT EXPENTRY ctl_fnwpToolbar(HWND hwndToolbar, ULONG msg, MPARAM mp1, MPARAM mp2);
1114
1115 BOOL ctlRegisterToolbar(HAB hab);
1116
1117 HWND ctlCreateToolBar(HWND hwndParent,
1118 HWND hwndOwner,
1119 ULONG flStyle,
1120 HWND hwndControlsOwner,
1121 ULONG cControls,
1122 PTOOLBARCONTROL patbc);
1123
1124 /* ******************************************************************
1125 *
1126 * Extended frame
1127 *
1128 ********************************************************************/
1129
1130 #define FID_TOOLBAR 0x8101
1131 #define FID_STATUSBAR 0x8100
1132
1133 /*
1134 *@@ EXTFRAMECDATA:
1135 *
1136 *@@added V0.9.16 (2001-09-29) [umoeller]
1137 */
1138
1139 typedef struct _EXTFRAMECDATA
1140 {
1141 PSWP pswpFrame; // in: frame wnd pos (can be NULL)
1142 ULONG flFrame; // in: standard FCF_* flags
1143 ULONG flExtFrame; // in: XFCF_* flags
1144 #define XFCF_STATUSBAR 0x0001
1145 // create a status bar for the frame
1146 #define XFCF_TOOLBAR 0x0002
1147 // create a tool bar for the frame
1148 #define XFCF_FORCETBOWNER 0x0004
1149 // if set, we will enfore that all toolbar controls have
1150 // the main frame as their owner, otherwise they'll have
1151 // the frame's client, if one exists
1152 ULONG flStyleFrame; // in: frame style (WS_* flags, e.g. WS_VISIBLE | WS_ANIMATE)
1153 PCSZ pcszFrameTitle; // in: frame title (title bar)
1154 ULONG ulResourcesID; // in: according to FCF_* flags
1155
1156 PCSZ pcszClassClient; // in: client class name or NULL for no client
1157 ULONG flStyleClient; // in: client style (WS_* flags, e.g. WS_VISIBLE)
1158
1159 ULONG ulID; // in: frame window ID
1160 PVOID pClientCtlData; // in: pCtlData structure pointer for client
1161
1162 HINI hiniSaveWinPos; // in: HINI for saving window position or NULLHANDLE
1163 PCSZ pcszIniApp,
1164 pcszIniKey;
1165
1166 ULONG cTBControls; // in: count of tool bar controls in paTBControls or 0
1167 PTOOLBARCONTROL paTBControls;
1168
1169 } EXTFRAMECDATA, *PEXTFRAMECDATA;
1170
1171 /*
1172 *@@ XFRAMECONTROLS:
1173 *
1174 *@@added V1.0.1 (2002-11-30) [umoeller]
1175 */
1176
1177 typedef struct _XFRAMECONTROLS
1178 {
1179 PFNWP pfnwpOrig; // original frame wnd proc from subclassing
1180
1181 HWND hwndToolBar,
1182 hwndStatusBar;
1183
1184 LONG lToolBarHeight,
1185 lStatusBarHeight;
1186
1187 } XFRAMECONTROLS, *PXFRAMECONTROLS;
1188
1189 /*
1190 *@@ EXTFRAMEDATA:
1191 *
1192 *@@added V0.9.16 (2001-09-29) [umoeller]
1193 */
1194
1195 typedef struct _EXTFRAMEDATA
1196 {
1197 EXTFRAMECDATA CData;
1198
1199 XFRAMECONTROLS xfc;
1200
1201 PVOID pvUser; // more data for user (e.g. for additional subclassing)
1202
1203 } EXTFRAMEDATA, *PEXTFRAMEDATA;
1204
1205 MRESULT ctlFormatExtFrame(HWND hwndFrame,
1206 const XFRAMECONTROLS *pxfc,
1207 MPARAM mp1,
1208 MPARAM mp2);
1209
1210 MRESULT ctlCalcExtFrameRect(HWND hwndFrame,
1211 const XFRAMECONTROLS *pxfc,
1212 MPARAM mp1,
1213 MPARAM mp2);
1214
1215 HWND ctlCreateStatusBar(HWND hwndFrame,
1216 HWND hwndOwner,
1217 const char *pcszText,
1218 const char *pcszFont,
1219 LONG lColor);
1220
1221 HWND ctlCreateStdWindow(PEXTFRAMECDATA pData,
1222 PHWND phwndClient);
1223
1224 /* ******************************************************************
1225 *
1226 * Checkbox container record cores
1227 *
1228 ********************************************************************/
1229
1230 BOOL ctlDrawCheckbox(HPS hps,
1231 LONG x,
1232 LONG y,
1233 USHORT usRow,
1234 USHORT usColumn,
1235 BOOL fHalftoned);
1236
1237 #ifdef INCL_WINSTDCNR
1238
1239 /*
1240 *@@ CN_RECORDCHECKED:
1241 * extra WM_CONTROL notification code.
1242 * See ctlMakeCheckboxContainer for
1243 * details.
1244 */
1245
1246 #define CN_RECORDCHECKED 999
1247
1248 /*
1249 *@@ CHECKBOXRECORDCORE:
1250 * extended record core structure used
1251 * with checkbox containers. See
1252 * ctlMakeCheckboxContainer for details.
1253 *
1254 * The check box painting is determined
1255 * by the following flags:
1256 *
1257 * -- Only if (ulStyle & WS_VISIBLE), the check
1258 * box is painted at all. Otherwise hptrIcon
1259 * is painted. (Is this true?)
1260 *
1261 * -- In that case, usCheckState determines
1262 * whether the check box is painted checked,
1263 * unchecked, or indeterminate.
1264 *
1265 * -- In addition, if RECORDCORE.flRecordAttr
1266 * has the CRA_DISABLED bit set, the check
1267 * box is painted disabled (halftoned).
1268 *
1269 *@@changed V0.9.9 (2001-03-27) [umoeller]: made item id a ULONG
1270 */
1271
1272 typedef struct _CHECKBOXRECORDCORE
1273 {
1274 RECORDCORE recc;
1275 // standard record core structure
1276 ULONG ulStyle;
1277 // any combination of the following:
1278 // -- WS_VISIBLE
1279 // -- none or one of the following:
1280 // BS_AUTOCHECKBOX, BS_AUTO3STATE, BS_3STATE
1281 // Internally, we use BS_BITMAP to identify
1282 // the depressed checkbox button.
1283 ULONG ulItemID;
1284 // this identifies the record; must be
1285 // unique within the container
1286 // changed V0.9.9 (2001-03-27) [umoeller]: turned USHORT into ULONG
1287 USHORT usCheckState;
1288 // current check state as with checkboxes
1289 // (0, 1, or 2 for tri-state).
1290 HPOINTER hptrIcon;
1291 // if this is != NULLHANDLE, this icon
1292 // will always be used for painting,
1293 // instead of the default check box
1294 // bitmaps. Useful for non-auto check
1295 // box records to implement something
1296 // other than checkboxes.
1297 } CHECKBOXRECORDCORE, *PCHECKBOXRECORDCORE;
1298
1299 /*
1300 *@@ CHECKBOXCNROWNER:
1301 *
1302 *
1303 *@@added V0.9.0 (99-11-28) [umoeller]
1304 */
1305
1306 typedef struct _CHECKBOXCNROWNER
1307 {
1308 HWND hwndCnr; // container window handle
1309 USHORT usCnrID; // container item ID
1310 HWND hwndOwner; // owner of that container
1311 PFNWP pfnwpCnrOrig; // original window proc of hwndCnr
1312 PFNWP pfnwpOwnerOrig; // original window proc of hwndOwner
1313
1314 HAB habCnr;
1315
1316 PCHECKBOXRECORDCORE preccClicked; // != NULL if mb1 is currently down on recc
1317 PCHECKBOXRECORDCORE preccSpace; // != NULL if space key is down with recc
1318 RECTL rclReccClicked; // rectangle of that record
1319 } CHECKBOXCNROWNER, *PCHECKBOXCNROWNER;
1320
1321 MRESULT ctlDrawCheckBoxRecord(MPARAM mp2);
1322
1323 ULONG ctlQueryCheckboxSize(VOID);
1324
1325 VOID ctlInitCheckboxContainer(HWND hwndCnr);
1326
1327 BOOL ctlMakeCheckboxContainer(HWND hwndCnrOwner,
1328 USHORT usCnrID);
1329
1330 PCHECKBOXRECORDCORE ctlFindCheckRecord(HWND hwndCnr,
1331 ULONG ulItemID);
1332
1333 BOOL ctlSetRecordChecked(HWND hwndCnr,
1334 ULONG ulItemID,
1335 USHORT usCheckState);
1336
1337 ULONG ctlQueryRecordChecked(HWND hwndCnr,
1338 ULONG ulItemID,
1339 USHORT usCheckState);
1340
1341 BOOL ctlEnableRecord(HWND hwndCnr,
1342 ULONG ulItemID,
1343 BOOL fEnable);
1344 #endif
1345
1346 /* ******************************************************************
1347 *
1348 * Hotkey entry field
1349 *
1350 ********************************************************************/
1351
1352 /*
1353 *@@ EN_HOTKEY:
1354 * extra notification code with WM_CONTROL
1355 * and subclassed hotkey entry fields.
1356 * This is SENT to the entry field's owner
1357 * every time a key is pressed. Note that
1358 * this is only sent for key-down events
1359 * and if all the KC_DEADKEY | KC_COMPOSITE | KC_INVALIDCOMP
1360 * flags are not set.
1361 *
1362 * WM_CONTROL parameters in this case:
1363 * -- mp1: USHORT id,
1364 * USHORT usNotifyCode == EN_HOTKEY
1365 * -- mp2: PHOTKEYNOTIFY struct pointer
1366 *
1367 * The receiving owner must check if the key
1368 * combo described in HOTKEYNOTIFY makes up
1369 * a valid hotkey and return a ULONG composed
1370 * of the following flags:
1371 *
1372 * -- HEFL_SETTEXT: if this is set, the text
1373 * of the entry field is set to the
1374 * text in HOTKEYNOTIFY.szDescription.
1375 *
1376 * -- HEFL_FORWARD2OWNER: if this is set, the
1377 * WM_CHAR message is instead passed
1378 * to the owner. Use this for the tab
1379 * key and such.
1380 *
1381 *@@added V0.9.1 (99-12-19) [umoeller]
1382 *@@changed V0.9.4 (2000-08-03) [umoeller]: added HEFL_* flags
1383 */
1384
1385 #define EN_HOTKEY 0x1000
1386
1387 #define HEFL_SETTEXT 0x0001
1388 #define HEFL_FORWARD2OWNER 0x0002
1389
1390 typedef struct _HOTKEYNOTIFY
1391 {
1392 USHORT usFlags, // in: as in WM_CHAR
1393 usvk, // in: as in WM_CHAR
1394 usch; // in: as in WM_CHAR
1395 UCHAR ucScanCode; // in: as in WM_CHAR
1396 USHORT usKeyCode; // in: if KC_VIRTUAL is set, this has usKeyCode;
1397 // otherwise usCharCode
1398 CHAR szDescription[100]; // out: key description
1399 } HOTKEYNOTIFY, *PHOTKEYNOTIFY;
1400
1401 BOOL ctlMakeHotkeyEntryField(HWND hwndHotkeyEntryField);
1402
1403 /* ******************************************************************
1404 *
1405 * Color rectangle
1406 *
1407 ********************************************************************/
1408
1409 BOOL ctlMakeColorRect(HWND hwndStatic);
1410 typedef BOOL CTLMAKECOLORRECT(HWND hwndStatic);
1411 typedef CTLMAKECOLORRECT *PCTLMAKECOLORRECT;
1412
1413 /* ******************************************************************
1414 *
1415 * Container control replacement
1416 *
1417 ********************************************************************/
1418
1419 #define WC_CCTL_CNR "ComctlCnr"
1420
1421 typedef struct _CNRVIEWPORT
1422 {
1423 HWND hwndCnr;
1424 SIZEL szlWorkarea,
1425 szlWin;
1426 POINTL ptlScroll;
1427 } CNRVIEWPORT, *PCNRVIEWPORT;
1428
1429 #define CN_VIEWPORTCHANGED 159
1430
1431 MRESULT EXPENTRY fnwpCnr(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
1432
1433 BOOL ctlRegisterXCnr(HAB hab);
1434
1435
1436#endif
1437
1438#if __cplusplus
1439}
1440#endif
1441
Note: See TracBrowser for help on using the repository browser.