mCtrl
0.11.1
|
Go to the source code of this file.
Grid control (MC_WC_GRID
).
The grid control provides user interface for presentation of a lot of data in, as the name of the control suggests, a grid.
By default, the control uses MC_HTABLE data model to manage the data displayed by the control. Then, actually, all messages manipulating with data hold by the control just call corresponding function manipulating with the underlying MC_HTABLE.
By default, the control creates an empty table during its creation, of size 0 x 0. So, usually, one of the first messages sent to the control by any application is MC_GM_RESIZE.
Alternatively, you can use the style MC_GS_NOTABLECREATE. In that case the control does not create any table during its creation, and you must associate an existing table with the control with the message MC_GM_SETTABLE. Until you do so, all messages attempting to modify the underlying table will just fail.
MC_GM_SETTABLE together with MC_GM_GETTABLE allows attaching one table to multiple controls.
Messages which do not manipulate with the table determine how the table is presented and these are tied to the control. I.e. if any table is attached to multiple control, each of the controls can present the table in other way (e.g. have another dimensions for each cell etc.).
The grid can defer management of the data to the parent window instead of using the MC_HTABLE. To do this, application has to apply the style MC_GS_OWNERDATA.
The control then uninstalls any table currently associated with it (if any), and whenever painting a cell, it asks its parent for the data it needs. The control uses the notification MC_GN_GETDISPINFO to retrieve the data.
The virtual grid is especially useful to present data calculated on the fly or retrieved from some large database, so that only the required amount of the data is calculated and retrieved, which can result in saving a lot of memory and CPU cycles.
The control actually only remembers dimensions of the virtual table as set by MC_GM_RESIZE.
If the retrieval of the data is expensive operation, the application may want to implement some caching scheme. For this purpose the control sends the notification MC_GN_ODCACHEHINT, which informs the application about the region of cells it may ask most frequently. Note however the control is free to ask for any cell, not just the one included in the range as specified by the latest MC_GN_ODCACHEHINT.
Also note that (if the control has the styles MC_GS_COLUMNHEADERNORMAL and/or MC_GS_ROWHEADERNORMAL) the grid may ask for the header cells, although the headers are never explicitly included in MC_GN_ODCACHEHINT.
To force repainting of one or more items, when the underlying data change, the application is supposed to use the message MC_GM_REDRAWCELLS.
Please remember that when the style MC_GS_OWNERDATA is used, some control messages and styles behave differently:
FALSE
).The application can manipulate also with headers of columns and rows. For many purposes, the control treats them as any ordinary cells, but of course there are also differences.
The header cells have to be addressed by special index MC_TABLE_HEADER. Column header uses index of the column of interest and row index MC_TABLE_HEADER and, similarly, row header uses column header MC_TABLE_HEADER and the row index.
For example, to get or set contents of header cells, the application can use exactly the same messages as for ordinary cells, i.e. messages MC_GM_GETCELL and MC_GM_SETCELL respectively, where one of the indexes is set to MC_TABLE_HEADER.
The grid control supports four distinct selection modes. These modes determine how the cells may or may not be selected:
MC_GS_NOSEL
, selection is disabled altogether and no cell can be selected. This is default.MC_GS_SINGLESEL
, only single cell may be selected at any time.MC_GS_RECTSEL
, only a set of cells which form a block of rectangular shape may be selected.MC_GS_COMPLEXSEL
, any set of cells, even discontinuous one, may be selected.The mode influences how the control reacts on mouse and keyboard events with respect to the selection, and also how the control processes various selection related messages and notifications.
Note that the selection may also be changed with keyboard only if the style ref
MC_GS_FOCUSEDCELL is also used.
With the style MC_GS_FOCUSEDCELL, the control supports a cell focus. Then, exactly one cell has a status of the focused cell.
Certain aspects of control behavior change when the style is enabled:
MC_GS_FOCUSEDCELL
enables changing the current selection with keyboard.Application can set and get currently focused cell with messages MC_GM_SETFOCUSEDCELL and MC_GM_GETFOCUSEDCELL, and be notified about its change of focused cell via the notification MC_GN_FOCUSEDCELLCHANGING and MC_GN_FOCUSEDCELLCHANGED.
When the style MC_GS_EDITLABELS is enabled, user can edit cell labels. The editing is started when user clicks on the focused cell, when user presses ENTER
, or when the application explicitly sends the message MC_GM_EDITLABEL.
When the label editing starts, application gets the notification MC_GN_BEGINLABELEDIT which allows it to suppress the editing mode, or to customize the embedded edit window. The code handling the notification may use the message MC_GM_GETEDITCONTROL to retrieve handle of the edit control.
Likewise, when the edit mode ends, the application gets the notification MC_GN_ENDLABELEDIT, which allows the application to accept or reject the new text for the label.
If it is accepted by returning non-zero from the notification, the control saves the new text label within the table or it tells the parent to remember it via MC_GN_SETDISPINFO if the parent maintains the table or cell contents (this happens when the control uses the style MC_GS_OWNERDATA
or when the cell uses the magic value MC_LPSTR_TEXTCALLBACK).
These standard messages are handled by MC_WC_GRID
control:
WM_GETFONT
WM_SETFONT
WM_SETREDRAW
CCM_GETUNICODEFORMAT
CCM_SETNOTIFYWINDOW
CCM_SETUNICODEFORMAT
CCM_SETWINDOWTHEME
These standard notifications are sent by the control:
NM_CLICK
NM_CUSTOMDRAW
(see MC_NMGCUSTOMDRAW)NM_DBLCLK
NM_KILLFOCUS
NM_OUTOFMEMORY
NM_RCLICK
NM_RDBLCLK
NM_RELEASEDCAPTURE
NM_SETFOCUS
WM_CONTEXTMENU
Data Structures | |
struct | MC_GRECT |
A miscellaneous structure determining a rectangular area in the grid. More... | |
struct | MC_GGEOMETRY |
Structure describing inner geometry of the grid. More... | |
struct | MC_GHITTESTINFO |
Structure for message MC_GM_HITTEST. More... | |
struct | MC_GSELECTION |
Structure describing a selection. More... | |
struct | MC_NMGCACHEHINT |
Structure used by notification MC_GN_ODCACHEHINT. More... | |
struct | MC_NMGCUSTOMDRAW |
Structure used by the standard notification NM_CUSTOMDRAW . More... | |
struct | MC_NMGDISPINFOW |
Structure used by notifications MC_GN_GETDISPINFO and MC_GN_SETDISPINFO (Unicode variant). More... | |
struct | MC_NMGDISPINFOA |
Structure used by notifications MC_GN_GETDISPINFO and MC_GN_SETDISPINFO (ANSI variant). More... | |
struct | MC_NMGCOLROWSIZECHANGE |
Structure used by notifications related to resizing of column and headers. More... | |
struct | MC_NMGFOCUSEDCELLCHANGE |
Structure used by notifications related to focused cell. More... | |
struct | MC_NMGSELECTIONCHANGE |
Structure used by notifications related to selection change. More... | |
Initialization Functions | |
BOOL | mcGrid_Initialize (void) |
void | mcGrid_Terminate (void) |
Window Class | |
#define | MC_WC_GRIDW L"mCtrl.grid" |
#define | MC_WC_GRIDA "mCtrl.grid" |
Control Styles | |
#define | MC_GS_NOTABLECREATE 0x0001 |
Do not automatically create empty table. More... | |
#define | MC_GS_NOGRIDLINES 0x0002 |
Do not paint grid lines. More... | |
#define | MC_GS_DOUBLEBUFFER 0x0004 |
Use double buffering. More... | |
#define | MC_GS_OWNERDATA 0x0008 |
Enable the virtual grid mode. More... | |
#define | MC_GS_RESIZABLECOLUMNS 0x0010 |
Enable changing column width by dragging header divider. More... | |
#define | MC_GS_RESIZABLEROWS 0x0020 |
Enable changing row height by dragging row header divider. More... | |
#define | MC_GS_FOCUSEDCELL 0x0040 |
Enables cell focus. More... | |
#define | MC_GS_EDITLABELS 0x0080 |
Enables label editing support. More... | |
#define | MC_GS_NOSEL 0x0000 |
Control does not allow cell selection. More... | |
#define | MC_GS_SINGLESEL 0x0100 |
Control allows to select only one cell. More... | |
#define | MC_GS_RECTSEL 0x0200 |
Control allows to select only a rectangular area of cells. More... | |
#define | MC_GS_COMPLEXSEL 0x0300 |
Control allows to select any arbitrary set of cells. More... | |
#define | MC_GS_SHOWSELALWAYS 0x0400 |
Paint selection even when the control does not have focus. More... | |
#define | MC_GS_COLUMNHEADERNORMAL 0x0000 |
The contents of column headers is used. This is default. More... | |
#define | MC_GS_COLUMNHEADERNUMBERED 0x1000 |
Columns have numerical headers (i.e. "1", "2", "3" etc.) More... | |
#define | MC_GS_COLUMNHEADERALPHABETIC 0x2000 |
Columns have alphabetical headers (i.e. "A", "B", "C" etc.) More... | |
#define | MC_GS_COLUMNHEADERNONE 0x3000 |
Columns have no header. More... | |
#define | MC_GS_COLUMNHEADERMASK |
Bit mask specifying the column header mode. More... | |
#define | MC_GS_ROWHEADERNORMAL 0x0000 |
The contents of row headers is used. This is default. More... | |
#define | MC_GS_ROWHEADERNUMBERED 0x4000 |
Rows have numerical headers (i.e. "1", "2", "3" etc.) More... | |
#define | MC_GS_ROWHEADERALPHABETIC 0x8000 |
Rows have alphabetical headers (i.e. "A", "B", "C" etc.) More... | |
#define | MC_GS_ROWHEADERNONE 0xC000 |
Rows have no header. This is default. More... | |
#define | MC_GS_ROWHEADERMASK |
Bit mask specifying the row header mode. More... | |
MC_GGEOMETRY::fMask Bits | |
#define | MC_GGF_COLUMNHEADERHEIGHT (1 << 0) |
Set if MC_GGEOMETRY::wColumnHeaderHeight is valid. More... | |
#define | MC_GGF_ROWHEADERWIDTH (1 << 1) |
Set if MC_GGEOMETRY::wRowHeaderWidth is valid. More... | |
#define | MC_GGF_DEFCOLUMNWIDTH (1 << 2) |
Set if MC_GGEOMETRY::wDefColumnWidth is valid. More... | |
#define | MC_GGF_DEFROWHEIGHT (1 << 3) |
Set if MC_GGEOMETRY::wDefRowHeight is valid. More... | |
#define | MC_GGF_PADDINGHORZ (1 << 4) |
Set if MC_GGEOMETRY::wPaddingHorz is valid. More... | |
#define | MC_GGF_PADDINGVERT (1 << 5) |
Set if MC_GGEOMETRY::wPaddingVert is valid. More... | |
MC_GHITTESTINFO::flags Bits | |
#define | MC_GHT_NOWHERE (1 << 0) |
In the client area, but does not hit any cell. More... | |
#define | MC_GHT_ONCOLUMNHEADER (1 << 1) |
On a column header cell. More... | |
#define | MC_GHT_ONROWHEADER (1 << 2) |
On a row header cell. More... | |
#define | MC_GHT_ONHEADER (MC_GHT_ONCOLUMNHEADER | MC_GHT_ONROWHEADER) |
On any header cell. More... | |
#define | MC_GHT_ONNORMALCELL (1 << 3) |
On normal cell. More... | |
#define | MC_GHT_ONCELL (MC_GHT_ONHEADER | MC_GHT_ONNORMALCELL) |
On cell. More... | |
#define | MC_GHT_ONCOLUMNDIVIDER (1 << 4) |
Not supported, reserved for future use. More... | |
#define | MC_GHT_ONROWDIVIDER (1 << 5) |
Not supported, reserved for future use. More... | |
#define | MC_GHT_ONCOLUMNDIVOPEN (1 << 6) |
Not supported, reserved for future use. More... | |
#define | MC_GHT_ONROWDIVOPEN (1 << 7) |
Not supported, reserved for future use. More... | |
#define | MC_GHT_ABOVE (1 << 8) |
Above the client area. More... | |
#define | MC_GHT_BELOW (1 << 9) |
Below the client area. More... | |
#define | MC_GHT_TORIGHT (1 << 10) |
To right of the client area. More... | |
#define | MC_GHT_TOLEFT (1 << 11) |
To left of the client area. More... | |
Control Messages | |
#define | MC_GM_GETTABLE (MC_GM_FIRST + 0) |
Gets handle of table attached to the control or NULL if none is attached. More... | |
#define | MC_GM_SETTABLE (MC_GM_FIRST + 1) |
Attaches a table to the control. More... | |
#define | MC_GM_GETCOLUMNCOUNT (MC_GM_FIRST + 2) |
Gets count of columns in table attached to the control. More... | |
#define | MC_GM_GETROWCOUNT (MC_GM_FIRST + 3) |
Gets count of rows in table attached to the control. More... | |
#define | MC_GM_RESIZE (MC_GM_FIRST + 4) |
Resizes table attached to the control. More... | |
#define | MC_GM_CLEAR (MC_GM_FIRST + 5) |
Clears the table. More... | |
#define | MC_GM_SETCELLW (MC_GM_FIRST + 6) |
Sets a table cell (Unicode variant). More... | |
#define | MC_GM_SETCELLA (MC_GM_FIRST + 7) |
Sets a table cell (ANSI variant). More... | |
#define | MC_GM_GETCELLW (MC_GM_FIRST + 8) |
Gets a table cell (Unicode variant). More... | |
#define | MC_GM_GETCELLA (MC_GM_FIRST + 9) |
Gets a table cell (ANSI variant). More... | |
#define | MC_GM_SETGEOMETRY (MC_GM_FIRST + 10) |
Sets geometry of the grid. More... | |
#define | MC_GM_GETGEOMETRY (MC_GM_FIRST + 11) |
Sets geometry of the grid. More... | |
#define | MC_GM_REDRAWCELLS (MC_GM_FIRST + 12) |
Requests to redraw region of cells. More... | |
#define | MC_GM_SETCOLUMNWIDTH (MC_GM_FIRST + 13) |
Set width of specified column. More... | |
#define | MC_GM_GETCOLUMNWIDTH (MC_GM_FIRST + 14) |
Get width of specified column. More... | |
#define | MC_GM_SETROWHEIGHT (MC_GM_FIRST + 15) |
Set height of specified row. More... | |
#define | MC_GM_GETROWHEIGHT (MC_GM_FIRST + 16) |
Get height of specified row. More... | |
#define | MC_GM_HITTEST (MC_GM_FIRST + 17) |
Tests which cell (and its part) is placed on specified position. More... | |
#define | MC_GM_GETCELLRECT (MC_GM_FIRST + 18) |
Get cell rectangle. More... | |
#define | MC_GM_ENSUREVISIBLE (MC_GM_FIRST + 19) |
Ensure the cell is visible. More... | |
#define | MC_GM_SETFOCUSEDCELL (MC_GM_FIRST + 20) |
Set cell which has focus. More... | |
#define | MC_GM_GETFOCUSEDCELL (MC_GM_FIRST + 21) |
Get cell which has focus. More... | |
#define | MC_GM_SETSELECTION (MC_GM_FIRST + 22) |
Set selection. More... | |
#define | MC_GM_GETSELECTION (MC_GM_FIRST + 23) |
Get selection. More... | |
#define | MC_GM_GETEDITCONTROL (MC_GM_FIRST + 24) |
Set selection. More... | |
#define | MC_GM_EDITLABEL (MC_GM_FIRST + 25) |
Begins in-place editing of the specified cell. More... | |
#define | MC_GM_CANCELEDITLABEL (MC_GM_FIRST + 26) |
Ends a cell editing operation, if any is in progress. More... | |
Control Notifications | |
#define | MC_GN_ODCACHEHINT (MC_GN_FIRST + 0) |
Notification providing a hint for data caching strategy for grids with virtual table. More... | |
#define | MC_GN_SETDISPINFOW (MC_GN_FIRST + 1) |
Fired when control needs to tell parent to update some cell data it manages (Unicode variant). More... | |
#define | MC_GN_SETDISPINFOA (MC_GN_FIRST + 2) |
Fired when control needs to tell parent to update some cell data it manages (ANSI variant). More... | |
#define | MC_GN_GETDISPINFOW (MC_GN_FIRST + 3) |
Fired when control needs to retrieve some cell data, the parent holds (Unicode variant). More... | |
#define | MC_GN_GETDISPINFOA (MC_GN_FIRST + 4) |
Fired when control needs to retrieve some cell data, the parent holds (ANSI variant). More... | |
#define | MC_GN_BEGINCOLUMNTRACK (MC_GN_FIRST + 5) |
Fired when user has begun dragging a column header divider in the control. More... | |
#define | MC_GN_ENDCOLUMNTRACK (MC_GN_FIRST + 6) |
Fired when user has finished dragging a column header divider in the control. More... | |
#define | MC_GN_BEGINROWTRACK (MC_GN_FIRST + 7) |
Fired when user has begun dragging a row header divider in the control. More... | |
#define | MC_GN_ENDROWTRACK (MC_GN_FIRST + 8) |
Fired when user has finished dragging a row header divider in the control. More... | |
#define | MC_GN_COLUMNWIDTHCHANGING (MC_GN_FIRST + 9) |
Fired when column width is about to change. More... | |
#define | MC_GN_COLUMNWIDTHCHANGED (MC_GN_FIRST + 10) |
Fired after column width has been changed. More... | |
#define | MC_GN_ROWHEIGHTCHANGING (MC_GN_FIRST + 11) |
Fired when column width is about to change. More... | |
#define | MC_GN_ROWHEIGHTCHANGED (MC_GN_FIRST + 12) |
Fired after row height has been changed. More... | |
#define | MC_GN_FOCUSEDCELLCHANGING (MC_GN_FIRST + 13) |
Fired when focused cell is about to change. More... | |
#define | MC_GN_FOCUSEDCELLCHANGED (MC_GN_FIRST + 14) |
Fired after focused cell has been changed. More... | |
#define | MC_GN_SELECTIONCHANGING (MC_GN_FIRST + 15) |
Fired when selection is about to change. More... | |
#define | MC_GN_SELECTIONCHANGED (MC_GN_FIRST + 16) |
Fired after selection has been changed. More... | |
#define | MC_GN_BEGINLABELEDITW (MC_GN_FIRST + 17) |
Fired when control is about to start label editing (Unicode variant). More... | |
#define | MC_GN_BEGINLABELEDITA (MC_GN_FIRST + 18) |
Fired when control is about to start label editing (ANSI variant). More... | |
#define | MC_GN_ENDLABELEDITW (MC_GN_FIRST + 19) |
Fired when control is about to end label editing (Unicode variant). More... | |
#define | MC_GN_ENDLABELEDITA (MC_GN_FIRST + 20) |
Fired when control is about to end label editing (ANSI variant). More... | |
Unicode Resolution | |
#define | MC_WC_GRID MCTRL_NAME_AW(MC_WC_GRID) |
#define | MC_NMGDISPINFO MCTRL_NAME_AW(MC_NMGDISPINFO) |
#define | MC_GM_SETCELL MCTRL_NAME_AW(MC_GM_SETCELL) |
#define | MC_GM_GETCELL MCTRL_NAME_AW(MC_GM_GETCELL) |
#define | MC_GN_SETDISPINFO MCTRL_NAME_AW(MC_GN_SETDISPINFO) |
#define | MC_GN_GETDISPINFO MCTRL_NAME_AW(MC_GN_GETDISPINFO) |
#define | MC_GN_BEGINLABELEDIT MCTRL_NAME_AW(MC_GN_BEGINLABELEDIT) |
#define | MC_GN_ENDLABELEDIT MCTRL_NAME_AW(MC_GN_ENDLABELEDIT) |
struct MC_GRECT |
A miscellaneous structure determining a rectangular area in the grid.
Note that by convention the top left corner (wColumnFrom
, wRowFrom
) is inclusive and the right bottom corner (wColumnTo
, wRowTo
) is exclusive.
Data Fields | ||
---|---|---|
WORD | wColumnFrom |
The left column coordinate. |
WORD | wRowFrom |
The top row coordinate. |
WORD | wColumnTo |
The right column coordinate. |
WORD | wRowTo |
The bottom row coordinate. |
struct MC_GGEOMETRY |
Structure describing inner geometry of the grid.
Data Fields | ||
---|---|---|
DWORD | fMask |
Bitmask specifying which other members are valid. See MC_GGF_xxxx. |
WORD | wColumnHeaderHeight |
Height of column header cells. |
WORD | wRowHeaderWidth |
Width of row header cells. |
WORD | wDefColumnWidth |
Default width of regular contents cells. |
WORD | wDefRowHeight |
Default height of regular contents cells. |
WORD | wPaddingHorz |
Horizontal padding in cells. |
WORD | wPaddingVert |
Vertical padding in cells. |
struct MC_GHITTESTINFO |
Structure for message MC_GM_HITTEST.
Data Fields | ||
---|---|---|
POINT | pt |
Client coordinate of the point to test. |
UINT | flags |
Flag receiving detail about result of the test. See MC_GHT_xxxx |
WORD | wColumn |
Column index of the cell that occupies the point. |
WORD | wRow |
Row index of the cell that occupies the point. |
struct MC_GSELECTION |
Structure describing a selection.
In general, the selection is described as a set of rectangular areas. All cells in any of those areas is then considered selected.
The control guarantees that on output (when using MC_GM_GETSELECTION or handling any selection-related notification), the rectangles do not overlap each other.
I.e. the following code snippet can be used to enumerate all the cells within the selection sel:
Data Fields | ||
---|---|---|
MC_GRECT | rcExtents |
Extents rectangle of the selection. This member is ignored on input. |
UINT | uDataCount |
Count of rectangles in the |
MC_GRECT * | rcData |
Pointer to array (of |
struct MC_NMGCACHEHINT |
Structure used by notification MC_GN_ODCACHEHINT.
struct MC_NMGCUSTOMDRAW |
Structure used by the standard notification NM_CUSTOMDRAW
.
Data Fields | ||
---|---|---|
MC_NMCUSTOMDRAW | nmcd |
Standard custom-draw structure. Note that for draw stages related to a cell (item), i.e. when |
COLORREF | clrText |
Item text color. |
COLORREF | clrTextBk |
Item background color. |
struct MC_NMGDISPINFOW |
Structure used by notifications MC_GN_GETDISPINFO and MC_GN_SETDISPINFO (Unicode variant).
Data Fields | ||
---|---|---|
NMHDR | hdr |
Common notification structure header. |
WORD | wColumn |
Column index. |
WORD | wRow |
Row index. |
MC_TABLECELLW | cell |
Structure describing the contents of the cell. |
struct MC_NMGDISPINFOA |
Structure used by notifications MC_GN_GETDISPINFO and MC_GN_SETDISPINFO (ANSI variant).
Data Fields | ||
---|---|---|
NMHDR | hdr |
Common notification structure header. |
WORD | wColumn |
Column index. |
WORD | wRow |
Row index. |
MC_TABLECELLA | cell |
Structure describing the contents of the cell. |
struct MC_NMGCOLROWSIZECHANGE |
Structure used by notifications related to resizing of column and headers.
Data Fields | ||
---|---|---|
NMHDR | hdr |
Common notification structure header. |
WORD | wColumnOrRow |
Column index (for MC_GN_COLUMNWIDTHCHANGING and MC_GN_COLUMNWIDTHCHANGED), or row index (for MC_GN_ROWHEIGHTCHANGING and MC_GN_ROWHEIGHTCHANGED). |
WORD | wWidthOrHeight |
Column width (for MC_GN_COLUMNWIDTHCHANGING and MC_GN_COLUMNWIDTHCHANGED), or row height (for MC_GN_ROWHEIGHTCHANGING and MC_GN_ROWHEIGHTCHANGED). |
struct MC_NMGFOCUSEDCELLCHANGE |
struct MC_NMGSELECTIONCHANGE |
Structure used by notifications related to selection change.
Data Fields | ||
---|---|---|
NMHDR | hdr |
Common notification structure header. |
MC_GSELECTION | oldSelection |
Old selection description. |
MC_GSELECTION | newSelection |
New selection description. |
#define MC_WC_GRIDW L"mCtrl.grid" |
Window class name (Unicode variant).
#define MC_WC_GRIDA "mCtrl.grid" |
Window class name (ANSI variant).
#define MC_GS_NOTABLECREATE 0x0001 |
Do not automatically create empty table.
#define MC_GS_NOGRIDLINES 0x0002 |
Do not paint grid lines.
#define MC_GS_DOUBLEBUFFER 0x0004 |
Use double buffering.
#define MC_GS_OWNERDATA 0x0008 |
Enable the virtual grid mode.
See Virtual Grid for more info.
#define MC_GS_RESIZABLECOLUMNS 0x0010 |
Enable changing column width by dragging header divider.
#define MC_GS_RESIZABLEROWS 0x0020 |
Enable changing row height by dragging row header divider.
#define MC_GS_FOCUSEDCELL 0x0040 |
Enables cell focus.
#define MC_GS_EDITLABELS 0x0080 |
Enables label editing support.
#define MC_GS_NOSEL 0x0000 |
Control does not allow cell selection.
#define MC_GS_SINGLESEL 0x0100 |
Control allows to select only one cell.
#define MC_GS_RECTSEL 0x0200 |
Control allows to select only a rectangular area of cells.
#define MC_GS_COMPLEXSEL 0x0300 |
Control allows to select any arbitrary set of cells.
#define MC_GS_SHOWSELALWAYS 0x0400 |
Paint selection even when the control does not have focus.
#define MC_GS_COLUMNHEADERNORMAL 0x0000 |
The contents of column headers is used. This is default.
#define MC_GS_COLUMNHEADERNUMBERED 0x1000 |
Columns have numerical headers (i.e. "1", "2", "3" etc.)
#define MC_GS_COLUMNHEADERALPHABETIC 0x2000 |
Columns have alphabetical headers (i.e. "A", "B", "C" etc.)
#define MC_GS_COLUMNHEADERNONE 0x3000 |
Columns have no header.
#define MC_GS_COLUMNHEADERMASK |
Bit mask specifying the column header mode.
#define MC_GS_ROWHEADERNORMAL 0x0000 |
The contents of row headers is used. This is default.
#define MC_GS_ROWHEADERNUMBERED 0x4000 |
Rows have numerical headers (i.e. "1", "2", "3" etc.)
#define MC_GS_ROWHEADERALPHABETIC 0x8000 |
Rows have alphabetical headers (i.e. "A", "B", "C" etc.)
#define MC_GS_ROWHEADERNONE 0xC000 |
Rows have no header. This is default.
#define MC_GS_ROWHEADERMASK |
Bit mask specifying the row header mode.
#define MC_GGF_COLUMNHEADERHEIGHT (1 << 0) |
Set if MC_GGEOMETRY::wColumnHeaderHeight is valid.
#define MC_GGF_ROWHEADERWIDTH (1 << 1) |
Set if MC_GGEOMETRY::wRowHeaderWidth is valid.
#define MC_GGF_DEFCOLUMNWIDTH (1 << 2) |
Set if MC_GGEOMETRY::wDefColumnWidth is valid.
#define MC_GGF_DEFROWHEIGHT (1 << 3) |
Set if MC_GGEOMETRY::wDefRowHeight is valid.
#define MC_GGF_PADDINGHORZ (1 << 4) |
Set if MC_GGEOMETRY::wPaddingHorz is valid.
#define MC_GGF_PADDINGVERT (1 << 5) |
Set if MC_GGEOMETRY::wPaddingVert is valid.
#define MC_GHT_NOWHERE (1 << 0) |
In the client area, but does not hit any cell.
#define MC_GHT_ONCOLUMNHEADER (1 << 1) |
On a column header cell.
#define MC_GHT_ONROWHEADER (1 << 2) |
On a row header cell.
#define MC_GHT_ONHEADER (MC_GHT_ONCOLUMNHEADER | MC_GHT_ONROWHEADER) |
On any header cell.
#define MC_GHT_ONNORMALCELL (1 << 3) |
On normal cell.
#define MC_GHT_ONCELL (MC_GHT_ONHEADER | MC_GHT_ONNORMALCELL) |
On cell.
#define MC_GHT_ONCOLUMNDIVIDER (1 << 4) |
Not supported, reserved for future use.
#define MC_GHT_ONROWDIVIDER (1 << 5) |
Not supported, reserved for future use.
#define MC_GHT_ONCOLUMNDIVOPEN (1 << 6) |
Not supported, reserved for future use.
#define MC_GHT_ONROWDIVOPEN (1 << 7) |
Not supported, reserved for future use.
#define MC_GHT_ABOVE (1 << 8) |
Above the client area.
#define MC_GHT_BELOW (1 << 9) |
Below the client area.
#define MC_GHT_TORIGHT (1 << 10) |
To right of the client area.
#define MC_GHT_TOLEFT (1 << 11) |
To left of the client area.
#define MC_GM_GETTABLE (MC_GM_FIRST + 0) |
Gets handle of table attached to the control or NULL
if none is attached.
Note that calling the message does not change reference counter of the returned table. If you want to preserve the handle, you should call mcTable_AddRef() on it and then mcTable_Release() when you no longer need it.
wParam | Reserved, set to zero. |
lParam | Reserved, set to zero. |
NULL
. #define MC_GM_SETTABLE (MC_GM_FIRST + 1) |
Attaches a table to the control.
Reference counter of the table is incremented. Previously attached table (if any) is detached and its reference counter is decremented.
If the wParam
is NULL
, the control creates new table (with reference count set to one), unless the control has style MC_GS_NOTABLECREATE.
wParam | Reserved, set to zero. | |
[in] | lParam | (MC_HTABLE) Handle of the table, or NULL . |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_GETCOLUMNCOUNT (MC_GM_FIRST + 2) |
Gets count of columns in table attached to the control.
wParam | Reserved, set to zero. |
lParam | Reserved, set to zero. |
WORD
) Returns count of table columns. #define MC_GM_GETROWCOUNT (MC_GM_FIRST + 3) |
Gets count of rows in table attached to the control.
wParam | Reserved, set to zero. |
lParam | Reserved, set to zero. |
WORD
) Returns count of table rows. #define MC_GM_RESIZE (MC_GM_FIRST + 4) |
Resizes table attached to the control.
[in] | wParam | (DWORD ) The low-order word specifies count of columns, high-order word specifies count of rows. |
lParam | Reserved, set to zero. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_CLEAR (MC_GM_FIRST + 5) |
Clears the table.
[in] | wParam | Specification of the cells to be cleared. When set to zero, all table contents (including header cells) is cleared. When non-zero, the value is interpreted as a bit-mask of cells to clear: Set bit 0x1 to clear all ordinary cells, 0x2 to clear column headers and bit 0x4 to clear row cells. |
lParam | Reserved, set to zero. |
#define MC_GM_SETCELLW (MC_GM_FIRST + 6) |
Sets a table cell (Unicode variant).
[in] | wParam | (DWORD ) Low word specifies column, high word specifies row. |
[in] | lParam | (MC_TABLECELLW*) Pointer to structure describing the cell. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_SETCELLA (MC_GM_FIRST + 7) |
Sets a table cell (ANSI variant).
[in] | wParam | (DWORD ) Low word specifies column, high word specifies row. |
[in] | lParam | (MC_TABLECELLA*) Pointer to structure describing the cell. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_GETCELLW (MC_GM_FIRST + 8) |
Gets a table cell (Unicode variant).
Before calling this function, the member MC_TABLECELL::fMask
must specify what attributes of the cell to retrieve.
[in] | wParam | (DWORD ) Low word specifies column, high word specifies row. |
[out] | lParam | (MC_TABLECELLW*) Pointer to structure describing the cell. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_GETCELLA (MC_GM_FIRST + 9) |
Gets a table cell (ANSI variant).
Before calling this function, the member MC_TABLECELL::fMask
must specify what attributes of the cell to retrieve.
[in] | wParam | (DWORD ) Low word specifies column, high word specifies row. |
[out] | lParam | (MC_TABLECELLA*) Pointer to structure describing the cell. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_SETGEOMETRY (MC_GM_FIRST + 10) |
Sets geometry of the grid.
wParam | Reserved, set to zero. | |
[in] | lParam | (MC_GGEOMETRY*) Pointer to structure describing the geometry. Only fields specified by the member fMask are set. If lParam is NULL , the geometry is reset to a default values. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_GETGEOMETRY (MC_GM_FIRST + 11) |
Sets geometry of the grid.
wParam | Reserved, set to zero. | |
[in,out] | lParam | (MC_GGEOMETRY*) Pointer to structure describing the geometry. Only fields specified by the member fMask are retrieved. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_REDRAWCELLS (MC_GM_FIRST + 12) |
Requests to redraw region of cells.
Note the message just invalidates the region of cells, and the control is not actually repainted until it receives a WM_PAINT
message.
[in] | wParam | Specification of top left cell in the region to be (re)painted. Low word specifies its column, high word specifies its row. |
[in] | lParam | Specification of bottom right cell in the region to be (re)painted. Low word specifies its column, high word specifies its row. |
BOOL
) TRUE
on success, FALSE
on failure.For example, to repaint a single cell, use can use code similar to this:
#define MC_GM_SETCOLUMNWIDTH (MC_GM_FIRST + 13) |
Set width of specified column.
To reset width of the column to the default value (as specified with MC_GGEOMETRY::wDefColumnWidth), set the column width to 0xFFFF
.
Note this message can set only width of an ordinary grid column. To change the width of row headers, use MC_GM_SETGEOMETRY.
[in] | wParam | (WORD ) Index of the column. |
[in] | lParam | (DWORD ) Set low word to the desired width in pixels, high word to zero. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_GETCOLUMNWIDTH (MC_GM_FIRST + 14) |
Get width of specified column.
[in] | wParam | (WORD ) Index of the column. |
lParam | Reserved, set to zero. |
LRESULT
) If the message fails, the return value is -1
. On success, low word is the width in pixels, high word is reserved for future and it is currently always set to zero. #define MC_GM_SETROWHEIGHT (MC_GM_FIRST + 15) |
Set height of specified row.
To reset height of the row to the default value (as specified with MC_GGEOMETRY::wDefRowHeight), set the row height to 0xFFFF
.
Note this message can set only height of an ordinary grid row. To change the height of column headers, use MC_GM_SETGEOMETRY.
[in] | wParam | (WORD ) Index of the row. |
[in] | lParam | (DWORD ) Set low word to the desired height in pixels, high word to zero. |
BOOL
) TRUE
on success, FALSE
on failure. #define MC_GM_GETROWHEIGHT (MC_GM_FIRST + 16) |
Get height of specified row.
[in] | wParam | (WORD ) Index of the row. |
lParam | Reserved, set to zero. |
LRESULT
) If the message fails, the return value is -1
. On success, low word is the height in pixels, high word is reserved for future and it is currently always set to zero. #define MC_GM_HITTEST (MC_GM_FIRST + 17) |
Tests which cell (and its part) is placed on specified position.
wParam | Reserved, set to zero. | |
[in,out] | lParam | (MC_GHITTESTINFO*) Pointer to a hit test structure. Set MC_GHITTESTINFO::pt on input. |
DWORD
) Cell column and row specification, if any, or -1 otherwise. If not -1, in low word of the value, the column index is specified and, in high word of the value, its row index is specified. #define MC_GM_GETCELLRECT (MC_GM_FIRST + 18) |
Get cell rectangle.
[in] | wParam | (DWORD ) Column and row of the cell. Low word specifies column index and high word specifies row index. |
[out] | lParam | (RECT* ) Pointer to rectangle. |
BOOL
) TRUE
on success, FALSE
otherwise. #define MC_GM_ENSUREVISIBLE (MC_GM_FIRST + 19) |
Ensure the cell is visible.
If not visible, the control scrolls to make the cell visible.
[in] | wParam | (DWORD ) Column and row of the cell. Low word specifies column index and high word specifies row index. |
[in] | lParam | (BOOL ) A value specifying whether entire cell should be visible. If TRUE , no scrolling happens when the cell is at least partially visible. |
BOOL
) TRUE
on success, FALSE
otherwise. #define MC_GM_SETFOCUSEDCELL (MC_GM_FIRST + 20) |
Set cell which has focus.
[in] | wParam | (DWORD ) Low word specifies column, high word specifies row. Note that cursor can move only to ordinary cells. |
lParam | Reserved, set to zero. |
BOOL
) TRUE
on success, FALSE
otherwise. #define MC_GM_GETFOCUSEDCELL (MC_GM_FIRST + 21) |
Get cell which has focus.
wParam | Reserved, set to zero. |
lParam | Reserved, set to zero. |
DWORD
) Low word specifies column, high word specifies row. #define MC_GM_SETSELECTION (MC_GM_FIRST + 22) |
Set selection.
wParam | Reserved, set to zero. | |
[in] | lParam | (MC_GSELECTION*) Pointer to structure describing the selection, or NULL to reset selection. |
BOOL
) TRUE
on success, FALSE
otherwise. #define MC_GM_GETSELECTION (MC_GM_FIRST + 23) |
Get selection.
When sending this message application has set some members of MC_GSELECTION
, as provided via lParam
. There are three modes operations.
lParam
to NULL
. Then no actual data are retrieved and the message only returns the count of rectangles the selection is composed of.MC_GSELECTION::rcData
to point to the buffer, and MC_GSELECTION::uDataCount
to maximal count of rectangles the buffer can hold. On output, the MC_GSELECTION::uDataCount
is set to the actual count of rectangles copied into the buffer.MC_GSELECTION::uDataCount
to
(UINT)-1. Instead of copying, the control sets MC_GSELECTION::rcData
to point into its internal buffer. In this mode application must not free or modify the contents of the internal buffer, and also it must not retain the pointer for later use as it may become invalid any time.wParam | Reserved, set to zero. | |
[in,out] | lParam | (MC_GSELECTION*) Pointer to structure to be filled by the control, or NULL . Application has initialize some members of the structure as described above. |
UINT
) Count of rectangles required for MC_GSELECTION::rcData
on success. Zero means the selection is empty. #define MC_GM_GETEDITCONTROL (MC_GM_FIRST + 24) |
Set selection.
wParam | Reserved, set to zero. |
lParam | Reserved, set to zero. |
HWND
) Handle of edit control on success, NULL
otherwise. #define MC_GM_EDITLABEL (MC_GM_FIRST + 25) |
Begins in-place editing of the specified cell.
This message implicitly sets focus to the given cell.
[in] | wParam | (DWORD ) Column and row of the cell. Low word specifies column index and high word specifies row index. |
lParam | Reserved, set to zero. |
HWND
) Handle of edit control on success, NULL
otherwise. #define MC_GM_CANCELEDITLABEL (MC_GM_FIRST + 26) |
Ends a cell editing operation, if any is in progress.
If any edit operation is in progress, the message causes a notification MC_GN_ENDLABELEDIT to be sent.
wParam | Reserved, set to zero. |
lParam | Reserved, set to zero. |
#define MC_GN_ODCACHEHINT (MC_GN_FIRST + 0) |
Notification providing a hint for data caching strategy for grids with virtual table.
The notification is sent only when the control has the style MC_GS_OWNERDATA. The notification informs the application about region of cells it is likely to ask for (via MC_GN_GETDISPINFO).
If the retrieval of assorted data by the application is slow (e.g. because it requires remote access to a database system), the application should cache locally the data for cells in the rectangular cell region as specified by the MC_NMGCACHEHINT
.
The structure never specify header cells, however if the control has style MC_GS_COLUMNHEADERNORMAL and/or MC_GS_ROWHEADERNORMAL, it should also cache data needed for column/row headers corresponding for the cells in the region.
For example, if the grid uses the styles MC_GS_COLUMNHEADERNORMAL and MC_GS_ROWHEADERNORMAL, the following data are recommended to be cached within the application:
columnFrom
, rowFrom
] and right bottom cell [columnTo
, rowTo
].columnFrom
... columnFrom
.rowFrom
... rowTo
.In general, the specified cell region roughly corresponds to cells currently visible in the control's window client area.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCACHEHINT*) Pointer to MC_NMGCACHEHINT structure. |
#define MC_GN_SETDISPINFOW (MC_GN_FIRST + 1) |
Fired when control needs to tell parent to update some cell data it manages (Unicode variant).
When sending the notification, the control sets MC_NMGDISPINFO::wColumn
and MC_NMGDISPINFO::wRow
to identify the cell. The control also sets MC_NMTLDISPINFO::item::lParam
(however if the style MC_GS_OWNERDATA is in effect, it is always set to zero).
The control specifies what members in MC_NMGDISPINFO::cell
the application should remember with the MC_NMGDISPINFO::cell::fMask
.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
#define MC_GN_SETDISPINFOA (MC_GN_FIRST + 2) |
Fired when control needs to tell parent to update some cell data it manages (ANSI variant).
When sending the notification, the control sets MC_NMGDISPINFO::wColumn
and MC_NMGDISPINFO::wRow
to identify the cell. The control also sets MC_NMTLDISPINFO::item::lParam
(however if the style MC_GS_OWNERDATA is in effect, it is always set to zero).
The control specifies what members in MC_NMGDISPINFO::cell
the application should remember with the MC_NMGDISPINFO::cell::fMask
.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
#define MC_GN_GETDISPINFOW (MC_GN_FIRST + 3) |
Fired when control needs to retrieve some cell data, the parent holds (Unicode variant).
This may happen when MC_TABLECELL::pszText
was set to the magical value MC_LPSTR_TEXTCALLBACK, or when the control has the style MC_GS_OWNERDATA.
When sending the notification, the control sets MC_NMGDISPINFO::wColumn
and MC_NMGDISPINFO::wRow
to identify the cell. The control also sets MC_NMTLDISPINFO::item::lParam
(however if the style MC_GS_OWNERDATA is in effect, it is always set to zero).
The control specifies what members in MC_NMGDISPINFO::cell
the application should fill with the MC_NMGDISPINFO::cell::fMask
.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
#define MC_GN_GETDISPINFOA (MC_GN_FIRST + 4) |
Fired when control needs to retrieve some cell data, the parent holds (ANSI variant).
This may happen when MC_TABLECELL::pszText
was set to the magical value MC_LPSTR_TEXTCALLBACK, or when the control has the style MC_GS_OWNERDATA.
When sending the notification, the control sets MC_NMGDISPINFO::wColumn
and MC_NMGDISPINFO::wRow
to identify the cell. The control also sets MC_NMTLDISPINFO::item::lParam
(however if the style MC_GS_OWNERDATA is in effect, it is always set to zero).
The control specifies what members in MC_NMGDISPINFO::cell
the application should fill with the MC_NMGDISPINFO::cell::fMask
.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
#define MC_GN_BEGINCOLUMNTRACK (MC_GN_FIRST + 5) |
Fired when user has begun dragging a column header divider in the control.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
TRUE
to prevent the column width change, FALSE
to allow it. #define MC_GN_ENDCOLUMNTRACK (MC_GN_FIRST + 6) |
Fired when user has finished dragging a column header divider in the control.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
#define MC_GN_BEGINROWTRACK (MC_GN_FIRST + 7) |
Fired when user has begun dragging a row header divider in the control.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
TRUE
to prevent the row height change, FALSE
to allow it. #define MC_GN_ENDROWTRACK (MC_GN_FIRST + 8) |
Fired when user has finished dragging a row header divider in the control.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
#define MC_GN_COLUMNWIDTHCHANGING (MC_GN_FIRST + 9) |
Fired when column width is about to change.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
TRUE
to prevent the column width change, FALSE
to allow it. #define MC_GN_COLUMNWIDTHCHANGED (MC_GN_FIRST + 10) |
Fired after column width has been changed.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
#define MC_GN_ROWHEIGHTCHANGING (MC_GN_FIRST + 11) |
Fired when column width is about to change.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
TRUE
to prevent the row height change, FALSE
to allow it. #define MC_GN_ROWHEIGHTCHANGED (MC_GN_FIRST + 12) |
Fired after row height has been changed.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGCOLROWSIZECHANGE*) Pointer to MC_NMGCOLROWSIZECHANGE structure. |
#define MC_GN_FOCUSEDCELLCHANGING (MC_GN_FIRST + 13) |
Fired when focused cell is about to change.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGFOCUSEDCELLCHANGE*) Pointer to MC_NMGFOCUSEDCELLCHANGE structure. |
TRUE
to prevent the row height change, FALSE
to allow it. #define MC_GN_FOCUSEDCELLCHANGED (MC_GN_FIRST + 14) |
Fired after focused cell has been changed.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGFOCUSEDCELLCHANGE*) Pointer to MC_NMGFOCUSEDCELLCHANGE structure. |
#define MC_GN_SELECTIONCHANGING (MC_GN_FIRST + 15) |
Fired when selection is about to change.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGSELECTIONCHANGE*) Pointer to MC_NMGSELECTIONCHANGE structure. |
TRUE
to prevent the selection change, FALSE
to allow it. #define MC_GN_SELECTIONCHANGED (MC_GN_FIRST + 16) |
Fired after selection has been changed.
[in] | wParam | (int ) Id of the control sending the notification. |
[in] | lParam | (MC_NMGSELECTIONCHANGE*) Pointer to MC_NMGSELECTIONCHANGE structure. |
#define MC_GN_BEGINLABELEDITW (MC_GN_FIRST + 17) |
Fired when control is about to start label editing (Unicode variant).
The cell to be edited is specified with MC_NMGDISPINFO::wCol
and wRow
.
When this notification is sent the edit control for editing the label already exists (but is hidden). Application may ask for it with the message MC_GM_GETEDITCONTROL and customize it.
This may only happen if the control has the style MC_GS_EDITLABELS.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
TRUE
to prevent the label editing, FALSE
to allow it. #define MC_GN_BEGINLABELEDITA (MC_GN_FIRST + 18) |
Fired when control is about to start label editing (ANSI variant).
The cell to be edited is specified with MC_NMGDISPINFO::wCol
and wRow
.
When this notification is sent the edit control for editing the label already exists (but is hidden). Application may ask for it with the message MC_GM_GETEDITCONTROL and customize it.
This may only happen if the control has the style MC_GS_EDITLABELS.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
TRUE
to prevent the label editing, FALSE
to allow it. #define MC_GN_ENDLABELEDITW (MC_GN_FIRST + 19) |
Fired when control is about to end label editing (Unicode variant).
The control sets MC_NMGDISPINFO
provided via LPARAM
to describe change of the label. MC_NMGDISPINFO::wCol
and wRow
determine the cell. MC_NMGDISPINFO::cell::pszText
is set to the new label or to NULL
if the label editing is being canceled.
This may only happen if the control has the style MC_GS_EDITLABELS.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
MC_NMGDISPINFO::cell::pszText
is not NULL
, return TRUE
to allow change of the label, FALSE
to suppress it. If the pszText
is NULL
, the return value is ignored and no label change happens. #define MC_GN_ENDLABELEDITA (MC_GN_FIRST + 20) |
Fired when control is about to end label editing (ANSI variant).
The control sets MC_NMGDISPINFO
provided via LPARAM
to describe change of the label. MC_NMGDISPINFO::wCol
and wRow
determine the cell. MC_NMGDISPINFO::cell::pszText
is set to the new label or to NULL
if the label editing is being canceled.
This may only happen if the control has the style MC_GS_EDITLABELS.
[in] | wParam | (int ) Id of the control sending the notification. |
[in,out] | lParam | (MC_NMGDISPINFO*) Pointer to MC_NMGDISPINFO structure. |
MC_NMGDISPINFO::cell::pszText
is not NULL
, return TRUE
to allow change of the label, FALSE
to suppress it. If the pszText
is NULL
, the return value is ignored and no label change happens. #define MC_WC_GRID MCTRL_NAME_AW(MC_WC_GRID) |
Unicode-resolution alias.
#define MC_NMGDISPINFO MCTRL_NAME_AW(MC_NMGDISPINFO) |
Unicode-resolution alias.
#define MC_GM_SETCELL MCTRL_NAME_AW(MC_GM_SETCELL) |
Unicode-resolution alias.
#define MC_GM_GETCELL MCTRL_NAME_AW(MC_GM_GETCELL) |
Unicode-resolution alias.
#define MC_GN_SETDISPINFO MCTRL_NAME_AW(MC_GN_SETDISPINFO) |
Unicode-resolution alias.
#define MC_GN_GETDISPINFO MCTRL_NAME_AW(MC_GN_GETDISPINFO) |
Unicode-resolution alias.
#define MC_GN_BEGINLABELEDIT MCTRL_NAME_AW(MC_GN_BEGINLABELEDIT) |
Unicode-resolution alias.
#define MC_GN_ENDLABELEDIT MCTRL_NAME_AW(MC_GN_ENDLABELEDIT) |
Unicode-resolution alias.
BOOL mcGrid_Initialize | ( | void | ) |
Registers window class of the control.
TRUE
on success, FALSE
on failure. void mcGrid_Terminate | ( | void | ) |
Unregisters window class of the control.