MGUI::FORM_LIST Class Reference

List control. More...

#include <mgui/formlist.h>

Inheritance diagram for MGUI::FORM_LIST:
Inheritance graph
[legend]

List of all members.

Classes

class  CUSTOMDRAW
 Passed to delegate for OnDrawItem(). More...
class  DISPINFO
 Structure passed to delegate for OnGetDispInfo. More...

Public Types

enum  COLORUSE {
  COLORUSE_HeadingBackground = 0, COLORUSE_HeadingText, COLORUSE_HeadingSeparator, COLORUSE_HeadingShadowDark,
  COLORUSE_HeadingShadowLight, COLORUSE_ItemBackgroundNormal, COLORUSE_ItemBackgroundSelected, COLORUSE_ItemTextNormal,
  COLORUSE_ItemTextSelected, COLORUSE_ItemSeparator, COLORUSE_FieldSeparator, COLORUSE_ColumnSeparator,
  COLORUSE_COUNT
}
typedef
fastdelegate::FastDelegate
< int(int itemnum1, int
itemnum2, int fieldnum)> 
DELEGATE_ONCOMPARE
typedef
fastdelegate::FastDelegate
< bool(CUSTOMDRAW &customdraw)> 
DELEGATE_ONCUSTOMDRAW
typedef
fastdelegate::FastDelegate
< bool(int itemnum, int
fieldnum, MISTRING &)> 
DELEGATE_ONEDIT
typedef
fastdelegate::FastDelegate
< bool(int itemnum, int
fieldnum)> 
DELEGATE_ONFIELD
typedef
fastdelegate::FastDelegate
< void(int itemnum, int
fieldnum, DISPINFO &)> 
DELEGATE_ONGETDISPINFO
typedef
fastdelegate::FastDelegate
< bool(int itemnum, int
fieldnum, const MGUI::POINT
&, MGUI::KEYSTATE,
MGUI::KEYCODE)> 
DELEGATE_ONKEY
typedef
fastdelegate::FastDelegate
< bool(int itemnum, int
fieldnum, const MGUI::POINT
&, MGUI::POINTERBUTTON,
MGUI::KEYSTATE)> 
DELEGATE_ONPOINTER
typedef
fastdelegate::FastDelegate
< void(int width, int height)> 
DELEGATE_ONSIZE
typedef
fastdelegate::FastDelegate
< bool(int itemnum, int
fieldnum, MGUI::CTRL_TOOLTIP &)> 
DELEGATE_ONTOOLTIP
typedef
fastdelegate::FastDelegate
< bool(int itemnum, int
fieldnum, MGUI::CTRL_TOOLTIP
&, const MGUI::POINT &)> 
DELEGATE_ONTOOLTIPPOINT
enum  EDITMODE { EDITMODE_InsertEnd, EDITMODE_SelectAll, EDITMODE_Clear }
enum  ENSUREVISIBLE {
  ENSUREVISIBLE_ScrollMinimum = 0, ENSUREVISIBLE_Beginning = 1, ENSUREVISIBLE_NearBeginning = 2, ENSUREVISIBLE_NearEnd = 3,
  ENSUREVISIBLE_End = 4, ENSUREVISIBLE_PartialOK = 9
}
enum  FIELDSTYLE {
  FIELDSTYLE_AlignLeft = 0x0000, FIELDSTYLE_AlignRight = 0x0001, FIELDSTYLE_AlignCenter = 0x0002, FIELDSTYLE_AlignMask = 0x0003,
  FIELDSTYLE_AllowEdit = 0x0004, FIELDSTYLE_NoSort = 0x0008, FIELDSTYLE_NoResize = 0x0010, FIELDSTYLE_NoShowHide = 0x0020,
  FIELDSTYLE_InitHidden = 0x0100, FIELDSTYLE_InitSortDescending = 0x0200, FIELDSTYLE_IconTextRight = 0x0400, FIELDSTYLE_IconRight = 0x0800
}
enum  FIELDWIDTH { FIELDWIDTH_HeadingOnly = 0, FIELDWIDTH_HeadingAndData = -1, FIELDWIDTH_DataOnly = -2, FIELDWIDTH_AsAdded = -3 }
enum  LISTSTYLE {
  LISTSTYLE_NoSelect = 0x00000000, LISTSTYLE_SelectSingle = 0x00000001, LISTSTYLE_SelectMulti = 0x00000002, LISTSTYLE_WidthInPixels = 0x00000004,
  LISTSTYLE_HeightInPixels = 0x00000008, LISTSTYLE_UseCommonBackground = 0x00000010, LISTSTYLE_NoFrame = 0x00000020, LISTSTYLE_NoHeading = 0x00000040,
  LISTSTYLE_NoScrollH = 0x00000080, LISTSTYLE_NoScrollV = 0x00000100, LISTSTYLE_NoScrollBars = LISTSTYLE_NoScrollH | LISTSTYLE_NoScrollV, LISTSTYLE_NoSort = 0x00000200,
  LISTSTYLE_NoToolTips = 0x00000400, LISTSTYLE_UseIcons = 0x00000800, LISTSTYLE_ShowItemSeparators = 0x00001000, LISTSTYLE_ShowFieldSeparators = 0x00002000,
  LISTSTYLE_ShowColumnSeparators = 0x00004000, LISTSTYLE_UseSelectButtons = 0x00008000, LISTSTYLE_AllowReorderFields = 0x00010000, LISTSTYLE_AllowShowHideFields = 0x00020000,
  LISTSTYLE_NoSaveWidth = 0x00040000, LISTSTYLE_NoSaveHeight = 0x00080000, LISTSTYLE_NoSaveSize = LISTSTYLE_NoSaveWidth | LISTSTYLE_NoSaveHeight, LISTSTYLE_NoMultiColumn = 0x00100000,
  LISTSTYLE_ToggleSelect = 0x00200000, LISTSTYLE_AllowMultiColumnDetails = 0x00400000, LISTSTYLE_NoFitToContent = 0x00800000
}
enum  VIEWMODE { VIEWMODE_List = 0, VIEWMODE_Details = 1, VIEWMODE_COUNT }

