MIGRIDCTRL Class Reference

! More...

#include <mi32/migrid.h>

List of all members.

Classes

struct  SORTDATA

Public Types

enum  CELLSTATE { CELLSTATE_None = 0x0000, CELLSTATE_Button = 0x0001, CELLSTATE_Shift = 0x0002, CELLSTATE_Control = 0x0004 }
enum  MOVEMENT {
  MOVE_Increment = 0, MOVE_Decrement, MOVE_PageUp, MOVE_PageDown,
  MOVE_Top, MOVE_Bottom
}
enum  SCROLLMODE { SCROLLMODE_Normal, SCROLLMODE_Tracking }
enum  SECTION {
  SECTION_None = 0, SECTION_Grid = 1, SECTION_TopHeading, SECTION_SideHeading,
  SECTION_CornerButton, SECTION_HScroll, SECTION_VScroll, SECTION_Tab,
  SECTION_ColBorder, SECTION_RowBorder
}

Public Member Functions

 MIGRIDCTRL ()
virtual ~MIGRIDCTRL ()
MIGRIDCELL::CELLTYPE AddCellType (MIGRIDCELLTYPE *ptype, bool bDeleteInGridsDestructor=false)
int AppendCol ()
int AppendRow ()
int ClearSelections ()
int Create (Widget parent, Arg *arg, int n)
void DeleteAllItems ()
int DeleteCol (int col)
void DeleteItem (int row)
int DeleteRow (int row)
int EditCancel ()
void EditFinish (int col, int row, const MIGRIDCELL &cell)
void EditFinish (MIGRIDEDITHANDLE *handle=NULL, bool bAborting=false)
int EnableColSwapping (bool bEnable=true)
int EnableMenu (bool bEnable=true)
void EnableUpdate (bool enable=true)
void EnsureVisible (int row, int col, bool bPartialOK=false)
int FindItemByData (const void *data) const
int FindItemByData (PTRINT data) const
int GetAbsoluteCellFromPoint (int x, int y, int *ptcol, int *ptrow) const
int GetBottomRow () const
int GetCell (int col, int row, MIGRIDCELL **ppCell) const
int GetCell (int col, int row, MIGRIDCELL *pCell) const
int GetCellIndirect (int col, int row, MIGRIDCELL *pCell, MIGRIDCELL::PROPERTY properties=MIGRIDCELL::PROP_All)
int GetCellRect (int col, int row, LRECT2D *rect) const
int GetColDefault (int col, MIGRIDCELL *pCell) const
int GetColTranslation (int VisualColumnNumber) const
ERRVALUE GetColumnOrderArray (SIMPLE_ARRAY< INT32 > &) const
int GetColumnWidth (int col) const
int GetColWidth (int col) const
int GetColWidth (int col, int *width) const
int GetCountPerPage () const
int GetCurrentCol () const
int GetCurrentRow () const
int GetCurrentTab () const
Widget GetDA (int col, int row) const
MGD::CONTEXTGetDAGC (int col, int row) const
Widget GetForm () const
MGD::CONTEXTGetGC (int col, int row) const
int GetGridDefault (MIGRIDCELL *pCell) const
int GetHeadingDefault (MIGRIDCELL *pCell) const
int GetHSHeight () const
const MGUI::IMAGELISTGetImageList () const
int GetItemCount () const
PTRUINT GetItemData (int row, int col=0) const
void * GetItemDataPtr (int row, int col=0) const
int GetLeftCol () const
int GetNextSelectedItem (int row) const
int GetNumberCols () const
int GetNumberRows () const
int GetRightCol () const
int GetRowHeight (int row) const
int GetSelectedCount () const
const SIMPLE_ARRAY< LPOINT2D > & GetSelectedItems () const
int GetSideHeadingWidth () const
void GetSize (LPOINT2D &size) const
int GetTopHeadingHeight () const
int GetTopRow () const
int GetVSWidth () const
int GotoCell (int col, int row)
int GotoCol (int col)
int GotoRow (int row)
int HideCurrentCell ()
int InsertCol (int col)
int InsertColumn (int col, const MIUNICODE *string, MIGRIDCELL::ALIGNMENT alignment, int width=-1)
int InsertRow (int row)
bool IsSelected (int col, int row) const
int LockColumns (int cols)
int LockRows (int rows)
int MoveColPosition (int fromCol, int toCol, bool insertBefore)
int MoveCurrentCol (MOVEMENT movement)
int MoveCurrentRow (MOVEMENT movement)
int RedrawAll ()
int RedrawCell (int col, int row)
int RedrawCol (int col)
int RedrawRow (int row)
int Select (int col, int row)
int SelectRange (int startcol, int startrow, int endcol, int endrow)
int Set3DHeight (int height)
int SetBallisticDelay (int millsec)
int SetCell (int col, int row, const MIGRIDCELL &pCell)
int SetColDefault (int col, const MIGRIDCELL &Cell)
int SetColTranslation (int VisualColumnNumber, int RealColumnNumber)
int SetColWidth (int col, int width)
int SetDefColWidth (int width)
int SetDefRowHeight (int height)
void SetGCExclusive (MGD::CONTEXT *gc)
int SetGridDefault (const MIGRIDCELL &Cell)
int SetHeadingDefault (const MIGRIDCELL &Cell)
void SetHideFocus (bool hide)
int SetHighlightRow (bool bWholeRow)
int SetHScrollMode (SCROLLMODE mode)
int SetHSHeight (int height)
void SetImageList (MGUI::IMAGELIST *ImageList, bool MakeACopy=true)
void SetItemData (int row, PTRUINT data)
void SetItemData (int row, int col, PTRUINT data)
void SetItemDataPtr (int row, void *data)
void SetItemDataPtr (int row, int col, void *data)
int SetLeftCol (int col)
int SetMargin (int pixels)
int SetMultiSelectMode (bool bEnable)
int SetNumberCols (int cols)
int SetNumberRows (int rows)
int SetRowDefault (int col, const MIGRIDCELL &Cell)
int SetRowHeight (int row, int height)
int SetSideHeadingColWidth (int col, int width)
int SetSideHeadingNumCols (int cols)
int SetSideHeadingWidth (int width)
void SetSize (const LPOINT2D &size)
int SetTopHeadingHeight (int height)
int SetTopHeadingNumRows (int rows)
int SetTopHeadingRowHeight (int row, int height)
int SetTopRow (int row)
int SetUniformRowHeight (bool bUniform)
int SetUserSizingMode (bool bAllowResize)
int SetVScrollMode (SCROLLMODE mode)
int SetVSWidth (int width)
int SortBy (int col, bool bAscending)
int SortBy (int *pCols, int num, bool bAscending)
int StartEdit (int col, int row, int key)
int StartEdit (int key)
int StartEdit ()
int StartMenu (int col, int row, LPOINT2D *point, SECTION section)
void SwapRows (INT32 row1, INT32 row2)
int Unselect (int col, int row)
int UseHints (bool bUseHints=true)
int UseHScrollHints (bool bUseHints=true)
int UseVScrollHints (bool bUseHints=true)
virtual bool v_OnCanColSwap (int fromCol, int toCol)
virtual bool v_OnCanMove (int oldcol, int oldrow, int newcol, int newrow)
virtual bool v_OnCanSizeCol (int col)
virtual bool v_OnCanSizeRow (int row)
virtual bool v_OnCanSizeSideHdg ()
virtual bool v_OnCanSizeTopHdg ()
virtual void v_OnCellChange (int oldcol, int oldrow, int newcol, int newrow)
virtual bool v_OnCellTypeNotify (MIGRIDCELL::CELLTYPE celltype, int col, int row, INT32 msg, CELLSTATE param)
virtual void v_OnColChange (int oldcol, int newcol)
virtual void v_OnColSized (int col, int *width)
virtual void v_OnColSizing (int col, int *width)
virtual void v_OnDClicked (int col, int row, LRECT2D *rect, LPOINT2D *point, bool *pbProcessed, UINT32 state)
virtual bool v_OnDrawItem (int row, int col, MIGRIDCUSTOMDRAW &drawdata)
virtual bool v_OnEditContinue (int oldcol, int oldrow, int *newcol, int *newrow)
virtual bool v_OnEditFinish (int col, int row, const MIGRIDCELL &cell)
virtual bool v_OnEditFinish (int col, int row, MDLGPARENT TextControl, const MIUNICODE *string)
virtual bool v_OnEditStart (int col, int row)
virtual bool v_OnEditVerify (int col, int row, MDLGPARENT TextControl, const MIUNICODE *str)
virtual void v_OnGetCell (int col, int row, MIGRIDCELL *cell, MIGRIDCELL::PROPERTY mask=MIGRIDCELL::PROP_All)
virtual bool v_OnHint (int col, int row, SECTION section, MGUI::CTRL_TOOLTIP &tooltip)
virtual bool v_OnHScrollHint (int col, MISTRING &)
virtual int v_OnItemCompare (UINT32 item1, UINT32 item2, const SORTDATA *sortdata)
virtual bool v_OnItemSelect (int row, int col)
virtual bool v_OnItemUnselect (int row, int col)
virtual void v_OnKillFocus (SECTION section)
virtual void v_OnLClicked (int col, int row, bool bIsMouseDown, LRECT2D *rect, LPOINT2D *point, bool *pbProcessed, UINT32 state)
virtual void v_OnLeftColChange (int oldcol, int newcol)
virtual void v_OnMenuCommand (int col, int row, SECTION section, int item)
virtual bool v_OnMenuStart (int col, int row, SECTION section, MGUI::MENU &menu)
virtual void v_OnRClicked (int col, int row, bool bIsMouseDown, LRECT2D *rect, LPOINT2D *point, bool *pbProcessed, UINT32 state)
virtual void v_OnRowChange (int oldrow, int newrow)
virtual void v_OnRowSized (int row, int *height)
virtual void v_OnRowSizing (int row, int *height)
virtual void v_OnSetCell (int col, int row, MIGRIDCELL *pCell)
virtual void v_OnSetFocus (SECTION section)
virtual void v_OnSetup ()
virtual void v_OnSideHeadingDClicked (int col, int row, LRECT2D *pRect, LPOINT2D *pPoint, bool *pbProcessed)
virtual void v_OnSideHeadingLClicked (int col, int row, bool bIsMouseDown, LRECT2D *pRect, LPOINT2D *pPoint, bool *pbProcessed)
virtual void v_OnSideHeadingRClicked (int col, int row, bool bIsMouseDown, LRECT2D *pRect, LPOINT2D *pPoint, bool *pbProcessed)
virtual void v_OnSize (int ntype, int width, int height)
virtual void v_OnTopHeadingDClicked (int col, int row, LRECT2D *pRect, LPOINT2D *pPoint, bool *pbProcessed)
virtual void v_OnTopHeadingLClicked (int col, int row, bool bIsMouseDown, LRECT2D *pRect, LPOINT2D *pPoint, bool *pbProcessed)
virtual void v_OnTopHeadingRClicked (int col, int row, bool bIsMouseDown, LRECT2D *pRect, LPOINT2D *pPoint, bool *pbProcessed)
virtual bool v_OnVScrollHint (int row, MISTRING &)

