mCtrl  0.11.3
grid.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2016 Martin Mitas
3  *
4  * This library is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; either version 2.1 of the License, or
7  * (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef MCTRL_GRID_H
20 #define MCTRL_GRID_H
21 
22 #include <mCtrl/_defs.h>
23 #include <mCtrl/_common.h>
24 #include <mCtrl/table.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 
231 
236 BOOL MCTRL_API mcGrid_Initialize(void);
237 
241 void MCTRL_API mcGrid_Terminate(void);
242 
250 
252 #define MC_WC_GRIDW L"mCtrl.grid"
253 
254 #define MC_WC_GRIDA "mCtrl.grid"
255 
264 #define MC_GS_NOTABLECREATE 0x0001
265 
267 #define MC_GS_NOGRIDLINES 0x0002
268 
270 #define MC_GS_DOUBLEBUFFER 0x0004
271 
274 #define MC_GS_OWNERDATA 0x0008
275 
277 #define MC_GS_RESIZABLECOLUMNS 0x0010
278 
279 #define MC_GS_RESIZABLEROWS 0x0020
280 
282 #define MC_GS_FOCUSEDCELL 0x0040
283 
285 #define MC_GS_EDITLABELS 0x0080
286 
288 #define MC_GS_NOSEL 0x0000
289 
290 #define MC_GS_SINGLESEL 0x0100
291 
292 #define MC_GS_RECTSEL 0x0200
293 
294 #define MC_GS_COMPLEXSEL 0x0300
295 
297 #define MC_GS_SHOWSELALWAYS 0x0400
298 
300 #define MC_GS_COLUMNHEADERNORMAL 0x0000
301 
302 #define MC_GS_COLUMNHEADERNUMBERED 0x1000
303 
304 #define MC_GS_COLUMNHEADERALPHABETIC 0x2000
305 
306 #define MC_GS_COLUMNHEADERNONE 0x3000
307 
308 #define MC_GS_COLUMNHEADERMASK (MC_GS_COLUMNHEADERNORMAL | \
309  MC_GS_COLUMNHEADERNUMBERED | \
310  MC_GS_COLUMNHEADERALPHABETIC | \
311  MC_GS_COLUMNHEADERNONE)
312 
314 #define MC_GS_ROWHEADERNORMAL 0x0000
315 
316 #define MC_GS_ROWHEADERNUMBERED 0x4000
317 
318 #define MC_GS_ROWHEADERALPHABETIC 0x8000
319 
320 #define MC_GS_ROWHEADERNONE 0xC000
321 
322 #define MC_GS_ROWHEADERMASK (MC_GS_ROWHEADERNORMAL | \
323  MC_GS_ROWHEADERNUMBERED | \
324  MC_GS_ROWHEADERALPHABETIC | \
325  MC_GS_ROWHEADERNONE)
326 
335 
337 #define MC_GGF_COLUMNHEADERHEIGHT (1 << 0)
338 
339 #define MC_GGF_ROWHEADERWIDTH (1 << 1)
340 
341 #define MC_GGF_DEFCOLUMNWIDTH (1 << 2)
342 
343 #define MC_GGF_DEFROWHEIGHT (1 << 3)
344 
345 #define MC_GGF_PADDINGHORZ (1 << 4)
346 
347 #define MC_GGF_PADDINGVERT (1 << 5)
348 
357 
359 #define MC_GHT_NOWHERE (1 << 0)
360 
361 #define MC_GHT_ONCOLUMNHEADER (1 << 1)
362 
363 #define MC_GHT_ONROWHEADER (1 << 2)
364 
365 #define MC_GHT_ONHEADER (MC_GHT_ONCOLUMNHEADER | MC_GHT_ONROWHEADER)
366 
367 #define MC_GHT_ONNORMALCELL (1 << 3)
368 
369 #define MC_GHT_ONCELL (MC_GHT_ONHEADER | MC_GHT_ONNORMALCELL)
370 
371 #define MC_GHT_ONCOLUMNDIVIDER (1 << 4)
372 
373 #define MC_GHT_ONROWDIVIDER (1 << 5)
374 
375 #define MC_GHT_ONCOLUMNDIVOPEN (1 << 6)
376 
377 #define MC_GHT_ONROWDIVOPEN (1 << 7)
378 
379 #define MC_GHT_ABOVE (1 << 8)
380 
381 #define MC_GHT_BELOW (1 << 9)
382 
383 #define MC_GHT_TORIGHT (1 << 10)
384 
385 #define MC_GHT_TOLEFT (1 << 11)
386 
394 
402 typedef struct MC_GRECT_tag {
406  WORD wRowFrom;
408  WORD wColumnTo;
410  WORD wRowTo;
411 } MC_GRECT;
412 
417 typedef struct MC_GGEOMETRY_tag {
419  DWORD fMask;
432 } MC_GGEOMETRY;
433 
437 typedef struct MC_GHITTESTINFO_tag {
439  POINT pt;
441  UINT flags;
443  WORD wColumn;
445  WORD wRow;
447 
477 typedef struct MC_GSELECTION_tag {
487 } MC_GSELECTION;
488 
492 typedef struct MC_NMGCACHEHINT_tag {
494  NMHDR hdr;
498  WORD wRowFrom;
500  WORD wColumnTo;
502  WORD wRowTo;
504 
508 typedef struct MC_NMGCUSTOMDRAW_tag {
515  COLORREF clrText;
517  COLORREF clrTextBk;
519 
524 typedef struct MC_NMGDISPINFOW_tag {
526  NMHDR hdr;
528  WORD wColumn;
530  WORD wRow;
534 
539 typedef struct MC_NMGDISPINFOA_tag {
541  NMHDR hdr;
543  WORD wColumn;
545  WORD wRow;
549 
557 typedef struct MC_NMGCOLROWSIZECHANGE_tag {
559  NMHDR hdr;
569 
575 typedef struct MC_NMGFOCUSEDCELLCHANGE_tag {
577  NMHDR hdr;
581  WORD wOldRow;
585  WORD wNewRow;
587 
593 typedef struct MC_NMGSELECTIONCHANGE_tag {
595  NMHDR hdr;
601 
609 
623 #define MC_GM_GETTABLE (MC_GM_FIRST + 0)
624 
638 #define MC_GM_SETTABLE (MC_GM_FIRST + 1)
639 
647 #define MC_GM_GETCOLUMNCOUNT (MC_GM_FIRST + 2)
648 
656 #define MC_GM_GETROWCOUNT (MC_GM_FIRST + 3)
657 
666 #define MC_GM_RESIZE (MC_GM_FIRST + 4)
667 
679 #define MC_GM_CLEAR (MC_GM_FIRST + 5)
680 
690 #define MC_GM_SETCELLW (MC_GM_FIRST + 6)
691 
701 #define MC_GM_SETCELLA (MC_GM_FIRST + 7)
702 
715 #define MC_GM_GETCELLW (MC_GM_FIRST + 8)
716 
729 #define MC_GM_GETCELLA (MC_GM_FIRST + 9)
730 
740 #define MC_GM_SETGEOMETRY (MC_GM_FIRST + 10)
741 
750 #define MC_GM_GETGEOMETRY (MC_GM_FIRST + 11)
751 
769 #define MC_GM_REDRAWCELLS (MC_GM_FIRST + 12)
770 
785 #define MC_GM_SETCOLUMNWIDTH (MC_GM_FIRST + 13)
786 
796 #define MC_GM_GETCOLUMNWIDTH (MC_GM_FIRST + 14)
797 
812 #define MC_GM_SETROWHEIGHT (MC_GM_FIRST + 15)
813 
823 #define MC_GM_GETROWHEIGHT (MC_GM_FIRST + 16)
824 
835 #define MC_GM_HITTEST (MC_GM_FIRST + 17)
836 
844 #define MC_GM_GETCELLRECT (MC_GM_FIRST + 18)
845 
856 #define MC_GM_ENSUREVISIBLE (MC_GM_FIRST + 19)
857 
865 #define MC_GM_SETFOCUSEDCELL (MC_GM_FIRST + 20)
866 
873 #define MC_GM_GETFOCUSEDCELL (MC_GM_FIRST + 21)
874 
882 #define MC_GM_SETSELECTION (MC_GM_FIRST + 22)
883 
914 #define MC_GM_GETSELECTION (MC_GM_FIRST + 23)
915 
922 #define MC_GM_GETEDITCONTROL (MC_GM_FIRST + 24)
923 
932 #define MC_GM_EDITLABEL (MC_GM_FIRST + 25)
933 
942 #define MC_GM_CANCELEDITLABEL (MC_GM_FIRST + 26)
943 
951 
987 #define MC_GN_ODCACHEHINT (MC_GN_FIRST + 0)
988 
1006 #define MC_GN_SETDISPINFOW (MC_GN_FIRST + 1)
1007 
1025 #define MC_GN_SETDISPINFOA (MC_GN_FIRST + 2)
1026 
1048 #define MC_GN_GETDISPINFOW (MC_GN_FIRST + 3)
1049 
1071 #define MC_GN_GETDISPINFOA (MC_GN_FIRST + 4)
1072 
1082 #define MC_GN_BEGINCOLUMNTRACK (MC_GN_FIRST + 5)
1083 
1093 #define MC_GN_ENDCOLUMNTRACK (MC_GN_FIRST + 6)
1094 
1104 #define MC_GN_BEGINROWTRACK (MC_GN_FIRST + 7)
1105 
1115 #define MC_GN_ENDROWTRACK (MC_GN_FIRST + 8)
1116 
1125 #define MC_GN_COLUMNWIDTHCHANGING (MC_GN_FIRST + 9)
1126 
1135 #define MC_GN_COLUMNWIDTHCHANGED (MC_GN_FIRST + 10)
1136 
1145 #define MC_GN_ROWHEIGHTCHANGING (MC_GN_FIRST + 11)
1146 
1155 #define MC_GN_ROWHEIGHTCHANGED (MC_GN_FIRST + 12)
1156 
1165 #define MC_GN_FOCUSEDCELLCHANGING (MC_GN_FIRST + 13)
1166 
1175 #define MC_GN_FOCUSEDCELLCHANGED (MC_GN_FIRST + 14)
1176 
1185 #define MC_GN_SELECTIONCHANGING (MC_GN_FIRST + 15)
1186 
1195 #define MC_GN_SELECTIONCHANGED (MC_GN_FIRST + 16)
1196 
1213 #define MC_GN_BEGINLABELEDITW (MC_GN_FIRST + 17)
1214 
1231 #define MC_GN_BEGINLABELEDITA (MC_GN_FIRST + 18)
1232 
1250 #define MC_GN_ENDLABELEDITW (MC_GN_FIRST + 19)
1251 
1269 #define MC_GN_ENDLABELEDITA (MC_GN_FIRST + 20)
1270 
1271 
1279 
1281 #define MC_WC_GRID MCTRL_NAME_AW(MC_WC_GRID)
1282 
1283 #define MC_NMGDISPINFO MCTRL_NAME_AW(MC_NMGDISPINFO)
1284 
1285 #define MC_GM_SETCELL MCTRL_NAME_AW(MC_GM_SETCELL)
1286 
1287 #define MC_GM_GETCELL MCTRL_NAME_AW(MC_GM_GETCELL)
1288 
1289 #define MC_GN_SETDISPINFO MCTRL_NAME_AW(MC_GN_SETDISPINFO)
1290 
1291 #define MC_GN_GETDISPINFO MCTRL_NAME_AW(MC_GN_GETDISPINFO)
1292 
1293 #define MC_GN_BEGINLABELEDIT MCTRL_NAME_AW(MC_GN_BEGINLABELEDIT)
1294 
1295 #define MC_GN_ENDLABELEDIT MCTRL_NAME_AW(MC_GN_ENDLABELEDIT)
1296 
1300 #ifdef __cplusplus
1301 } /* extern "C" */
1302 #endif
1303 
1304 #endif /* MCTRL_GRID_H */
MC_GSELECTION oldSelection
Definition: grid.h:597
Structure describing inner geometry of the grid.
Definition: grid.h:417
#define MCTRL_API
Definition: _defs.h:46
WORD wNewRow
Definition: grid.h:585
NMHDR hdr
Definition: grid.h:559
POINT pt
Definition: grid.h:439
A miscellaneous structure determining a rectangular area in the grid.
Definition: grid.h:402
WORD wColumnTo
Definition: grid.h:500
DWORD fMask
Definition: grid.h:419
COLORREF clrTextBk
Definition: grid.h:517
NMHDR hdr
Definition: grid.h:541
WORD wColumn
Definition: grid.h:443
WORD wRowFrom
Definition: grid.h:498
Structure used by notifications related to focused cell.
Definition: grid.h:575
Structure used by notifications related to selection change.
Definition: grid.h:593
MC_GRECT rcExtents
Definition: grid.h:479
WORD wRowHeaderWidth
Definition: grid.h:423
WORD wRow
Definition: grid.h:445
UINT uDataCount
Definition: grid.h:483
NMHDR hdr
Definition: grid.h:595
WORD wColumn
Definition: grid.h:528
MC_GSELECTION newSelection
Definition: grid.h:599
Structure used by notifications MC_GN_GETDISPINFO and MC_GN_SETDISPINFO (ANSI variant).
Definition: grid.h:539
Structure used by notifications MC_GN_GETDISPINFO and MC_GN_SETDISPINFO (Unicode variant).
Definition: grid.h:524
COLORREF clrText
Definition: grid.h:515
WORD wColumn
Definition: grid.h:543
WORD wColumnTo
Definition: grid.h:408
WORD wDefRowHeight
Definition: grid.h:427
WORD wNewColumn
Definition: grid.h:583
WORD wOldColumn
Definition: grid.h:579
UINT flags
Definition: grid.h:441
WORD wWidthOrHeight
Definition: grid.h:567
WORD wPaddingHorz
Definition: grid.h:429
WORD wColumnFrom
Definition: grid.h:404
WORD wOldRow
Definition: grid.h:581
WORD wPaddingVert
Definition: grid.h:431
Equivalent of NMCUSTOMDRAWINFO from <commctrl.h>.
Definition: _common.h:108
WORD wRow
Definition: grid.h:545
Structure describing a selection.
Definition: grid.h:477
Structure used by notification MC_GN_ODCACHEHINT.
Definition: grid.h:492
WORD wRowFrom
Definition: grid.h:406
NMHDR hdr
Definition: grid.h:526
Structure used by the standard notification NM_CUSTOMDRAW.
Definition: grid.h:508
Structure for message MC_GM_HITTEST.
Definition: grid.h:437
Structure describing a table cell (ANSI variant).
Definition: table.h:153
NMHDR hdr
Definition: grid.h:577
WORD wRowTo
Definition: grid.h:410
Structure describing a table cell (Unicode variant).
Definition: table.h:131
MC_NMCUSTOMDRAW nmcd
Definition: grid.h:513
MC_TABLECELLA cell
Definition: grid.h:547
WORD wRow
Definition: grid.h:530
BOOL mcGrid_Initialize(void)
MC_GRECT * rcData
Definition: grid.h:486
Table (data model for grid control)
WORD wColumnHeaderHeight
Definition: grid.h:421
WORD wDefColumnWidth
Definition: grid.h:425
MC_TABLECELLW cell
Definition: grid.h:532
Structure used by notifications related to resizing of column and headers.
Definition: grid.h:557
WORD wColumnFrom
Definition: grid.h:496
NMHDR hdr
Definition: grid.h:494
Common definitions.
void mcGrid_Terminate(void)
Common constants and types.
WORD wColumnOrRow
Definition: grid.h:563
WORD wRowTo
Definition: grid.h:502