Public Member Functions

 FORM_LIST ()
virtual ~FORM_LIST ()
int AddField (const MISTRING &label, FIELDSTYLE style=FIELDSTYLE_AlignLeft, int DisplayWidth=FIELDWIDTH_HeadingOnly, const char *IniKey=0)
int AppendItem (const MISTRING &string)
void ComputeFieldDisplayWidth (int fieldnum, FIELDWIDTH mode)
bool ComputeRelativePoint (int itemnum, int fieldnum, const MGUI::POINT &ptCanvas, MGUI::POINT &ptRelative) const
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, int height, int width, LISTSTYLE style=LISTSTYLE_NoSelect, VIEWMODE ViewMode=VIEWMODE_Details, MGUI::LAYOUT_SIZEALIGN sizealign=MGUI::LAYOUT_SIZEALIGN_Expand)
void DeleteAllFields ()
void DeleteAllItems ()
void DeleteField (int fieldnum)
void DeleteItem (int itemnum)
void DeleteItemByID (ID id)
void DeselectAllItems (bool notify=true)
bool DlgShowHideFields (MDLGPARENT dlgparent)
bool EditItem (int itemnum, int fieldnum, EDITMODE editmode=EDITMODE_InsertEnd)
void EnsureVisible (int itemnum, int fieldnum=-1, ENSUREVISIBLE mode=ENSUREVISIBLE_ScrollMinimum)
int FindItemByID (const void *id) const
int FindItemByID (ID id) const
void FlashItem (int itemnum, int numtimes=1) const
const COLORGetColor (COLORUSE use) const
int GetFieldCount () const
void GetFieldDisplayOrderDetails (SIMPLE_ARRAY< int > &DisplayOrder) const
int GetFieldDisplayWidth (int fieldnum) const
MISTRING GetFieldLabel (int fieldnum) const
int GetFirstVisibleItem () const
int GetItemCount () const
MGUI::ID GetItemID (int itemnum) const
MISTRING GetItemText (int itemnum, int fieldnum) const
MGUI::CTRLGetMenuParent () const
int GetNextSelectedItem (int startitem=-1) const
int GetNumVisibleRows () const
int GetRowHeight () const
int GetSelectedCount () const
const LPOINT2DGetSize () const
bool HasSorted () const
bool HasSortFields () const
int InsertItem (int pos, const MISTRING &string)
bool IsFieldSortAscending (int fieldnum) const
bool IsFieldVisible (int fieldnum, VIEWMODE ViewMode=VIEWMODE_COUNT) const
bool IsItemSelected (int itemnum) const
void LockLayout (FORM_LIST &ListLockTo)
void Redraw ()
void RedrawDisable ()
void RedrawEnable ()
void RedrawItem (int itemnum)
void RedrawItems (int firstitemnum, int lastitemnum)
void SaveLayout () const
void SetColor (COLORUSE use, const COLOR &color)
void SetDelegateOnChangeLayout (DELEGATE_VOID_NOPARMS delegate)
void SetDelegateOnChangeOrder (DELEGATE_VOID_NOPARMS delegate)
void SetDelegateOnChangeSelection (DELEGATE_VOID_INT32 delegate)
void SetDelegateOnCompare (DELEGATE_ONCOMPARE delegate)
void SetDelegateOnDrawItem (DELEGATE_ONCUSTOMDRAW delegate)
void SetDelegateOnEditBegin (DELEGATE_ONEDIT delegate)
void SetDelegateOnEditCancel (DELEGATE_ONFIELD delegate)
void SetDelegateOnEditEnd (DELEGATE_ONEDIT delegate)
void SetDelegateOnFieldCompare (int fieldnum, DELEGATE_ONCOMPARE delegate)
void SetDelegateOnGetDispInfo (DELEGATE_ONGETDISPINFO delegate)
void SetDelegateOnKeyPress (DELEGATE_ONKEY delegate)
void SetDelegateOnLeftButtonDoubleClick (DELEGATE_ONPOINTER delegate)
void SetDelegateOnPointerButtonDown (DELEGATE_ONPOINTER delegate)
void SetDelegateOnPointerButtonUp (DELEGATE_ONPOINTER delegate)
void SetDelegateOnSize (DELEGATE_ONSIZE delegate)
void SetDelegateOnToolTip (DELEGATE_ONTOOLTIP delegate)
void SetDelegateOnToolTipPoint (DELEGATE_ONTOOLTIPPOINT delegate)
void SetFieldDisplayOrderDetails (const SIMPLE_ARRAY< int > &FieldOrder)
void SetFieldDisplayWidth (int fieldnum, int width)
void SetFieldLabel (int fieldnum, const MISTRING &label)
void SetFieldVisible (int fieldnum, bool visible)
void SetIconSize (int IconSize)
void SetIniKey (const char *IniKey, const char *IniGroup=0)
ERRVALUE SetItemCount (int NumItems)
ERRVALUE SetItemIcon (int itemnum, ICONID iconid)
ERRVALUE SetItemID (int itemnum, ID id)
void SetItemSelected (int itemnum, bool selected=true, bool notify=true)
void SetItemText (int itemnum, int fieldnum, const MISTRING &string)
void SetRowHeight (int RowHeight, VIEWMODE ViewMode=VIEWMODE_List)
void SetViewMode (VIEWMODE ViewMode)
void Sort (const SIMPLE_ARRAY< int > &FieldNums, const SIMPLE_ARRAY< bool > &FieldsAscending)
void Sort (int fieldnum, bool bAscending=true)
void Sort ()

Detailed Description

List control.

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.


Member Typedef Documentation

typedef fastdelegate::FastDelegate<int(int itemnum1, int itemnum2, int fieldnum)> MGUI::FORM_LIST::DELEGATE_ONCOMPARE

Delegate to compare for sorting.

Return < 0 if item1 before item2, > 0 if item1 after item 2.

typedef fastdelegate::FastDelegate<bool(CUSTOMDRAW& customdraw)> MGUI::FORM_LIST::DELEGATE_ONCUSTOMDRAW

Delegate for custom drawing of item/field.

Return true if did all the drawing, false if not.

typedef fastdelegate::FastDelegate<bool(int itemnum, int fieldnum, MISTRING&)> MGUI::FORM_LIST::DELEGATE_ONEDIT

Delegate for item/field editing.

Return true if editing allowed/accepted, false if not.

typedef fastdelegate::FastDelegate<bool(int itemnum, int fieldnum)> MGUI::FORM_LIST::DELEGATE_ONFIELD

Delegate for item/field. Used for OnEditCancel.

typedef fastdelegate::FastDelegate<void(int itemnum, int fieldnum, DISPINFO&)> MGUI::FORM_LIST::DELEGATE_ONGETDISPINFO

Delegate to get display information for item/field.

typedef fastdelegate::FastDelegate<bool(int itemnum, int fieldnum, const MGUI::POINT&, MGUI::KEYSTATE, MGUI::KEYCODE)> MGUI::FORM_LIST::DELEGATE_ONKEY

