[7] | 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 Mller.
|
---|
[14] | 11 | * This file is part of the "XWorkplace helpers" source package.
|
---|
| 12 | * This is free software; you can redistribute it and/or modify
|
---|
[7] | 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>
|
---|
[113] | 29 | *@@include #include "helpers\comctl.h"
|
---|
[7] | 30 | */
|
---|
| 31 |
|
---|
| 32 | #if __cplusplus
|
---|
| 33 | extern "C" {
|
---|
| 34 | #endif
|
---|
| 35 |
|
---|
| 36 | #ifndef COMCTL_HEADER_INCLUDED
|
---|
| 37 | #define COMCTL_HEADER_INCLUDED
|
---|
| 38 |
|
---|
| 39 | /* ******************************************************************
|
---|
[14] | 40 | *
|
---|
[232] | 41 | * Shared stuff
|
---|
[209] | 42 | *
|
---|
| 43 | ********************************************************************/
|
---|
| 44 |
|
---|
[232] | 45 | MRESULT ctlSendWmControl(HWND hwndControl,
|
---|
| 46 | USHORT usCode,
|
---|
| 47 | MPARAM mp2);
|
---|
[209] | 48 |
|
---|
[232] | 49 | BOOL ctlPostWmControl(HWND hwndControl,
|
---|
| 50 | USHORT usCode,
|
---|
| 51 | MPARAM mp2);
|
---|
[209] | 52 |
|
---|
[232] | 53 | /*
|
---|
[243] | 54 | *@@ CCTLCOLOR:
|
---|
[209] | 55 | *
|
---|
[232] | 56 | *@@added V1.0.1 (2002-11-30) [umoeller]
|
---|
| 57 | */
|
---|
[81] | 58 |
|
---|
[243] | 59 | typedef struct _CCTLCOLOR
|
---|
[232] | 60 | {
|
---|
| 61 | BOOL fInheritPP;
|
---|
[243] | 62 | ULONG ulPP,
|
---|
| 63 | ulSysColor;
|
---|
| 64 | } CCTLCOLOR, *PCCTLCOLOR;
|
---|
[232] | 65 |
|
---|
[243] | 66 | #define CTLCOL_BGND 0
|
---|
| 67 | #define CTLCOL_FGND 1
|
---|
[232] | 68 |
|
---|
[243] | 69 | #define CCS_NOSENDCTLPTR 0x0001
|
---|
| 70 |
|
---|
[81] | 71 | /*
|
---|
[232] | 72 | *@@ DEFWINDOWDATA:
|
---|
[81] | 73 | *
|
---|
[232] | 74 | *@@added V1.0.1 (2002-11-30) [umoeller]
|
---|
[81] | 75 | */
|
---|
| 76 |
|
---|
[232] | 77 | typedef struct _DEFWINDATA
|
---|
[81] | 78 | {
|
---|
[232] | 79 | HWND hwnd;
|
---|
| 80 | HAB hab;
|
---|
[81] | 81 |
|
---|
[232] | 82 | PFNWP pDefWindowProc;
|
---|
[81] | 83 |
|
---|
[243] | 84 | ULONG flCtl; // CTL_* flags
|
---|
[81] | 85 |
|
---|
[232] | 86 | SIZEL szlWin; // current window dimensions
|
---|
[81] | 87 |
|
---|
[232] | 88 | PSZ pszText; // window text or NULL
|
---|
[81] | 89 |
|
---|
[243] | 90 | const CCTLCOLOR *paCtlColors;
|
---|
| 91 | ULONG cCtlColors;
|
---|
| 92 |
|
---|
| 93 | PLONG palColorValues;
|
---|
| 94 |
|
---|
[232] | 95 | } DEFWINDATA, *PDEFWINDATA;
|
---|
[81] | 96 |
|
---|
[232] | 97 | VOID ctlInitDWD(HWND hwnd,
|
---|
| 98 | MPARAM mp2,
|
---|
| 99 | PDEFWINDATA pdwd,
|
---|
| 100 | PFNWP pDefWindowProc,
|
---|
[243] | 101 | ULONG flCtl,
|
---|
| 102 | const CCTLCOLOR *paCtlColors,
|
---|
| 103 | ULONG cCtlColors);
|
---|
[81] | 104 |
|
---|
[232] | 105 | VOID ctlRefreshColors(PDEFWINDATA pdwd);
|
---|
[81] | 106 |
|
---|
[243] | 107 | LONG ctlQueryColor(PDEFWINDATA pdwd, ULONG ulIndex);
|
---|
| 108 |
|
---|
[232] | 109 | MRESULT ctlDefWindowProc(PDEFWINDATA pdwd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
| 110 |
|
---|
[81] | 111 | /* ******************************************************************
|
---|
| 112 | *
|
---|
[232] | 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 | *
|
---|
[14] | 126 | * "Menu button" control
|
---|
| 127 | *
|
---|
[7] | 128 | ********************************************************************/
|
---|
| 129 |
|
---|
[14] | 130 | VOID ctlDisplayButtonMenu(HWND hwndButton,
|
---|
| 131 | HWND hwndMenu);
|
---|
[7] | 132 |
|
---|
[14] | 133 | BOOL ctlMakeMenuButton(HWND hwndButton,
|
---|
| 134 | HMODULE hmodMenu,
|
---|
| 135 | ULONG idMenu);
|
---|
| 136 |
|
---|
[7] | 137 | /* ******************************************************************
|
---|
[14] | 138 | *
|
---|
| 139 | * Progress bars
|
---|
| 140 | *
|
---|
[7] | 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 | /* ******************************************************************
|
---|
[14] | 172 | *
|
---|
| 173 | * Chart Control
|
---|
| 174 | *
|
---|
[7] | 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,
|
---|
[68] | 189 | // for "pie chart" mode, angle to start with (0%).
|
---|
[7] | 190 | // This must be in the range of 0 to 360 degrees,
|
---|
| 191 | // with 0 degrees being the rightmost point
|
---|
| 192 | // of the arc.
|
---|
[68] | 193 |
|
---|
[7] | 194 | // All degree values are counter-clockwise from that point.
|
---|
| 195 | // Example: 90 will start the arc at the top.
|
---|
[68] | 196 |
|
---|
| 197 | // 90ø
|
---|
| 198 | // +++++++
|
---|
| 199 | // + +
|
---|
| 200 | // + +
|
---|
| 201 | // + +
|
---|
| 202 | // + +
|
---|
| 203 | // + +
|
---|
| 204 | // 180ø + X + 0ø
|
---|
| 205 | // + +
|
---|
| 206 | // + +
|
---|
| 207 | // + +
|
---|
| 208 | // + +
|
---|
| 209 | // + +
|
---|
| 210 | // +++++++
|
---|
| 211 | // 270ø
|
---|
| 212 |
|
---|
[7] | 213 | usSweepAngle;
|
---|
[68] | 214 | // the maximum angle to use for 100%, in addition to
|
---|
| 215 | // usStartAngle.
|
---|
[7] | 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.
|
---|
[68] | 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 |
|
---|
[7] | 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%
|
---|
[68] | 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.
|
---|
[7] | 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
|
---|
[68] | 255 | // to an item in padValues and specifies the color
|
---|
| 256 | // to paint the corresponding data item with.
|
---|
[7] | 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 |
|
---|
[68] | 267 | // chart display mode:
|
---|
[7] | 268 | #define CHS_PIECHART 0x0000
|
---|
[68] | 269 | #define CHS_BARCHART 0x0001
|
---|
[7] | 270 |
|
---|
| 271 | // chart display flags (CHARTSTYLE.ulStyle):
|
---|
[68] | 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;
|
---|
[7] | 275 | // CHARTSTYLE.ulThickness defines thickness
|
---|
[68] | 276 | #define CHS_3D_DARKEN 0x0600 // (pie chart only)
|
---|
| 277 | // draw 3D block too, but darker
|
---|
[7] | 278 | // compared to surface;
|
---|
| 279 | // CHARTSTYLE.ulThickness defines thickness
|
---|
| 280 |
|
---|
[68] | 281 | #define CHS_DRAWLINES 0x0800 // draw lines between pie slices
|
---|
| 282 | // added V0.9.12 (2001-05-03) [umoeller]
|
---|
| 283 |
|
---|
[7] | 284 | #define CHS_DESCRIPTIONS 0x1000 // show descriptions
|
---|
| 285 | #define CHS_DESCRIPTIONS_3D 0x3000 // same as CHS_DESCRIPTIONS, but shaded
|
---|
| 286 |
|
---|
[68] | 287 | #define CHS_SELECTIONS 0x4000 // allow data items to be selected using
|
---|
| 288 | // mouse and keyboard; this also enables
|
---|
| 289 | // WM_CONTROL notifications
|
---|
[7] | 290 |
|
---|
| 291 | /*
|
---|
| 292 | *@@ CHARTSTYLE:
|
---|
| 293 | *
|
---|
| 294 | */
|
---|
| 295 |
|
---|
| 296 | typedef struct _CHARTSTYLE
|
---|
| 297 | {
|
---|
| 298 | ULONG ulStyle; // CHS_* flags
|
---|
[68] | 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
|
---|
[7] | 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.
|
---|
[68] | 310 |
|
---|
| 311 | double dDescriptions; // (pie chart only)
|
---|
| 312 | // position of the slice descriptions on the pie
|
---|
[7] | 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 |
|
---|
[68] | 342 | #define CHTM_SETCHARTDATA (WM_USER + 2)
|
---|
[7] | 343 |
|
---|
[68] | 344 | #define CHTM_SETCHARTSTYLE (WM_USER + 3)
|
---|
[7] | 345 |
|
---|
[68] | 346 | #define CHTM_ITEMFROMPOINT (WM_USER + 4)
|
---|
[7] | 347 |
|
---|
[68] | 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.
|
---|
[265] | 419 | * If the double click occurred on a chart
|
---|
[68] | 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 | /*
|
---|
[189] | 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 | /*
|
---|
[68] | 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
|
---|
[265] | 486 | // data item for which the request occurred, or -1 for
|
---|
[68] | 487 | // a request on the control's whitespace.
|
---|
| 488 | POINTL ptl;
|
---|
| 489 | // exact window coordinates where mouse
|
---|
[265] | 490 | // click occurred (e.g. for context menu).
|
---|
[68] | 491 | // This is undefined (-1) if the event was not
|
---|
| 492 | // caused by a mouse click.
|
---|
| 493 | } EMPHASISNOTIFY, *PEMPHASISNOTIFY;
|
---|
| 494 |
|
---|
[7] | 495 | /* ******************************************************************
|
---|
[14] | 496 | *
|
---|
[127] | 497 | * Super Combo Box
|
---|
| 498 | *
|
---|
| 499 | ********************************************************************/
|
---|
| 500 |
|
---|
| 501 | BOOL ctlComboFromEntryField(HWND hwnd,
|
---|
| 502 | ULONG flStyle);
|
---|
| 503 |
|
---|
| 504 | /* ******************************************************************
|
---|
| 505 | *
|
---|
[14] | 506 | * Split bars
|
---|
| 507 | *
|
---|
[7] | 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
|
---|
[214] | 517 | #define SBCF_3DEXPLORERSTYLE 0x0200
|
---|
[229] | 518 | // new with V1.0.0 (2002-08-21) [umoeller]
|
---|
[214] | 519 | // this simulates the Warp 4 entry field margins around the
|
---|
| 520 | // right split window, but leaves the left window flat
|
---|
[7] | 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
|
---|
[214] | 592 | LONG lcol3DDark,
|
---|
| 593 | lcol3DLight,
|
---|
| 594 | lcolInactiveBorder;
|
---|
[7] | 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 | /* ******************************************************************
|
---|
[14] | 633 | *
|
---|
| 634 | * Subclassed Static Bitmap Control
|
---|
| 635 | *
|
---|
[7] | 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
|
---|
[178] | 649 | *@@changed V0.9.16 (2001-10-15) [umoeller]: added lIconSize
|
---|
| 650 | *@@changed V0.9.19 (2002-06-18) [umoeller]: added szlIcon
|
---|
[7] | 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
|
---|
[178] | 663 | SIZEL szlIcon; // system icon size V0.9.19 (2002-06-18) [umoeller]
|
---|
[7] | 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 | /* ******************************************************************
|
---|
[14] | 702 | *
|
---|
| 703 | * "Tooltip" control
|
---|
| 704 | *
|
---|
[7] | 705 | ********************************************************************/
|
---|
| 706 |
|
---|
[232] | 707 | #define WC_CCTL_TOOLTIP "ComctlTooltipClass"
|
---|
| 708 | // define identifier changed V1.0.1 (2002-11-30) [umoeller]
|
---|
| 709 |
|
---|
[7] | 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)
|
---|
[19] | 718 | // #define TTF_IDISHWND 0x0001
|
---|
[21] | 719 | // V0.9.7 (2001-01-03) [umoeller]: removed this win95 crap
|
---|
[29] | 720 | // #define TTF_CENTERBELOW 0x0002
|
---|
| 721 | // #define TTF_CENTERABOVE 0x0004
|
---|
[19] | 722 | // #define TTF_RTLREADING 0x0004
|
---|
[21] | 723 | // V0.9.7 (2001-01-03) [umoeller]: removed this win95 crap
|
---|
[29] | 724 |
|
---|
[7] | 725 | #define TTF_SUBCLASS 0x0008
|
---|
| 726 | // non-Win95 flags
|
---|
| 727 | #define TTF_SHYMOUSE 0x0010
|
---|
| 728 |
|
---|
[29] | 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 |
|
---|
[19] | 734 | #define PSZ_TEXTCALLBACK (PSZ)-1
|
---|
[7] | 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.
|
---|
[19] | 744 | *
|
---|
[21] | 745 | *@@changed V0.9.7 (2001-01-03) [umoeller]: removed all that win95 crap
|
---|
[7] | 746 | */
|
---|
| 747 |
|
---|
| 748 | typedef struct _TOOLINFO
|
---|
| 749 | {
|
---|
[19] | 750 | ULONG ulFlags;
|
---|
[7] | 751 | // in: flags for the tool, any combination of:
|
---|
| 752 | // -- TTF_SUBCLASS: Indicates that the tooltip control should
|
---|
[19] | 753 | // subclass hwndTool to intercept messages,
|
---|
[7] | 754 | // such as WM_MOUSEMOVE. See TTM_RELAYEVENT.
|
---|
[29] | 755 | // -- TTF_SHYMOUSE: shy away from mouse pointer;
|
---|
[7] | 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]
|
---|
[29] | 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
|
---|
[19] | 765 | HWND hwndToolOwner;
|
---|
[7] | 766 | // in: handle to the window that contains the tool. If
|
---|
[65] | 767 | // pszText includes the PSZ_TEXTCALLBACK value, this
|
---|
[7] | 768 | // member identifies the window that receives TTN_NEEDTEXT
|
---|
| 769 | // notification messages.
|
---|
[19] | 770 | HWND hwndTool;
|
---|
| 771 | // in: window handle of the tool.
|
---|
| 772 | PSZ pszText;
|
---|
[7] | 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).
|
---|
[19] | 776 | // If this member is set to the PSZ_TEXTCALLBACK value,
|
---|
[7] | 777 | // the control sends the TTN_NEEDTEXT notification message to
|
---|
[19] | 778 | // hwndToolOwner to retrieve the text.
|
---|
[7] | 779 | } TOOLINFO, *PTOOLINFO;
|
---|
| 780 |
|
---|
[65] | 781 | /*
|
---|
| 782 | * tooltip messages
|
---|
| 783 | *
|
---|
| 784 | */
|
---|
| 785 |
|
---|
[7] | 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 |
|
---|
[65] | 804 | #define TTM_GETDELAYTIME (TTM_FIRST + 6)
|
---|
| 805 | // added V0.9.12 (2001-04-28) [umoeller]
|
---|
[7] | 806 |
|
---|
[65] | 807 | #define TTM_SETDELAYTIME (TTM_FIRST + 7)
|
---|
| 808 |
|
---|
[19] | 809 | #define TTFMT_PSZ 0x01
|
---|
| 810 | #define TTFMT_STRINGRES 0x02
|
---|
[7] | 811 |
|
---|
| 812 | /*
|
---|
| 813 | *@@ TOOLTIPTEXT:
|
---|
[81] | 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.
|
---|
[7] | 818 | *
|
---|
[81] | 819 | * This structure is used with the TTN_NEEDTEXT
|
---|
| 820 | * notification.
|
---|
[19] | 821 | *
|
---|
[21] | 822 | *@@changed V0.9.7 (2001-01-03) [umoeller]: got rid of this win95 crap
|
---|
[7] | 823 | */
|
---|
| 824 |
|
---|
| 825 | typedef struct _TOOLTIPTEXT
|
---|
| 826 | {
|
---|
[19] | 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...
|
---|
[81] | 839 | // so this must point to a static buffer that is valid while
|
---|
| 840 | // the tooltip is showing.
|
---|
[19] | 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.
|
---|
[7] | 845 | } TOOLTIPTEXT, *PTOOLTIPTEXT;
|
---|
| 846 |
|
---|
[65] | 847 | #define TTM_GETTEXT (TTM_FIRST + 8)
|
---|
[7] | 848 |
|
---|
[65] | 849 | #define TTM_UPDATETIPTEXT (TTM_FIRST + 9)
|
---|
[7] | 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 |
|
---|
[65] | 868 | #define TTM_HITTEST (TTM_FIRST + 10)
|
---|
[7] | 869 |
|
---|
[65] | 870 | #define TTM_WINDOWFROMPOINT (TTM_FIRST + 11)
|
---|
[7] | 871 |
|
---|
[65] | 872 | #define TTM_ENUMTOOLS (TTM_FIRST + 12)
|
---|
[7] | 873 |
|
---|
[65] | 874 | #define TTM_GETCURRENTTOOL (TTM_FIRST + 13)
|
---|
[7] | 875 |
|
---|
[65] | 876 | #define TTM_GETTOOLCOUNT (TTM_FIRST + 14)
|
---|
[7] | 877 |
|
---|
[65] | 878 | #define TTM_GETTOOLINFO (TTM_FIRST + 15)
|
---|
[7] | 879 |
|
---|
[65] | 880 | #define TTM_SETTOOLINFO (TTM_FIRST + 16)
|
---|
[7] | 881 |
|
---|
| 882 | // non-Win95 messages
|
---|
| 883 |
|
---|
[65] | 884 | #define TTM_SHOWTOOLTIPNOW (TTM_FIRST + 17)
|
---|
[7] | 885 |
|
---|
| 886 | /*
|
---|
[65] | 887 | * tooltip notification codes (WM_CONTROL)
|
---|
| 888 | *
|
---|
| 889 | */
|
---|
| 890 |
|
---|
| 891 | /*
|
---|
[7] | 892 | *@@ TTN_NEEDTEXT:
|
---|
[20] | 893 | * notification code used with WM_CONTROL when a tooltip
|
---|
| 894 | * needs a tooltip text for a tool.
|
---|
[7] | 895 | *
|
---|
[20] | 896 | * Parameters:
|
---|
| 897 | *
|
---|
| 898 | * -- SHORT1FROMMP(mp1) usID: ID of the tooltip control).
|
---|
| 899 | *
|
---|
| 900 | * -- SHORT2FROMMP(mp1) usNotifyCode: TTN_NEEDTEXT.
|
---|
| 901 | *
|
---|
[7] | 902 | * -- PTOOLTIPTEXT mp2: pointer to a TOOLTIPTEXT structure.
|
---|
[20] | 903 | * hwndTool identifies the tool for which text is needed.
|
---|
[7] | 904 | *
|
---|
| 905 | * This notification message is sent to the window specified
|
---|
[20] | 906 | * in the hwndToolOwner member of the TOOLINFO structure for the tool.
|
---|
| 907 | * This notification is sent only if the PSZ_TEXTCALLBACK
|
---|
[7] | 908 | * value is specified when the tool is added to a tooltip control.
|
---|
| 909 | *
|
---|
[20] | 910 | * To specify the text, the target window (hwndToolOwner) must:
|
---|
[7] | 911 | *
|
---|
[20] | 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.
|
---|
[7] | 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
|
---|
[81] | 937 | * -- ULONG mp2: PTOOLINFO of the tool for which the
|
---|
| 938 | * tool is about to be displayed.
|
---|
[7] | 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
|
---|
[81] | 956 | * -- ULONG mp2: PTOOLINFO of the tool for which the
|
---|
| 957 | * tooltip was visible.
|
---|
[7] | 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 | /* ******************************************************************
|
---|
[14] | 972 | *
|
---|
[232] | 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
|
---|
[233] | 995 | #define TBBS_DROPMNEMONIC 0x4000
|
---|
[232] | 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,
|
---|
[242] | 1206 | const XFRAMECONTROLS *pxfc,
|
---|
[232] | 1207 | MPARAM mp1,
|
---|
| 1208 | MPARAM mp2);
|
---|
| 1209 |
|
---|
[242] | 1210 | MRESULT ctlCalcExtFrameRect(HWND hwndFrame,
|
---|
| 1211 | const XFRAMECONTROLS *pxfc,
|
---|
| 1212 | MPARAM mp1,
|
---|
| 1213 | MPARAM mp2);
|
---|
[232] | 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 | *
|
---|
[14] | 1226 | * Checkbox container record cores
|
---|
| 1227 | *
|
---|
[7] | 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.
|
---|
[52] | 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
|
---|
[7] | 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.
|
---|
[52] | 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
|
---|
[7] | 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 |
|
---|
[145] | 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 |
|
---|
[159] | 1323 | ULONG ctlQueryCheckboxSize(VOID);
|
---|
| 1324 |
|
---|
[145] | 1325 | VOID ctlInitCheckboxContainer(HWND hwndCnr);
|
---|
| 1326 |
|
---|
[7] | 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 | /* ******************************************************************
|
---|
[14] | 1347 | *
|
---|
| 1348 | * Hotkey entry field
|
---|
| 1349 | *
|
---|
[7] | 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 |
|
---|
[168] | 1403 | /* ******************************************************************
|
---|
| 1404 | *
|
---|
| 1405 | * Color rectangle
|
---|
| 1406 | *
|
---|
| 1407 | ********************************************************************/
|
---|
| 1408 |
|
---|
| 1409 | BOOL ctlMakeColorRect(HWND hwndStatic);
|
---|
| 1410 | typedef BOOL CTLMAKECOLORRECT(HWND hwndStatic);
|
---|
| 1411 | typedef CTLMAKECOLORRECT *PCTLMAKECOLORRECT;
|
---|
| 1412 |
|
---|
[242] | 1413 | /* ******************************************************************
|
---|
| 1414 | *
|
---|
| 1415 | * Container control replacement
|
---|
| 1416 | *
|
---|
| 1417 | ********************************************************************/
|
---|
| 1418 |
|
---|
| 1419 | #define WC_CCTL_CNR "ComctlCnr"
|
---|
| 1420 |
|
---|
[243] | 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 |
|
---|
[242] | 1431 | MRESULT EXPENTRY fnwpCnr(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
| 1432 |
|
---|
| 1433 | BOOL ctlRegisterXCnr(HAB hab);
|
---|
| 1434 |
|
---|
| 1435 |
|
---|
[7] | 1436 | #endif
|
---|
| 1437 |
|
---|
| 1438 | #if __cplusplus
|
---|
| 1439 | }
|
---|
| 1440 | #endif
|
---|
| 1441 |
|
---|