Static Public Member Functions

static void Test (DBEDIT *ddata, DBEDIT_TDATA *tdata)

Detailed Description

!

The MIGRIDCTRL API is based on the UltimateGrid control from Dundas software. MIGRIDCTRL tries to emulate as much of the UltimateGrid as possible. One of the design goals for writing this was to make it possible to write X code using MIGRIDCTRL and later port it to MFC by substituting the control from Dundas. Some of the control creation will have to change, but a lot of it will be the same. (This is why some of the methods don't follow standard MicroImages naming standards and abbreviations)


Member Enumeration Documentation

States for OnCellTypeNotify.

Enumerator:
CELLSTATE_None 

No state falgs set.

CELLSTATE_Button 

Button (GUI componant) is "on".

CELLSTATE_Shift 

Shift key is held down.

CELLSTATE_Control 

Control key is held down.

Values for MoveCurrentRow/MoveCurrentCol.

Enumerator:
MOVE_Increment 
MOVE_Decrement 
MOVE_PageUp 
MOVE_PageDown 
MOVE_Top 
MOVE_Bottom 
Enumerator:
SCROLLMODE_Normal 

Doesn't update while draging, just on release.

SCROLLMODE_Tracking 

Updates grid while draging slider.

Enumerator:
SECTION_None 
SECTION_Grid 
SECTION_TopHeading 
SECTION_SideHeading 
SECTION_CornerButton 
SECTION_HScroll 
SECTION_VScroll 
SECTION_Tab 
SECTION_ColBorder 
SECTION_RowBorder 

Constructor & Destructor Documentation

MIGRIDCTRL::MIGRIDCTRL (  ) 

Standard constructor.

virtual MIGRIDCTRL::~MIGRIDCTRL (  )  [virtual]

Destructor.


Member Function Documentation

MIGRIDCELL::CELLTYPE MIGRIDCTRL::AddCellType ( MIGRIDCELLTYPE ptype,
bool  bDeleteInGridsDestructor = false 
)

Adds a cell type.

Returns:
A celltype index which can be used in calls to MIGRIDCELL::SetCellType().

The bDeleteInGridsDestructor should be set to true if you're doing... grid->AddCellType(new MIGRIDCELLTYPE_SOMETHING, true); to let the grid know it should delete the celltype in its destructor.

int MIGRIDCTRL::AppendCol (  ) 

This is like InsertCol() but will add the column to the end.

NOTE: Much more efficient of done while there are no rows.

int MIGRIDCTRL::AppendRow (  ) 

This is like InsertRow() but will add the row to the end.

int MIGRIDCTRL::ClearSelections (  ) 

Unselect all cells.

int MIGRIDCTRL::Create ( Widget  parent,
Arg *  arg,
int  n 
)
void MIGRIDCTRL::DeleteAllItems (  )  [inline]
int MIGRIDCTRL::DeleteCol ( int  col  ) 

Delete a column.

void MIGRIDCTRL::DeleteItem ( int  row  )  [inline]
int MIGRIDCTRL::DeleteRow ( int  row  ) 

Delete a row.

int MIGRIDCTRL::EditCancel (  ) 

Will stop current edit (if active) without saving changes.

void MIGRIDCTRL::EditFinish ( int  col,
int  row,
const MIGRIDCELL cell 
)

Finish the editing.

void MIGRIDCTRL::EditFinish ( MIGRIDEDITHANDLE handle = NULL,
bool  bAborting = false 
)

Finish the editing.

This function is called internally (but by a class which isn't a friend, or I'd make this method private) Unless aborting is set, it will call OnEditFinish, to verify the data. Will then, if necessary, retain the values internally and redraw the cell.

int MIGRIDCTRL::EnableColSwapping ( bool  bEnable = true  ) 

Allow user to swap columns by dragging them.

int MIGRIDCTRL::EnableMenu ( bool  bEnable = true  ) 

Will enable/disable the right-mouse button popup menu.

void MIGRIDCTRL::EnableUpdate ( bool  enable = true  ) 

Enable/Disable updates.

Keeps track of how many times it's been disabled. When reeneabled, will automatically redraw if needed.

void MIGRIDCTRL::EnsureVisible ( int  row,
int  col,
bool  bPartialOK = false 
)

Make sure that a given row and column are visible Pass -1 for either row or column to only scroll in the other direction.

int MIGRIDCTRL::FindItemByData ( const void *  data  )  const

Returns the row number in which the Param value for column 0 is equal to the given value.

Returns -1 if no row with that value.

int MIGRIDCTRL::FindItemByData ( PTRINT  data  )  const [inline]
int MIGRIDCTRL::GetAbsoluteCellFromPoint ( int  x,
int  y,
int *  ptcol,
int *  ptrow 
) const

Given an x and y, return a row and column number.

Returns:
0 for success, -1 if no cell at given point.
Parameters:
x X coordinate relative to upper left of grid control
y Y coordinate relative to upper left of grid control
ptcol column number returned
ptrow row number returned
int MIGRIDCTRL::GetBottomRow (  )  const

Retrieves the row number of the bottom most visable row.

Returns:
The row number of the bottom most visable row.
int MIGRIDCTRL::GetCell ( int  col,
int  row,
MIGRIDCELL **  ppCell 
) const

This version sets *ppcell to a pointer to the internal cell data IF THERE IS ANY and returns 0.

If there is no internal data for the cell, *ppCell will be NULL and the function will return -1

int MIGRIDCTRL::GetCell ( int  col,
int  row,
MIGRIDCELL pCell 
) const

Gets a COPY of a given cell.

Returns:
Only properties which have been directly set for the cell Normally, you get the cell, modify it using its methods, then call SetCell. Returns 0 if Cell exists, -1 if not, < -1 if error.
int MIGRIDCTRL::GetCellIndirect ( int  col,
int  row,
MIGRIDCELL pCell,
MIGRIDCELL::PROPERTY  properties = MIGRIDCELL::PROP_All 
)

Just like GetCell, but merges the cells properties with the default properties of the row and colum which it is in.

Values are retrieved in the following order. 1. Column properties 2. Row properties 3. Actual cell contents 4. Calls OnGetCell() which can override values. changes made by OnGetCell() only affect this copy, not the unerlying data.

int MIGRIDCTRL::GetCellRect ( int  col,
int  row,
LRECT2D rect 
) const

No, not const. Calls OnGetCell() and may cache result.

Get the rectangle of a cell in coordinates relative to the upper left corner of the drawing area it's in.

int MIGRIDCTRL::GetColDefault ( int  col,
MIGRIDCELL pCell 
) const

Retrieves a cell with the default settings for a column (background color, alignment, etc).

Returns:
A cell with the default settings for a column.

NOTE: if there is no default for the column, this will return a cell with nothing set, not the grid default

int MIGRIDCTRL::GetColTranslation ( int  VisualColumnNumber  )  const

Retrieves the logical column number of then n'th column in visual order.

Returns:
The logical column number of then n'th column in visual order.

Note: Assumed that columns can be swapped around visually.

ERRVALUE MIGRIDCTRL::GetColumnOrderArray ( SIMPLE_ARRAY< INT32 > &   )  const

Retrieves the column order as an array.

Note: Assumed that columns can be swapped around visually.

int MIGRIDCTRL::GetColumnWidth ( int  col  )  const [inline]

Get the width of a column in pixels.

Returns:
The width, 0 if the column number is invalid.
int MIGRIDCTRL::GetColWidth ( int  col  )  const

Get the width of a column in pixels.

Returns:
The width, 0 if the column number is invalid.
int MIGRIDCTRL::GetColWidth ( int  col,
int *  width 
) const

Get the width of a column in pixels.

Returns:
0 for success, -1 for error.
int MIGRIDCTRL::GetCountPerPage (  )  const

Get the number of rows complete rows that can fit on the page.

int MIGRIDCTRL::GetCurrentCol (  )  const

Retrieves the column of the cell which has focus (or would have focus if the grid had focus).

Returns:
The column of the cell which has focus.
int MIGRIDCTRL::GetCurrentRow (  )  const

Retrieves the row of the cell which has focus (or would have focus if the grid had focus).

Returns:
The row of the cell which has focus.
int MIGRIDCTRL::GetCurrentTab (  )  const [inline]

Retrieves the number of the current tab if the control has more than one.

Returns:
The number of the current tab if the control has more than one.

Note: I may or may not implement this.

Widget MIGRIDCTRL::GetDA ( int  col,
int  row 
) const [inline]

Used by editing classes to get widget to pop stuff up over.

MGD::CONTEXT* MIGRIDCTRL::GetDAGC ( int  col,
int  row 
) const [inline]

Used by editing classes to get gc to draw with (drawing into DrawingArea).

Widget MIGRIDCTRL::GetForm (  )  const [inline]

Get the main XmForm of the control.

The main form can be used to control attachment to other widgets. Note: This is not available in the WIN32_NATIVE build

MGD::CONTEXT* MIGRIDCTRL::GetGC ( int  col,
int  row 
) const [inline]

Used by editing classes to get gc to draw with (drawing into Pixmap).

int MIGRIDCTRL::GetGridDefault ( MIGRIDCELL pCell  )  const

Returns a cell with the default style for the grid.

Returns:
A cell with the default style for the grid.
int MIGRIDCTRL::GetHeadingDefault ( MIGRIDCELL pCell  )  const

Returns a cell with the default style for the heading.

Returns:
A cell with the default style for the heading.
int MIGRIDCTRL::GetHSHeight (  )  const

Returns the height of the horizontal scrollbar in pixels.

Returns:
The height of the horizontal scrollbar in pixels.
const MGUI::IMAGELIST* MIGRIDCTRL::GetImageList (  )  const [inline]

Return the ImageList associated with this Grid.

Return value will be NULL if no image list associated with the grid. Call SetImageList to get the image list.

int MIGRIDCTRL::GetItemCount (  )  const [inline]
PTRUINT MIGRIDCTRL::GetItemData ( int  row,
int  col = 0 
) const [inline]

Get the userdata (PTRUINT) for an item in the list.

void* MIGRIDCTRL::GetItemDataPtr ( int  row,
int  col = 0 
) const

Get the userdata (void*) for an item in the list.

int MIGRIDCTRL::GetLeftCol (  )  const

Returns the column number of the left-most visable column, counting partial columns.

Returns:
The column number of the left-most visable column, counting partial columns.

NOTE: If column swapping is enabled, don't assume that columns go sequentially from left to right. In fact. This is a pretty useless value.

int MIGRIDCTRL::GetNextSelectedItem ( int  row  )  const

Returns the row number of the next row with a selection in it.

Returns -1 if no more selected items Pass -1 to start at the top. The row number passed is ignored. Note: This is horribly inefficient. GetSelectedItemList() is more efficient.

int MIGRIDCTRL::GetNumberCols (  )  const

Returns the number of columns in the grid.

Returns:
The number of columns in the grid.
int MIGRIDCTRL::GetNumberRows (  )  const

Returns the number of rows in the grid.

Returns:
The number of rows in the grid.
int MIGRIDCTRL::GetRightCol (  )  const

Returns the column number of the right-most visable column, counting partial columns.

Returns:
The column number of the right-most visable column, counting partial columns.

Actually, this method may go away. Since columns can be swapped, knowing which one is on the right is pretty useful.

int MIGRIDCTRL::GetRowHeight ( int  row  )  const

Returns the height of a given row.

Returns:
The height of a given row.

Note that not all rows have to be the same height.

int MIGRIDCTRL::GetSelectedCount (  )  const [inline]
const SIMPLE_ARRAY<LPOINT2D>& MIGRIDCTRL::GetSelectedItems (  )  const [inline]

Returns an array of selected cells.

For each cell, the y value is the row, the x value is the column. An x of -1 indicates the whole row is selected.

int MIGRIDCTRL::GetSideHeadingWidth (  )  const

Returns the width of the side heading, which does not scroll horizontally with the rest of the grid.

Returns:
The width of the side heading, which does not scroll horizontally with the rest of the grid.
void MIGRIDCTRL::GetSize ( LPOINT2D size  )  const

Gets the size of the main form in pixels.

Size returned includes headings and scroll bars.

int MIGRIDCTRL::GetTopHeadingHeight (  )  const

Returns the height of the top heading, which does not scroll vertically with the rest of the grid.

Returns:
The height of the top heading, which does not scroll vertically with the rest of the grid
int MIGRIDCTRL::GetTopRow (  )  const

Returns the index of the top-most (partially) visable row.

Returns:
The index of the top-most (partially) visable row.
int MIGRIDCTRL::GetVSWidth (  )  const

Returns the width of the vertical scrollbar.

Returns:
The width of the vertical scrollbar.
int MIGRIDCTRL::GotoCell ( int  col,
int  row 
)

Change the focus to the given cell.

Returns:
0 on success, -1 the cell is invalid or if OnCanMove() disallowed the move.
int MIGRIDCTRL::GotoCol ( int  col  )  [inline]

Change the focus to the given cell.

Returns:
0 on success, -1 the cell is invalid or if OnCanMove() disallowed the move.

Changes only the column, leaving the row the same.

int MIGRIDCTRL::GotoRow ( int  row  )  [inline]

Change the focus to the given cell.

Returns:
0 on success, -1 the cell is invalid or if OnCanMove() disallowed the move.

Changes only the row, leaving the column the same.

int MIGRIDCTRL::HideCurrentCell (  )  [inline]

Sets the current cell to be -1-1, thereby removing the focus rectangle.

int MIGRIDCTRL::InsertCol ( int  col  ) 

Insert a column before the specified column.

NOTE: Much more effeciant of done while there are no rows

int MIGRIDCTRL::InsertColumn ( int  col,
const MIUNICODE string,
MIGRIDCELL::ALIGNMENT  alignment,
int  width = -1 
)

Insert a column before the specified column.

int MIGRIDCTRL::InsertRow ( int  row  ) 

Insert a row before the specified row.

bool MIGRIDCTRL::IsSelected ( int  col,
int  row 
) const

Find if cell is selected.

Returns:
True if the given cell is selected.
int MIGRIDCTRL::LockColumns ( int  cols  ) 

Locks or freezes the specified number of columns so that they will not scroll off the screen.

Locked columns start from column 0, so calling this function with a value of 3 will lock columns 0, 1, and 2. To unlock the columns, call LockColumsn(0). Not implemented yet.

int MIGRIDCTRL::LockRows ( int  rows  ) 

Locks or freezes the specified number of rows so that they will not scroll off the screen.

Locked rows start from rows 0, so calling this function with a value of 3 will lock rows 0, 1, and 2. To unlock the rows, call LockRows(0). Not implemented yet.

int MIGRIDCTRL::MoveColPosition ( int  fromCol,
int  toCol,
bool  insertBefore 
)

Function used to reorder columms visually.

Column numbers are logical, not visual.

int MIGRIDCTRL::MoveCurrentCol ( MOVEMENT  movement  ) 

Used to move the focus rectangle relative to current focus rectangle.

Returns:
0 on success, -1 if movement can't happen.

MOVE_Increment, MOVE_PageDown, MOVE_Bottom all go to the right.

int MIGRIDCTRL::MoveCurrentRow ( MOVEMENT  movement  ) 

Used to move the focus rectangle relative to current focus rectangle.

Returns:
0 on success, -1 if movement can't happen.
int MIGRIDCTRL::RedrawAll (  ) 

Redraw everything.

int MIGRIDCTRL::RedrawCell ( int  col,
int  row 
)

Redraw the cell.

int MIGRIDCTRL::RedrawCol ( int  col  ) 

Redraw the column.

int MIGRIDCTRL::RedrawRow ( int  row  ) 

Redraw the row.

int MIGRIDCTRL::Select ( int  col,
int  row 
)

Select a given cell.

Parameters:
col Pass -1 to select whole row
int MIGRIDCTRL::SelectRange ( int  startcol,
int  startrow,
int  endcol,
int  endrow 
)

Select a block of cells.

int MIGRIDCTRL::Set3DHeight ( int  height  ) 

Set the height of raised borders in pixels.

int MIGRIDCTRL::SetBallisticDelay ( int  millsec  ) 

Sets the speed of row-by-row/col-by-col scrolling when balistic scrolling is enabled.

When the mouse is dragged within approximately one inch outside the grid's boundaries, scrolling will occur one row/col at a time. The delay between scrolling updates is determined by this function (I may not implement this).

int MIGRIDCTRL::SetCell ( int  col,
int  row,
const MIGRIDCELL pCell 
)

Set the properties for a cell.

int MIGRIDCTRL::SetColDefault ( int  col,
const MIGRIDCELL Cell 
)

Set the default properties for a column.

int MIGRIDCTRL::SetColTranslation ( int  VisualColumnNumber,
int  RealColumnNumber 
)

This function sets the _visual_ order of columns.

int MIGRIDCTRL::SetColWidth ( int  col,
int  width 
)

Set the width of a column in pixels.

int MIGRIDCTRL::SetDefColWidth ( int  width  ) 

Set the default width for new columns.

int MIGRIDCTRL::SetDefRowHeight ( int  height  ) 

Set the default height for new rows.

If not set, the default row height is big enough to hold the tallest font in the default font list. (Uses MxGetMaxFontHeight() to determine)

void MIGRIDCTRL::SetGCExclusive ( MGD::CONTEXT gc  )  [inline]

Set gc exclusive.

int MIGRIDCTRL::SetGridDefault ( const MIGRIDCELL Cell  ) 

Set the default properties for grid cells.

int MIGRIDCTRL::SetHeadingDefault ( const MIGRIDCELL Cell  ) 

Set the default properties for heading cells.

void MIGRIDCTRL::SetHideFocus ( bool  hide  )  [inline]

Used internally to keep focus rectangle from flickering while editing.

int MIGRIDCTRL::SetHighlightRow ( bool  bWholeRow  ) 

Set row highlighting row.

If true, will hightlight, the whole row that has focus.

int MIGRIDCTRL::SetHScrollMode ( SCROLLMODE  mode  ) 

Set scroll mode to SCROLLMODE_Normal or SCROLLMODE_Tracking.

Tracking mode updates while dragging the scrollbar. Normal mode doesn't.

int MIGRIDCTRL::SetHSHeight ( int  height  ) 

Set the height of the horizontal scrollbar.

void MIGRIDCTRL::SetImageList ( MGUI::IMAGELIST ImageList,
bool  MakeACopy = true 
)

Set an ImageList for the Grid.

By default the grid will make a copy of the list. If you pass false for MakeACopy, the list will NOT be copied. This should be used only if the list itself is a static global which will exist for the life of the program and be destroied on exit

Parameters:
MakeACopy If true, MIGRID copy the image list.
void MIGRIDCTRL::SetItemData ( int  row,
PTRUINT  data 
) [inline]

Set the user data for a given item in the list.

This version assumes integer data. SetItemDataPtr() assumes a pointer. Note one calls the other. This would be done by just overloading the functions, but that makes NULL ambiguious and the Get methods have to have different names because you can't have two methods that differ only in the return type.

void MIGRIDCTRL::SetItemData ( int  row,
int  col,
PTRUINT  data 
) [inline]

Set the user data for a given item in the list.

This version assumes integer data. SetItemDataPtr() assumes a pointer. Note one calls the other. This would be done by just overloading the functions, but that makes NULL ambiguious and the Get methods have to have different names because you can't have two methods that differ only in the return type.

void MIGRIDCTRL::SetItemDataPtr ( int  row,
void *  data 
) [inline]

Set the user data for a given item in the list.

This version assumes pointer data. SetItemData() assumes integer. Note one calls the other. This would be done by just overloading the functions, but that makes NULL ambiguious and the Get methods have to have different names because you can't have two methods that differ only in the return type.

void MIGRIDCTRL::SetItemDataPtr ( int  row,
int  col,
void *  data 
)

Set the user data for a given item in the list.

This version assumes pointer data. SetItemData() assumes integer. Note one calls the other. This would be done by just overloading the functions, but that makes NULL ambiguious and the Get methods have to have different names because you can't have two methods that differ only in the return type.

int MIGRIDCTRL::SetLeftCol ( int  col  ) 

Set the left-most visable column.

int MIGRIDCTRL::SetMargin ( int  pixels  ) 

Set the margin for cells.

int MIGRIDCTRL::SetMultiSelectMode ( bool  bEnable  ) 

Enable/Disable multi selection mod3.

int MIGRIDCTRL::SetNumberCols ( int  cols  ) 

Set the number of columns.

NOTE: Much more efficient if done while there are no rows.

int MIGRIDCTRL::SetNumberRows ( int  rows  ) 

Set the number of rows.

int MIGRIDCTRL::SetRowDefault ( int  col,
const MIGRIDCELL Cell 
)

Set the default properties for a row.

int MIGRIDCTRL::SetRowHeight ( int  row,
int  height 
)

Set the row height.

int MIGRIDCTRL::SetSideHeadingColWidth ( int  col,
int  width 
)

Set the width of side heading columns.

Note that there can be > 1 side heading, and they're numbered with -1 being the right most and decrease going to the left.

int MIGRIDCTRL::SetSideHeadingNumCols ( int  cols  ) 

Set the number of "side headings" (useful for showing row numbers, etc).

Hint: This is more efficient if you do it while there are no rows. Note, side3 heading columns are accessed as columns -1, -2, ... -n

int MIGRIDCTRL::SetSideHeadingWidth ( int  width  ) 

Set the "side headings" width.

void MIGRIDCTRL::SetSize ( const LPOINT2D size  ) 

Sets the size of the main form in pixels.

Size includes headings and scroll bars.

int MIGRIDCTRL::SetTopHeadingHeight ( int  height  ) 

Set the height of all the top headings.

Note that this does not have to be the sum of all the headings, but that's most logical.

int MIGRIDCTRL::SetTopHeadingNumRows ( int  rows  ) 

Set the number of "top headings" (useful for showing field names, etc).

Hint: This is more efficient if you do it while there are no columns. Note, top heading rows are accessed as rows -1, -2, ... -n Heading row -1 is the bottom most heading.

int MIGRIDCTRL::SetTopHeadingRowHeight ( int  row,
int  height 
)

Set the height of top heading rows.

Note that there can be > 1 top heading, and they're numbered with -1 being the bottom most and decrease going up. Note: The default TopHeadingRowHeight is the same as the default row height which can be set with SetDefRowHeight()

int MIGRIDCTRL::SetTopRow ( int  row  ) 

Set the top row.

int MIGRIDCTRL::SetUniformRowHeight ( bool  bUniform  ) 

Set the uniform row height.

int MIGRIDCTRL::SetUserSizingMode ( bool  bAllowResize  ) 

Allow/disable row/column resizing.

Note that row resizing will not be allowed if SetUniformRowHeight(true).

int MIGRIDCTRL::SetVScrollMode ( SCROLLMODE  mode  ) 

Set scroll mode to SCROLLMODE_Normal or SCROLLMODE_Tracking.

Tracking mode updates while dragging the scrollbar. Normal mode doesn't.

int MIGRIDCTRL::SetVSWidth ( int  width  ) 

Set the width of the vertical scrollbar in pixels.

int MIGRIDCTRL::SortBy ( int  col,
bool  bAscending 
) [inline]

Sort the data in the grid.

int MIGRIDCTRL::SortBy ( int *  pCols,
int  num,
bool  bAscending 
)

Sort the data in the grid.

Note that for now, this only works if all the CellData is set via SetCell(), and it physically swaps the internal rows. After that, everything is done using the rows in their sorted order, not the order you filled them in with. If you want to keep track of the original order somehow, you can use GetParam and SetParam to hang any private data you want to off of each cell.

int MIGRIDCTRL::StartEdit ( int  col,
int  row,
int  key 
)

Start editing a given cell and force-feed it the given key.

int MIGRIDCTRL::StartEdit ( int  key  ) 

Start editing the cell with focus and force-feed it the given key.

int MIGRIDCTRL::StartEdit (  ) 

Start editing the cell with focus.

int MIGRIDCTRL::StartMenu ( int  col,
int  row,
LPOINT2D point,
SECTION  section 
)

Pops up the popup menu (if any).

Point is where to pop the menu up relative to the drawing area XXX (This function doesn't work correctly yet.).

void MIGRIDCTRL::SwapRows ( INT32  row1,
INT32  row2 
)

Swap two rows.

Note, this will have no effect if the list gets its cell data through OnGetCell().

static void MIGRIDCTRL::Test ( DBEDIT ddata,
DBEDIT_TDATA *  tdata 
) [static]

A function for testing only. Will go away later.

int MIGRIDCTRL::Unselect ( int  col,
int  row 
)

Unselect a given cell.

Parameters:
col Can pass -1 to unselect whole row
int MIGRIDCTRL::UseHints ( bool  bUseHints = true  ) 

Turns on hints.

int MIGRIDCTRL::UseHScrollHints ( bool  bUseHints = true  ) 

Turns on horizontal scroll hints.

int MIGRIDCTRL::UseVScrollHints ( bool  bUseHints = true  ) 

Turns on vertical scroll hints.

virtual bool MIGRIDCTRL::v_OnCanColSwap ( int  fromCol,
int  toCol 
) [virtual]

Called to determine if column swapping should be allowed.

Returns:
True to allow, false to disallow.

In the case of visually dragging a column, we're not really swapping the columns (This is the UltimateGridControls's method name, not mine). Column numbers are real logical column numbers, not visual.

Parameters:
fromCol column we're moving
toCol column we're about to place it AFTER (-1 if making fromCol the first column)
virtual bool MIGRIDCTRL::v_OnCanMove ( int  oldcol,
int  oldrow,
int  newcol,
int  newrow 
) [virtual]

Called to determine if a given change of cell focus should be allowed.

Returns:
False to prevent, true to allow.
virtual bool MIGRIDCTRL::v_OnCanSizeCol ( int  col  )  [virtual]

Called to determine if user can resize a column.

virtual bool MIGRIDCTRL::v_OnCanSizeRow ( int  row  )  [virtual]

Called to determine if user can resize a row (row resizing not implemented anyway).

virtual bool MIGRIDCTRL::v_OnCanSizeSideHdg (  )  [virtual]

Called to determine if user can resize the side heading (heading resizing not implemented anyway).

virtual bool MIGRIDCTRL::v_OnCanSizeTopHdg (  )  [virtual]

Called to determine if user can resize the top heading (the height) (heading resizing not implemented anyway).

virtual void MIGRIDCTRL::v_OnCellChange ( int  oldcol,
int  oldrow,
int  newcol,
int  newrow 
) [virtual]

Called to notify you that the cell focus has changed.

virtual bool MIGRIDCTRL::v_OnCellTypeNotify ( MIGRIDCELL::CELLTYPE  celltype,
int  col,
int  row,
INT32  msg,
CELLSTATE  param 
) [virtual]

Called when certain cell type actions are performed.

Returns:
False to prevent the action from happening (but it's already happened, so why bother?).

See the comments above where MIGRIDCELL::CELLTYPE is defined for details.

virtual void MIGRIDCTRL::v_OnColChange ( int  oldcol,
int  newcol 
) [virtual]

Called to notify you that the cell focus has changed.

virtual void MIGRIDCTRL::v_OnColSized ( int  col,
int *  width 
) [virtual]

Called to inform you that the width of a column is being changed.

Note that the width is passed by reference and CAN be ammended. This way, you can implement min/max sizes. Note, this function is called by SetColumnWidth().

virtual void MIGRIDCTRL::v_OnColSizing ( int  col,
int *  width 
) [virtual]

Called to inform you that the width of a column is being changed.

Note that the width is passed by reference and CAN be ammended. This way, you can implement min/max sizes. Note, this function is called while the resize action is taking place (user is dragging the divider between columns).

virtual void MIGRIDCTRL::v_OnDClicked ( int  col,
int  row,
LRECT2D rect,
LPOINT2D point,
bool *  pbProcessed,
UINT32  state 
) [virtual]

Called when the user double clicks on a cell.

The point passed in is coordinates relative to the upper left of the cell where the click took place. The rect is the extents of said cell (relative to the drawing area it's drawing in). NOTE: If you use the event, set *pbProcessed to true to prevent the event from propagating. If you don't it will be treated as just another left click (and call OnLClicked()).

Parameters:
state ShiftMask, CtrlMask, etc from the XEvent
virtual bool MIGRIDCTRL::v_OnDrawItem ( int  row,
int  col,
MIGRIDCUSTOMDRAW drawdata 
) [virtual]

Called before an item is drawn.

Override if you want to do the drawing yourself. Return true to prevent the list from drawing, false to let it draw.

virtual bool MIGRIDCTRL::v_OnEditContinue ( int  oldcol,
int  oldrow,
int *  newcol,
int *  newrow 
) [virtual]

Called while the cell is still in the editing mode.

Returns:
True to allow changes, false to reject.

This allows you to cancel any changes, or prevent the change of focus. I may not implemnt this one, as I don't see how it differs from OnEditFinish and OnCellChange. (Not implemented)

virtual bool MIGRIDCTRL::v_OnEditFinish ( int  col,
int  row,
const MIGRIDCELL cell 
) [virtual]

Called when a cell has been edited.

Returns:
False to reject the changes, true to accept them.
virtual bool MIGRIDCTRL::v_OnEditFinish ( int  col,
int  row,
MDLGPARENT  TextControl,
const MIUNICODE string 
) [virtual]

Called when a cell has been edited.

Returns:
False to reject the changes, true to accept them.

I'd rather make this get the MIGRIDCELL from which you could get the string or bool value, but UltimateGrid control gives you the string, so that's all I got. For the X version, I'll make the string equal "1" or "0" for boolean cell types. Note that TextControl will be NULL unless it's a text cell.

virtual bool MIGRIDCTRL::v_OnEditStart ( int  col,
int  row 
) [virtual]

Called when a cell is about to be edited.

Returns:
return false to prevent edit, true to allow

In X version, this is only called when editing begins on a text cell (buttons and dropdowns don't call it).

virtual bool MIGRIDCTRL::v_OnEditVerify ( int  col,
int  row,
MDLGPARENT  TextControl,
const MIUNICODE str 
) [virtual]

Called before adding text to a string.

Returns:
True to allow it, false to reject it.

UGC also gets CEdit* of the edit control X version is only passed the text about to be inserted. (I don't know what UGC passes, documentation is unclear) WARNING! If the edit is a deletion, str may be NULL. Hmmm! In the UGC version, "str" is a pointer to a UINT holding a single char which may not by Unicode. This also gets VK_DELETE, VK_TAB, etc.

virtual void MIGRIDCTRL::v_OnGetCell ( int  col,
int  row,
MIGRIDCELL cell,
MIGRIDCELL::PROPERTY  mask = MIGRIDCELL::PROP_All 
) [virtual]

Called by GetCellIndirect() to let derived class modify cell properties and even the cell value.

Note that if the data has been sorted by calling SortBy(), you should not rely on the row number being the same order that you added the rows.

virtual bool MIGRIDCTRL::v_OnHint ( int  col,
int  row,
SECTION  section,
MGUI::CTRL_TOOLTIP tooltip 
) [virtual]

Called when the mouse has been over a cell long enough to produce a tooltip.

Returns:
True to show hint, false to not.

Call SetText or SetImage on the tooltip control passed in. The default implementation calls the MIUNICODE version NOTE: You have to call UseHints() to enable this.

virtual bool MIGRIDCTRL::v_OnHScrollHint ( int  col,
MISTRING  
) [virtual]

Called while horizontal scrolling to get the tooltip to show.

NOTE: You have to call UseHScrollHints() to enable this.

virtual int MIGRIDCTRL::v_OnItemCompare ( UINT32  item1,
UINT32  item2,
const SORTDATA sortdata 
) [virtual]

Called by SortBy() to compare items.

Should return < 0 if item1 should precede item2 and > 0 if item1 should follow item2, and 0 if they're equivalent. The default implementation calls GetCellIndirect() and compares the cell values.

virtual bool MIGRIDCTRL::v_OnItemSelect ( int  row,
int  col 
) [virtual]

Called when an item is selected.

Return true to allow it to be selected, false to prevent selection.

virtual bool MIGRIDCTRL::v_OnItemUnselect ( int  row,
int  col 
) [virtual]

Called when an item is unselected.

Return true to allow it to be unselected, false to prevent unselection. Note that a call to ClearSelections will call OnItemUnselect() but will ignore the return value.

virtual void MIGRIDCTRL::v_OnKillFocus ( SECTION  section  )  [virtual]

Called when focus is lost for the whole grid.

[ XXX Not implemented yet ]

virtual void MIGRIDCTRL::v_OnLClicked ( int  col,
int  row,
bool  bIsMouseDown,
LRECT2D rect,
LPOINT2D point,
bool *  pbProcessed,
UINT32  state 
) [virtual]

Called when the user left clicks on a cell.

The point passed in is coordinates relative to the upper left of the cell where the click took place. The rect is the extents of said cell. NOTE: If you use the event, set *pbProcessed to true to prevent the event from propagating.

Parameters:
state ShiftMask, CtrlMask, etc from the XEvent
virtual void MIGRIDCTRL::v_OnLeftColChange ( int  oldcol,
int  newcol 
) [virtual]

Called when the left-most visable column changes.

virtual void MIGRIDCTRL::v_OnMenuCommand ( int  col,
int  row,
SECTION  section,
int  item 
) [virtual]

This is called in response to a popup menu option.

The vars row and col are where the right mouse button was clicked, item is the ID you passed to MGUI::MENU::Add in v_OnMenuStart()

virtual bool MIGRIDCTRL::v_OnMenuStart ( int  col,
int  row,
SECTION  section,
MGUI::MENU menu 
) [virtual]

Called when the user right clicks and a popup menu is about to be displayed.

Returns:
True to enable the menu, false to prevent the menu. (Note, the menu won't popup if empty either)

This gives you an emtpy MGUI::MENU to populate.

If you do not specify a delegate when you add items to the menu, the default delegate will cause it to call the grid's v_OnMenuCommand().

virtual void MIGRIDCTRL::v_OnRClicked ( int  col,
int  row,
bool  bIsMouseDown,
LRECT2D rect,
LPOINT2D point,
bool *  pbProcessed,
UINT32  state 
) [virtual]

Called when the user left clicks on a cell.

The point passed in is coordinates relative to the upper left of the cell where the click took place. The rect is the extents of said cell. NOTE: If you use the event, set *pbProcessed to true to prevent the event from propagating. NOTE: If you have called EnableMenu with true, the popup menu will be handled instead of OnRClicked.

Parameters:
state ShiftMask, CtrlMask, etc from the XEvent
virtual void MIGRIDCTRL::v_OnRowChange ( int  oldrow,
int  newrow 
) [virtual]

Called when the focus shifts to a new row.

virtual void MIGRIDCTRL::v_OnRowSized ( int  row,
int *  height 
) [virtual]

Like OnColumnSized, but for rows (Row resizing not implemented anyway).

virtual void MIGRIDCTRL::v_OnRowSizing ( int  row,
int *  height 
) [virtual]

Like OnColumnSizing, but for rows (Row resizing not implemented anyway).

virtual void MIGRIDCTRL::v_OnSetCell ( int  col,
int  row,
MIGRIDCELL pCell 
) [virtual]

Called by SetCell() to let you ammend the changes.

virtual void MIGRIDCTRL::v_OnSetFocus ( SECTION  section  )  [virtual]

Called when the grid gains focus or when focus shifts to a different section of the grid.

virtual void MIGRIDCTRL::v_OnSetup (  )  [virtual]

Called when the whole thing is being created (Create()).

virtual void MIGRIDCTRL::v_OnSideHeadingDClicked ( int  col,
int  row,
LRECT2D pRect,
LPOINT2D pPoint,
bool *  pbProcessed 
) [virtual]

Called when the side heading is double clicked.

Note that you can have multiple side headings. The right-most side heading is column -1, and the decrease going to the left.

virtual void MIGRIDCTRL::v_OnSideHeadingLClicked ( int  col,
int  row,
bool  bIsMouseDown,
LRECT2D pRect,
LPOINT2D pPoint,
bool *  pbProcessed 
) [virtual]

Called when the side heading is left clicked.

Note that you can have multiple side headings. The right-most side heading is column -1, and the decrease going to the left.

virtual void MIGRIDCTRL::v_OnSideHeadingRClicked ( int  col,
int  row,
bool  bIsMouseDown,
LRECT2D pRect,
LPOINT2D pPoint,
bool *  pbProcessed 
) [virtual]

Called when the side heading is left clicked.

Note that you can have multiple side headings. The right-most side heading is column -1, and the decrease going to the left Note, that if menus are enabled, this gets called before the menu is processed and can disable it by setting *bpProcessed to true.

virtual void MIGRIDCTRL::v_OnSize ( int  ntype,
int  width,
int  height 
) [virtual]

Called when the Grid control is resized.

Size returned includes headings and scroll bars.

Parameters:
ntype Ignore - For compatibility with MFC
virtual void MIGRIDCTRL::v_OnTopHeadingDClicked ( int  col,
int  row,
LRECT2D pRect,
LPOINT2D pPoint,
bool *  pbProcessed 
) [virtual]

Called when the top heading is double clicked.

Note that you can have multiple side headings. The right-most side heading is column -1, and the decrease going to the left.

virtual void MIGRIDCTRL::v_OnTopHeadingLClicked ( int  col,
int  row,
bool  bIsMouseDown,
LRECT2D pRect,
LPOINT2D pPoint,
bool *  pbProcessed 
) [virtual]

Called when the side heading is left clicked.

Note that you can have multiple side headings. The right-most side heading is column -1, and the decrease going to the left.

virtual void MIGRIDCTRL::v_OnTopHeadingRClicked ( int  col,
int  row,
bool  bIsMouseDown,
LRECT2D pRect,
LPOINT2D pPoint,
bool *  pbProcessed 
) [virtual]

Called when the side heading is left clicked.

Note that you can have multiple side headings. The right-most side heading is column -1, and the decrease going to the left. Note, that if menus are enabled, this gets called before the menu is processed and can disable it by setting *bpProcessed to true.

virtual bool MIGRIDCTRL::v_OnVScrollHint ( int  row,
MISTRING  
) [virtual]

Called while vertical scrolling to get the tooltip to show.

NOTE: You have to call UseVScrollHints() to enable this.


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

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