Delegate for Key presses.

Should return true if keypress handled, false if not.

typedef fastdelegate::FastDelegate<bool(int itemnum, int fieldnum, const MGUI::POINT&, MGUI::POINTERBUTTON, MGUI::KEYSTATE)> MGUI::FORM_LIST::DELEGATE_ONPOINTER

Delegate for pointer messages.

Delegate should return 'true' if handled message, 'false' to continue with default handling.

typedef fastdelegate::FastDelegate<void(int width, int height)> MGUI::FORM_LIST::DELEGATE_ONSIZE

Delegate for control resize.

typedef fastdelegate::FastDelegate<bool(int itemnum, int fieldnum, MGUI::CTRL_TOOLTIP&)> MGUI::FORM_LIST::DELEGATE_ONTOOLTIP

Delegate to get tooltip for item/field.

typedef fastdelegate::FastDelegate<bool(int itemnum, int fieldnum, MGUI::CTRL_TOOLTIP&, const MGUI::POINT&)> MGUI::FORM_LIST::DELEGATE_ONTOOLTIPPOINT

Delegate to get tooltip for item/field with canvas point.


Member Enumeration Documentation

Enumeration of colors that can be set.

Enumerator:
COLORUSE_HeadingBackground 
COLORUSE_HeadingText 
COLORUSE_HeadingSeparator 
COLORUSE_HeadingShadowDark 
COLORUSE_HeadingShadowLight 
COLORUSE_ItemBackgroundNormal 
COLORUSE_ItemBackgroundSelected 
COLORUSE_ItemTextNormal 
COLORUSE_ItemTextSelected 
COLORUSE_ItemSeparator 
COLORUSE_FieldSeparator 
COLORUSE_ColumnSeparator 
COLORUSE_COUNT 

Mode for starting edit of item field.

Enumerator:
EDITMODE_InsertEnd 

Don't select any text, insert at end.

EDITMODE_SelectAll 

Select all text.

EDITMODE_Clear 

Clear text to start editing.

Enumerator:
ENSUREVISIBLE_ScrollMinimum 
ENSUREVISIBLE_Beginning 
ENSUREVISIBLE_NearBeginning 
ENSUREVISIBLE_NearEnd 
ENSUREVISIBLE_End 
ENSUREVISIBLE_PartialOK 

Field styles, specified in AddField().

Enumerator:
FIELDSTYLE_AlignLeft 

Left-align text (default).

FIELDSTYLE_AlignRight 

Right-align text.

FIELDSTYLE_AlignCenter 

Center text in column.

FIELDSTYLE_AlignMask 

Mask for selecting alignment from style.

FIELDSTYLE_AllowEdit 

Allow user edit of field value.

FIELDSTYLE_NoSort 

Don't allow sorting on this field.

FIELDSTYLE_NoResize 

Don't allow resize.

FIELDSTYLE_NoShowHide 

Don't allow user to show/hide this field, only applies if LISTSTYLE_AllowShowHideFields set.

FIELDSTYLE_InitHidden 

Field initially hidden by default.

FIELDSTYLE_InitSortDescending 

Initially sort descending if use in sort.

FIELDSTYLE_IconTextRight 

Place icon to immediate right of text.

FIELDSTYLE_IconRight 

Place icon at right side of field.

Modes for ComputeFieldDisplayWidth().

Enumerator:
FIELDWIDTH_HeadingOnly 
FIELDWIDTH_HeadingAndData 
FIELDWIDTH_DataOnly 
FIELDWIDTH_AsAdded 

List style, specified in Create().

Enumerator:
LISTSTYLE_NoSelect 

Don't allow selection by user (default).

LISTSTYLE_SelectSingle 

Allow single selection.

LISTSTYLE_SelectMulti 

Allow multiple selection.

LISTSTYLE_WidthInPixels 

Width specified in pixels.

LISTSTYLE_HeightInPixels 

Height specified in pixels.

LISTSTYLE_UseCommonBackground 

Use common control background color instead of default white.

LISTSTYLE_NoFrame 

Don't include outer frame.

LISTSTYLE_NoHeading 

Don't show headings.

LISTSTYLE_NoScrollH 

Don't show horizontal scrollbar.

