Cell types

Main Features ››
Parent Previous Next

Cell types

With M!Table you can define the cell type ( Standard, Drop Down List, Popup Edit or Check Box ) on cell level.
The primary function to achieve this is MTblDefineCellType.



Hints and tips

A look behind the scenes
M!Table can't conjure, so a column can still have only one type at a time.
To create a nearly perfect illusion of individual types on cell level, M!Table does the following:
First of all, all cells are drawn according to their "effective" type definition. "Effective" means that if a cell doesn't have an own type definition, the type definition of the column is used. Furthermore, just before a cell goes into editing mode, M!Table compares the current type definition of the column with the "effective" type definition of the cell.
If the "effective" type definition of the cell is different, M!Table sets the type of the column as needed and additionally prevents flickering. At last, when the cell is in editing mode, it has the desired type.

A special problem: Drop Down Lists
The technique described above works so far automatically without any further coding effort.
But there remains a special problem regarding drop down lists: The list functions.

To understand the problem one must know that there is always only one "real" list box per column. So if you have 3 drop down list columns and look into Spy++, you'll see that there are exactly 3 "real" list boxes, precisely one per column. When a list function is called, the list function sends a specific message to the column of interest to obtain the window handle of the "real" list box. Once the window handle is known, the list function operates on this list box.

Now you can imagine that it's really difficult to provide type definitions on cell level and to have - if at all - only one "real" list box per column.
Therefore M!Table introduces the so called "drop down list context".
When you set the drop down list context with MTblSetDropDownListContext , you tell M!Table: "In a moment I want to use a list function for a specific cell".
In return M!Table ensures that the list function will work as expected.

So the rule of thumb is: Always call MTblSetDropDownListContext before the first list function is called for a specific cell.

But don't worry, there are situations where M!Table sets the drop down list context automatically, namely:
- when a cell goes into editing mode ( means that normally there's no need to call MTblSetDropDownListContext on SAM_DropDown )
- when a cell is defined as drop down list with MTblDefineCellType
- when a column is defined as drop down list with SalTblDefineDropDownListColumn

BTW, it's not necessary to set the drop down list context if you don't use type definitions on cell level.
So there's no need to change existing applications which don't use this feature.

VisList*Value functions
The following VisList*Value functions are supported:
VisListAddValue, VisListFindValue, VisListGetValue, VisListInsertValue and VisListSetValue.

M!Table supports this functions for ordinary drop down list columns and of course for drop down list cells defined with MTblDefineCellType.

Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework