#include <mgui/grid.h>
Inheritance diagram for MGUI::CTRL_GRID:

Public Types | |
| enum | FORMAT { FORMAT_Left = 0, FORMAT_Right = 1, FORMAT_Center = 2 } |
| enum | IMAGELISTTYPE { IMAGELISTTYPE_Normal = 0, IMAGELISTTYPE_Small = 1, IMAGELISTTYPE_State = 2 } |
| enum | STYLE { STYLE_AlignLeft = 0x0800, STYLE_AlignTop = 0x0000, STYLE_AutoArrange = 0x0100, STYLE_EditLabels = 0x0200, STYLE_NoColumnHeader = 0x4000, STYLE_NoLabelWrap = 0x0080, STYLE_NoScroll = 0x2000, STYLE_NoSortHeader = 0x8000, STYLE_OwnerData = 0x1000, STYLE_ShowSelAlways = 0x0008, STYLE_NoGridLines = 0x0001, STYLE_SingleSel = 0x0004, STYLE_SortAscending = 0x0010, STYLE_SortDescending = 0x0020 } |
| enum | VIEWMODE { VIEWMODE_Icon = 0, VIEWMODE_Report = 1, VIEWMODE_SmallIcon = 2, VIEWMODE_List = 3 } |
Public Member Functions | |
| void | Create (MGUI::LAYOUT_PANE_BASE &ParentPane, int height=10, int width=40, VIEWMODE viewmode=VIEWMODE_Report, STYLE style=STYLE_AlignTop, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_Expand) |
| CTRL_GRID () | |
| void | DeleteAllColumns () |
| void | DeleteAllItems () |
| void | DeleteColumn (int col) |
| void | DeleteItem (int itemnum) |
| void | DeleteItemByData (ID id) |
| void | DeselectAllItems () |
| bool | EditItem (int itemnum, int column, const UNICODE *initstr, bool selectall=true) |
| bool | EditItem (int itemnum, int column=0, bool selectall=true) |
| void | EnsureVisible (int itemnum, bool PartialOK=false) |
| int | FindItemByData (ID data) const |
| int | FindItemByData (const void *value) const |
| int | GetBottomRow () const |
| bool | GetCellRect (int itemnum, int col, LRECT2D &rect) const |
| int | GetColumnCount () const |
| bool | GetColumnLabel (int column, MISTRING &label) const |
| ERRVALUE | GetColumnOrderArray (SIMPLE_ARRAY< INT32 > &array) |
| int | GetColumnWidth (int column) const |
| int | GetCountPerPage () const |
| int | GetHeadingHeight () const |
| int | GetItemCount () const |
| MGUI::ID | GetItemData (int itemnum) const |
| int | GetNextSelectedItem (int startitem=-1) const |
| int | GetSelectedCount () const |
| BOOL | GetSubItemRect (int item, int colnum, CRect &rect) |
| int | GetTopRow () const |
| int | InsertColumn (int colnum, const MISTRING &string, FORMAT format=FORMAT_Left, int width=-1) |
| int | InsertColumn (int colnum, const UNICODE *string, FORMAT format=FORMAT_Left, int width=-1) |
| int | InsertColumn (int colnum, const char *string, FORMAT format=FORMAT_Left, int width=-1, bool lookup=true) |
| int | InsertItem (int pos, const UNICODE *string) |
| int | InsertItem (int pos, const char *string, bool lookup=true) |
| int | InsertItem (const MISTRING &string) |
| int | InsertItem (const UNICODE *string) |
| int | InsertItem (const char *string, bool lookup=true) |
| bool | IsItemSelected (int itemnum) const |
| void | Redraw (bool updatenow=true) |
| void | RedrawItems (int firstitemnum, int lastitemnum, bool updatenow=true) |
| bool | SetColumnLabel (int column, const UNICODE *label) |
| void | SetColumnOrderArray (SIMPLE_ARRAY< INT32 > &array) |
| void | SetColumnWidth (int column, int width) |
| void | SetExtendedStyle (UINT32 exstyles, UINT32 mask=0) |
| void | SetImageList (IMAGELIST &imagelist, IMAGELISTTYPE listtype=IMAGELISTTYPE_Small, bool shared=false) |
| int | SetItemCount (int NumItems) |
| void | SetItemData (int itemnum, ID value) |
| void | SetItemImage (int itemnum, int imageindex) |
| void | SetItemSelected (int itemnum, bool selected=true) |
| void | SetItemText (int itemnum, int subitem, const UNICODE *string) |
| void | SetItemText (int itemnum, int subitem, const char *string, bool lookup=true) |
| void | SortItems (int column=0, bool bAscending=true) |
| void | Update (int itemnum) |
| virtual | ~CTRL_GRID () |
Protected Member Functions | |
| STYLE | GetStyle () const |
| virtual bool | OnBeginLabelEdit (int itemnum, int subitemnum) |
| virtual void | OnClickColumn (int itemnum, int column, KEYSTATE state) |
| virtual void | OnClickItem (int itemnum, int column, KEYSTATE state) |
| virtual void | OnDoubleClickItem (int itemnum, int column, KEYSTATE state) |
| virtual bool | OnDrawItem (CUSTOMDRAW &drawinfo) |
| virtual bool | OnEndLabelEdit (int row, int col, MISTRING &string) |
| virtual bool | OnGetDispInfo (int row, int col, CTRL_GRID::DISPINFO &dispinfo) |
| virtual void | OnItemActivate () |
| virtual int | OnItemCompare (UINT32 rowitem1, UINT32 rowitem2, int colnum, bool bAscending) |
| virtual int | OnItemCompare (UINT32 rowitem1, UINT32 rowitem2) |
| virtual void | OnItemSelect (int itemnum, int subitemnum) |
| virtual void | OnItemUnselect (int itemnum, int subitemnum) |
| virtual void | OnOwnerDataCacheHint (int from, int to) |
| virtual void | OnRightClickItem (int itemnum, int column, const LPOINT2D &, KEYSTATE state) |
There is also a MGUI::CTRL_GRID_T template which helps eliminate the need for subclassing. See the description for MGUI::CTRL for more information on using templates. There are two general ways to work with lists, "standard" and "owner-data" (virtual). In the standard configuration the list control itself contains all of the data (strings, icons, states) for each list entry. In the "owner-data" configuration, the data is stored outside the list and the OnGetDispInfo and OnOwnerDataCacheHint methods are overridden (or set when using the template) and will be called by the list control when data is needed to be displayed in the list.
Definition at line 174 of file grid.h.
|
|
|
|
|
|
|
|
|
|
|
|
Constructor.
|
|
|
Destructor.
|
|
||||||||||||||||||||||||||||
|
Create the control.
|
|
|
Delete all columns.
|
|
|
Delete all items.
|
|
|
Delete specified column.
|
|
|
Delete specified item.
|
|
|
Delete specified item given assigned data value.
|
|
|
Deselect all items.
|
|
||||||||||||||||||||
|
Begin editing specified item, starting with specified string.
|
|
||||||||||||||||
|
Begin editing specified item, starting with currently displayed value.
|
|
||||||||||||
|
Ensures that an item is visible.
|
|
|
Find item by matching specified data value as ID.
|
|
|
Find item by matching specified data value as pointer.
|
|
|
Get the index (row number) of the bottom-most visible item. Note: Return value may be greater than number of rows of data if more rows are visible than there are data for. |
|
||||||||||||||||
|
Get the bounding rectangle of a single cell.
|
|
|
Get number of columns in the list.
|
|
||||||||||||
|
Get the label for a column.
|
|
|
Get the order of columns in the list. Columns can be reordered by dragging them around if you call SetExtendedStyle() with LVS_EX_HEADERDRAGDROP |
|
|
Get the width of a column in pixels.
|
|
|
Get number of items that can fit vertically in the visible area of control (in report mode only).
|
|
|
Get height of heading in pixels.
|
|
|
Get number of items in list.
|
|
|
Get data value associated with item.
|
|
|
Get next selected item in list.
|
|
|
Get number of selected items.
|
|
|
|
|
||||||||||||||||
|
Return the rectangle (in client coordinates) of a given row/column in the list Only exists in MFC version because it returns an MFC CRect.
|
|
|
Get the index (row number) of the top-most visible item.
|
|
||||||||||||||||||||
|
Insert new column with label from MISTRING;.
|
|
||||||||||||||||||||
|
Insert new column with label from UNICODE* string.
|
|
||||||||||||||||||||||||
|
Insert new column with label from resource or ASCII string.
|
|
||||||||||||
|
Insert new item at specified position with Unicode string.
|
|
||||||||||||||||
|
Insert new item at specified position from resource or ASCII string.
|
|
|
Insert new item with Unicode string.
|
|
|
Insert new item with Unicode string.
|
|
||||||||||||
|
Insert new item from resource or ASCII string.
|
|
|
Determine if specified item is currently "selected".
|
|
||||||||||||
|
Called when user clicks on label to begin editing.
|
|
||||||||||||||||
|
Called when user clicks on column heading.
|
|
||||||||||||||||
|
Called when user left-clicks on a list item.
|
|
||||||||||||||||
|
Called when user double-left-clicks on a list item.
|
|
|
Called before an item is drawn. Override if you want to do the drawing yourself. Should return true if you did all the drawing. Return false to let the base class draw the item. |
|
||||||||||||||||
|
Called when user clicks on label to begin editing.
|
|
||||||||||||||||
|
Called by list to request information stored by owner rather than list. Derived implementation should return true if it actually filled in anything. Return false to behave as if OnGetDispInfo wasn't overridden. |
|
|
Called when an item is "activated" (normally via a double click).
|
|
||||||||||||||||||||
|
Called by SortItems() to compare items. Should return < 0 if rowitem1 should precede rowitem2 and > 0 if rowitem1 should follow rowitem2 and 0 if the two items are equivalent. if bAscending is false, you should reverse the order. |
|
||||||||||||
|
Called by SortItems() to compare items. Should return < 0 if rowitem1 should precede rowitem2 and > 0 if rowitem1 should follow rowitem2 and 0 if the two items are equivalent. XXX DEPRECATED. Don't override this, override the one that takes a column number and direction |
|
||||||||||||
|
Called when an item is "selected".
|
|
||||||||||||
|
Called when an item is "unselected".
|
|
||||||||||||
|
Called for owner-data list to provide hints about what to cache.
|
|
||||||||||||||||||||
|
Called when user right-clicks on a list item.
|
|
|
Force the control to repaint all items.
|
|
||||||||||||||||
|
Force the control to repaint a range of items.
|
|
||||||||||||
|
Set column label.
|
|
|
Set the order of columns within the list.
|
|
||||||||||||
|
Set the width of a column. The width can be in pixels or one of the constants LVSCW_AUTOSIZE or LVSCW_AUTOSIZE_USE_HEADER as described in LVM_SETCOLUMNWIDTH in the Platform SDK documentation. |
|
||||||||||||
|
Set extended styles. (MFC version only).
|
|
||||||||||||||||
|
Set image list.
|
|
|
Set number of items in list.
|
|
||||||||||||
|
Set application-specific data to associate with list item.
|
|
||||||||||||
|
Set the image index to use for a givem item. This only handles column 0, and currently only for MFC Pass -1 for imageindex to have no icon imageindex is a 0-based index into the IMAGELIST set via SetImageList() |
|
||||||||||||
|
Set whether item is 'selected or not.
|
|
||||||||||||||||
|
Set item or subitem text from Unicode string.
|
|
||||||||||||||||||||
|
Set item or subitem text from resource or ASCII string.
|
|
||||||||||||
|
Sort the data in the list on a given column.
|
|
|
Force the control to repaint a specified item.
|
1.3.8-20040913