LISTSTYLE_NoScrollV 

Don't show vertical scrollbar.

LISTSTYLE_NoScrollBars 

Don't show any scrollbars.

LISTSTYLE_NoSort 

Don't allow sorting on any field.

LISTSTYLE_NoToolTips 

Don't show any tooltips.

LISTSTYLE_UseIcons 

Include space for icons when drawing (applies to field 0 only).

LISTSTYLE_ShowItemSeparators 

Show separators between items.

LISTSTYLE_ShowFieldSeparators 

Show separators between fields in VIEWMODE_Details.

LISTSTYLE_ShowColumnSeparators 

Show separators between "columns" in multi-column mode.

LISTSTYLE_UseSelectButtons 

Use buttons at left for selection.

LISTSTYLE_AllowReorderFields 

Allow field reorder by dragging column heading.

LISTSTYLE_AllowShowHideFields 

Allow user to show/hide fields.

LISTSTYLE_NoSaveWidth 

Don't read/write width from ini file.

LISTSTYLE_NoSaveHeight 

Don't read/write height from ini file.

LISTSTYLE_NoSaveSize 

Don't read/write size from ini file.

LISTSTYLE_NoMultiColumn 

Don't allow multi-column layout.

LISTSTYLE_ToggleSelect 

Toggle "selected" on normal left-click for LISTSTYLE_SelectMulti.

LISTSTYLE_AllowMultiColumnDetails 

Allow multi-column arrangement in "details" mode.

LISTSTYLE_NoFitToContent 

Don't allow "fit to content" (used for large "owner-data" lists).

Enumerator:
VIEWMODE_List 

Only show first subitem for each item in multi-column arrangement.

VIEWMODE_Details 

Show in "grid" arrangement with each subitem in own column.

VIEWMODE_COUNT 

Constructor & Destructor Documentation

MGUI::FORM_LIST::FORM_LIST (  ) 

Constructor.

virtual MGUI::FORM_LIST::~FORM_LIST (  )  [virtual]

Destructor.


Member Function Documentation

int MGUI::FORM_LIST::AddField ( const MISTRING label,
FIELDSTYLE  style = FIELDSTYLE_AlignLeft,
int  DisplayWidth = FIELDWIDTH_HeadingOnly,
const char *  IniKey = 0 
)

Add field to control.

May be called before or after Create. If used before Create() then may pass -1 for width in Create to automatically compute width to show all visible fieldnums in Report mode.

Returns:
fieldnum index.
Parameters:
label Label / column heading
style Field style
DisplayWidth Display width in pixels, or FIELDWIDTH enum.
IniKey Key for saving settings, NULL if not saveable (ie, can't be changed)
int MGUI::FORM_LIST::AppendItem ( const MISTRING string  ) 

Append item at end of list.

Returns:
Item number of inserted item if successful, < 0 if error.
Parameters:
string String to assign to first field
void MGUI::FORM_LIST::ComputeFieldDisplayWidth ( int  fieldnum,
FIELDWIDTH  mode 
)

Compute and set width of field based on heading and/or data.

See also:
SetFieldDisplayWidth().
Parameters:
fieldnum Field number
mode Mode
bool MGUI::FORM_LIST::ComputeRelativePoint ( int  itemnum,
int  fieldnum,
const MGUI::POINT ptCanvas,
MGUI::POINT ptRelative 
) const

Compute point relative to item/field rectangle.

Returns:
true if canvas point inside field rectangle, false if not.
Parameters:
itemnum Item number
fieldnum Field number
ptCanvas Point on canvas
ptRelative Point relative to item/field rectangle returned
void MGUI::FORM_LIST::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
int  height,
int  width,
LISTSTYLE  style = LISTSTYLE_NoSelect,
VIEWMODE  ViewMode = VIEWMODE_Details,
MGUI::LAYOUT_SIZEALIGN  sizealign = MGUI::LAYOUT_SIZEALIGN_Expand 
)

Create the control.

It is recommended that fields be added before calling Create(). Note that width/height values do not include heading or scrollbars, if any. If a key is provided it will be used to read the size and field order (if fields can be reordered and are already added).

Parameters:
ParentPane Parent pane
height Height of list area in rows or pixels if LISTSTYLE_HeightInPixels
width Width of list area in 'em' characters or pixels if LISTSTYLE_WidthInPixels, -1 to compute if fields already added
style List style
ViewMode Initial viewing mode
void MGUI::FORM_LIST::DeleteAllFields (  ) 

Delete all fields.

void MGUI::FORM_LIST::DeleteAllItems (  )  [inline]

Delete all items.

void MGUI::FORM_LIST::DeleteField ( int  fieldnum  ) 

Delete specified field.

Note that first field cannot be deleted.

void MGUI::FORM_LIST::DeleteItem ( int  itemnum  ) 

Delete specified item.

void MGUI::FORM_LIST::DeleteItemByID ( ID  id  )  [inline]

Delete specified item given assigned data value.

void MGUI::FORM_LIST::DeselectAllItems ( bool  notify = true  ) 

Deselect all items.

bool MGUI::FORM_LIST::DlgShowHideFields ( MDLGPARENT  dlgparent  ) 

Open dialog to allow user to choose fields to show/hide.

Returns:
true if changed, false if not.
bool MGUI::FORM_LIST::EditItem ( int  itemnum,
int  fieldnum,
EDITMODE  editmode = EDITMODE_InsertEnd 
)

Begin editing specified item field.

Returns:
true if successful, false if not.
Parameters:
editmode Mode to start editing item
void MGUI::FORM_LIST::EnsureVisible ( int  itemnum,
int  fieldnum = -1,
ENSUREVISIBLE  mode = ENSUREVISIBLE_ScrollMinimum 
)

Scroll list to ensures that an item is visible.

int MGUI::FORM_LIST::FindItemByID ( const void *  id  )  const [inline]

Find item by matching specified data value as pointer.

Returns:
Item number or -1 if none found.
int MGUI::FORM_LIST::FindItemByID ( ID  id  )  const

Find item by matching specified data value as ID.

Returns:
Item number or -1 if none found.
void MGUI::FORM_LIST::FlashItem ( int  itemnum,
int  numtimes = 1 
) const

Flash item in list.

const COLOR& MGUI::FORM_LIST::GetColor ( COLORUSE  use  )  const

Get color used in interface.

int MGUI::FORM_LIST::GetFieldCount (  )  const

Get number of fields in the list.

void MGUI::FORM_LIST::GetFieldDisplayOrderDetails ( SIMPLE_ARRAY< int > &  DisplayOrder  )  const

Get field display order in "details" mode.

int MGUI::FORM_LIST::GetFieldDisplayWidth ( int  fieldnum  )  const

Get the width to display field in pixels.

MISTRING MGUI::FORM_LIST::GetFieldLabel ( int  fieldnum  )  const

Get the label for a field.

Returns:
true if successful, false otherwise
int MGUI::FORM_LIST::GetFirstVisibleItem (  )  const

Get first visible item number.

int MGUI::FORM_LIST::GetItemCount (  )  const

Get number of items in list.

MGUI::ID MGUI::FORM_LIST::GetItemID ( int  itemnum  )  const

Get data value associated with item.

MISTRING MGUI::FORM_LIST::GetItemText ( int  itemnum,
int  fieldnum 
) const

Get text assigned to item/field.

MGUI::CTRL& MGUI::FORM_LIST::GetMenuParent (  )  const

Get parent for popup menu.

int MGUI::FORM_LIST::GetNextSelectedItem ( int  startitem = -1  )  const

Get next selected item in list.

Returns:
Index of next item or -1 if no more items.
Parameters:
startitem Starting item for search, starting item is excluded
int MGUI::FORM_LIST::GetNumVisibleRows (  )  const

Get number of visible rows.

int MGUI::FORM_LIST::GetRowHeight (  )  const

Get height of row.

int MGUI::FORM_LIST::GetSelectedCount (  )  const

Get number of selected items.

const LPOINT2D& MGUI::FORM_LIST::GetSize (  )  const

Get size.

bool MGUI::FORM_LIST::HasSorted (  )  const

Determine if list has been sorted.

Typically used after adding items to determine if should sort.

bool MGUI::FORM_LIST::HasSortFields (  )  const

Determine if has specified fields to sort on.

int MGUI::FORM_LIST::InsertItem ( int  pos,
const MISTRING string 
)

Insert item at specified position.

Returns:
Item number of inserted item if successful, < 0 if error.
Parameters:
pos Item position in list
string String to assign to first field
bool MGUI::FORM_LIST::IsFieldSortAscending ( int  fieldnum  )  const

Determine if field is sorted ascending or not.

Can be used for specialized sorting behaviors.

bool MGUI::FORM_LIST::IsFieldVisible ( int  fieldnum,
VIEWMODE  ViewMode = VIEWMODE_COUNT 
) const

Determine if field is visible in specified or current viewing mode.

Parameters:
ViewMode Viewing mode, VIEWMODE_COUNT to use current
bool MGUI::FORM_LIST::IsItemSelected ( int  itemnum  )  const

Determine if specified item is currently "selected".

Returns:
'true' if selected, 'false' if not.
void MGUI::FORM_LIST::LockLayout ( FORM_LIST ListLockTo  ) 

Lock layout to another list.

Any number of lists can be locked together. Changes to layout for one (field reorder, sizing, visibility) will affect all other locked lists. Sizing a field to content will affect all lists.

void MGUI::FORM_LIST::Redraw (  ) 

Redraw all items.

void MGUI::FORM_LIST::RedrawDisable (  ) 

Disable redraw, incrementing disable count.

void MGUI::FORM_LIST::RedrawEnable (  ) 

Enable redraw, decrementing disable count.

Will redraw control if was disabled and is no longer.

void MGUI::FORM_LIST::RedrawItem ( int  itemnum  ) 

Redraw specified item.

void MGUI::FORM_LIST::RedrawItems ( int  firstitemnum,
int  lastitemnum 
)

Redraw range of items.

void MGUI::FORM_LIST::SaveLayout (  )  const

Save layout to Ini file based on keys previously provided in AddField and Create.

void MGUI::FORM_LIST::SetColor ( COLORUSE  use,
const COLOR color 
)

Set color to use in interface.

Note that non-background colors can include a transparency setting that will be used to blend with any previously set or default background color. If the background color is changed after any blending is done the previously blended color will be retained.

Parameters:
use Color use
color Color to set
void MGUI::FORM_LIST::SetDelegateOnChangeLayout ( DELEGATE_VOID_NOPARMS  delegate  ) 

Set delegate to call when some aspect of layout (column order, width, visibility etc) is changed.

void MGUI::FORM_LIST::SetDelegateOnChangeOrder ( DELEGATE_VOID_NOPARMS  delegate  ) 

Set delegate to call when order of items in list is changed.

void MGUI::FORM_LIST::SetDelegateOnChangeSelection ( DELEGATE_VOID_INT32  delegate  ) 

Set delegate to call when selected items changed.

If a specific item was used to initiate the change, either as part of a single or multiple selection action it will be passed to the delegate, otherwise -1 will be passed. The item passed may or may not be "selected" depending on the user action performed.

void MGUI::FORM_LIST::SetDelegateOnCompare ( DELEGATE_ONCOMPARE  delegate  ) 

Set delegate for comparing field from two items to use in sorting.

Will only be used if no specific delegate set for field being compared.

void MGUI::FORM_LIST::SetDelegateOnDrawItem ( DELEGATE_ONCUSTOMDRAW  delegate  ) 

Set delegate for customized drawing.

void MGUI::FORM_LIST::SetDelegateOnEditBegin ( DELEGATE_ONEDIT  delegate  ) 

Set delegate to call before editing item/field.

void MGUI::FORM_LIST::SetDelegateOnEditCancel ( DELEGATE_ONFIELD  delegate  ) 

Set delegate to call for editing item/field cancel.

void MGUI::FORM_LIST::SetDelegateOnEditEnd ( DELEGATE_ONEDIT  delegate  ) 

Set delegate to call after editing item/field.

void MGUI::FORM_LIST::SetDelegateOnFieldCompare ( int  fieldnum,
DELEGATE_ONCOMPARE  delegate 
)

Set delegate for comparing field from two items to use in sorting.

Parameters:
fieldnum Field number to set delegate for
void MGUI::FORM_LIST::SetDelegateOnGetDispInfo ( DELEGATE_ONGETDISPINFO  delegate  ) 

Set delegate to get display information for item/field.

void MGUI::FORM_LIST::SetDelegateOnKeyPress ( DELEGATE_ONKEY  delegate  ) 

Set the delegate to call on a key press.

void MGUI::FORM_LIST::SetDelegateOnLeftButtonDoubleClick ( DELEGATE_ONPOINTER  delegate  ) 

Set delegate for double-click of left pointer button on item/field.

void MGUI::FORM_LIST::SetDelegateOnPointerButtonDown ( DELEGATE_ONPOINTER  delegate  ) 

Set the delegate to call on pointer button down Delegate should return 'true' to accept the default behavior.

void MGUI::FORM_LIST::SetDelegateOnPointerButtonUp ( DELEGATE_ONPOINTER  delegate  ) 

Set the delegate to call on pointer button up Delegate should return 'true' to accept the default behavior.

void MGUI::FORM_LIST::SetDelegateOnSize ( DELEGATE_ONSIZE  delegate  ) 

Set delegate for control resize.

void MGUI::FORM_LIST::SetDelegateOnToolTip ( DELEGATE_ONTOOLTIP  delegate  ) 

Set delegate to get ToolTip.

void MGUI::FORM_LIST::SetDelegateOnToolTipPoint ( DELEGATE_ONTOOLTIPPOINT  delegate  ) 

Set delegate to get ToolTip with canvas point.

void MGUI::FORM_LIST::SetFieldDisplayOrderDetails ( const SIMPLE_ARRAY< int > &  FieldOrder  ) 

Set field display order for "details" mode.

Each field must be listed in the array exactly once and all fields must be listed.

void MGUI::FORM_LIST::SetFieldDisplayWidth ( int  fieldnum,
int  width 
)

Set width of a field for display.

See also:
ComputeFieldDisplayWidth().
Parameters:
width Width in pixels
void MGUI::FORM_LIST::SetFieldLabel ( int  fieldnum,
const MISTRING label 
)

Set field label.

void MGUI::FORM_LIST::SetFieldVisible ( int  fieldnum,
bool  visible 
)

Set whether field column is visible in 'details' mode.

Note that field 0 cannot be hidden

void MGUI::FORM_LIST::SetIconSize ( int  IconSize  ) 

Set size of icons to use.

If used, must be called before Create().

Parameters:
IconSize Icon size
void MGUI::FORM_LIST::SetIniKey ( const char *  IniKey,
const char *  IniGroup = 0 
)

Set INI key and group for read/write settings.

If used, must be done before any fields are added, and before Create.

ERRVALUE MGUI::FORM_LIST::SetItemCount ( int  NumItems  ) 

Set number of items in list.

Parameters:
NumItems Number of items
ERRVALUE MGUI::FORM_LIST::SetItemIcon ( int  itemnum,
ICONID  iconid 
)

Set icon ID to use for a givem item.

Parameters:
itemnum Item number
iconid Icon ID
ERRVALUE MGUI::FORM_LIST::SetItemID ( int  itemnum,
ID  id 
)

Set application-specific data to associate with list item.

Parameters:
itemnum Item number
id Value to associate with item
void MGUI::FORM_LIST::SetItemSelected ( int  itemnum,
bool  selected = true,
bool  notify = true 
)

Set whether item is 'selected or not.

Parameters:
itemnum Item number
void MGUI::FORM_LIST::SetItemText ( int  itemnum,
int  fieldnum,
const MISTRING string 
)

Set item/field text.

Parameters:
itemnum Item number
fieldnum Sub item, 0 for item
string Item or fieldnum string
void MGUI::FORM_LIST::SetRowHeight ( int  RowHeight,
VIEWMODE  ViewMode = VIEWMODE_List 
)

Set row height.

Parameters:
RowHeight Row height in pixels
void MGUI::FORM_LIST::SetViewMode ( VIEWMODE  ViewMode  ) 

Set viewing mode.

void MGUI::FORM_LIST::Sort ( const SIMPLE_ARRAY< int > &  FieldNums,
const SIMPLE_ARRAY< bool > &  FieldsAscending 
)

Sort data in the list using specified fields.

Parameters:
FieldNums Fields to sort on
FieldsAscending Whether field should be sorted in ascending or descending order
void MGUI::FORM_LIST::Sort ( int  fieldnum,
bool  bAscending = true 
)

Sort the data in the list on a given field.

This will move the specified field to the front of the list of fields to sort on.

Parameters:
fieldnum Field to sort on
void MGUI::FORM_LIST::Sort (  ) 

Sort the data in the list using same order as previous.

This is useful if items have been added to the list. If no previous sort has been performed the items are sorted using the first sortable field(s).


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:36:02 2012 for TNTsdk 2012 by  doxygen 1.6.1