MIGRIDCELL Class Reference

#include <mi32/migrid.h>

Inheritance diagram for MIGRIDCELL:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { CELLTYPEEX_Toggle = 0x00000001, CELLTYPEEX_Disabled = 0x00000002 }
enum  ALIGNMENT { ALIGN_Left = 0, ALIGN_Right, ALIGN_Center }
enum  BORDER {
  BORDER_None = 0x0000, BORDER_LThin = 0x0001, BORDER_TThin = 0x0002, BORDER_RThin = 0x0004,
  BORDER_BThin = 0x0008, BORDER_Thin = 0x000F, BORDER_LMedium = 0x0010, BORDER_TMedium = 0x0020,
  BORDER_RMedium = 0x0040, BORDER_BMedium = 0x0080, BORDER_Medium = 0x00FF, BORDER_LThick = 0x0100,
  BORDER_TThick = 0x0200, BORDER_RThick = 0x0400, BORDER_BThick = 0x0800, BORDER_Thick = 0x0FFF,
  BORDER_Left = 0x0111, BORDER_Top = 0x0222, BORDER_Right = 0x0444, BORDER_Bottom = 0x0888,
  BORDER_Recessed = 0x1000, BORDER_Raised = 0x2000
}
enum  CELLTYPE {
  CELLTYPE_Text = 0, CELLTYPE_Button = 1, CELLTYPE_DropDown = 2, CELLTYPE_Icon = 3,
  CELLTYPE_IconButton = 4, CELLTYPE_BigText = 5, CELLTYPE_PopUp = 6, CELLTYPE_Color = 7
}
enum  DATATYPE {
  DATATYPE_String, DATATYPE_Number, DATATYPE_Bool, DATATYPE_Time,
  DATATYPE_Currency, DATATYPE_Color
}
enum  PROPERTY {
  PROP_None = 0x00000000, PROP_Text = 0x00000001, PROP_FGColor = 0x00000002, PROP_BGColor = 0x00000004,
  PROP_BorderStyle = 0x00000008, PROP_Alignment = 0x00000010, PROP_DecimalPlaces = 0x00000020, PROP_ReadOnly = 0x00000040,
  PROP_DataType = 0x00000080, PROP_Param = 0x00000100, PROP_CellType = 0x00000200, PROP_CellTypeEx = 0x00000400,
  PROP_Label = 0x00000800, PROP_FGHColor = 0x00001000, PROP_BGHColor = 0x00002000, PROP_Bool = 0x00004000,
  PROP_MaxLen = 0x00008000, PROP_Icon = 0x00010000, PROP_All = 0xFFFFFFFF
}

Public Member Functions

 MIGRIDCELL (const MIGRIDCELL &)
 MIGRIDCELL ()
 ~MIGRIDCELL ()
void ClearAll ()
void ClearProperty (PROPERTY p)
ALIGNMENT GetAlignment () const
const COLORGetBackColor () const
const COLORGetBackColorHilighted () const
bool GetBool () const
BORDER GetBorder () const
CELLTYPE GetCellType () const
int GetCellTypeEx () const
DATATYPE GetDataType () const
const COLORGetForeColor () const
const COLORGetForeColorHilighted () const
int GetIconIndex () const
const MIUNICODEGetLabelText () const
int GetMaxLen () const
double GetNumber () const
int GetNumberPlaces () const
void * GetParam () const
bool GetReadOnly () const
const MIUNICODEGetText () const
MIUNICODEGetTextCopy () const
bool HasProperty (PROPERTY property) const
bool IsEmpty () const
void MergeProperties (const MIGRIDCELL &cell, bool bBlendColors=false, PROPERTY mask=PROP_All)
MIGRIDCELLoperator= (const MIGRIDCELL &)
void SetAlignment (ALIGNMENT alignment)
void SetBackColor (const COLOR &color)
void SetBackColorHilighted (const COLOR &color)
void SetBool (bool state)
void SetBorder (BORDER border)
void SetCellType (CELLTYPE type)
void SetCellTypeEx (INT32 val)
void SetDataType (DATATYPE type)
void SetForeColor (const COLOR &color)
void SetForeColorHilighted (const COLOR &color)
void SetIconIndex (int icon)
void SetLabelText (const char *)
void SetLabelText (const MIUNICODE *)
void SetMaxLen (int num)
void SetNumber (double num)
void SetNumberDecimals (int num)
void SetParam (void *ptr)
void SetReadOnly (bool state)
void SetText (const MIUNICODE *)

Member Enumeration Documentation

anonymous enum

Some of the celltypes have extra parameters that can be set on the cells.

Call SetCellTypeEx with any of the following...

Enumerator:
CELLTYPEEX_Toggle 

For Button and Icon, make it a toggle button (Use GetBool/SetBool to get/set state).

CELLTYPEEX_Disabled 

Draw icon or text stippled.

Enumerator:
ALIGN_Left 
ALIGN_Right 
ALIGN_Center 
Enumerator:
BORDER_None 
BORDER_LThin 
BORDER_TThin 
BORDER_RThin 
BORDER_BThin 
BORDER_Thin 
BORDER_LMedium 
BORDER_TMedium 
BORDER_RMedium 
BORDER_BMedium 
BORDER_Medium 
BORDER_LThick 
BORDER_TThick 
BORDER_RThick 
BORDER_BThick 
BORDER_Thick 
BORDER_Left 

Mask for left, any size.

BORDER_Top 

Mask for top, any size.

BORDER_Right 

Mask for Right, any size.

BORDER_Bottom 

Mask for bottom, any size.

BORDER_Recessed 
BORDER_Raised 

These are the built in celltypes.

Note that calling MIGRIDCTRL::AddCellType() will return a value not in this list. That's O.K.! This is an enum for type safety.

Special cases: CELLTYPE_Text OnEditFinish will be called when a cell is edited and loses focus.

CELLTYPE_Button If cell.SetReadOnly(true), button looks normal but can't be pressed. To make a button a toggle, call cell.SetCellTypeEx(CELLTYPEEX_Toggle) When the button is pressed, OnCellTypeNotify will be called. If the button is a toggle, the "param" parameter of OnCellTypeNotify() will be 1 for on, 0 for off. You can turn a toggle on/off by calling SetBool() on the cell.

CELLTYPE_DropDown CELLTYPE_PopUp Set the list of values for the dropdown by calling cell.SetLabelText() (See details below). OnEditStart() is called before the list is created, so you can delay populating it until then if you wish. [ Handy tip. If all cells in a column use the same list, set it with SetColDefault. In OnEditStart, call GetColDefault(), and only bother generating the list if GetLabelText() returns NULL ]

CELLTYPE_Icon Call cell.SetLabelText("group.icon") to set the icon. To make the icon stippled, call cell.SetCellTypeEx(CELLTYPEEX_Disabled) You can actually give the label two icons by passing two names like cell.SetLabelText("group.icon1, group.icon2") and switch between them by calling cell.SetBool() (false is the first one, true is the second)

CELLTYPE_IconButton A combination of CELLTYPE_Button and CELLTYPE_Icon. The 2nd icon is used for the "down" state.

CELLTYPE_Color A special type of CELLTYPE_Button. The Cell's ForeColor is used for the color of the button. Clicking on the button (if not set to ReadOnly) pops up a color editor and calls EditFinish()

Enumerator:
CELLTYPE_Text 

Simple text cell (default).

CELLTYPE_Button 

Simple pushbutton.

CELLTYPE_DropDown 

Dropdown list.

CELLTYPE_Icon 
CELLTYPE_IconButton 
CELLTYPE_BigText 

Text with [...] button to see/edit whole thing.

CELLTYPE_PopUp 

Popup list.

CELLTYPE_Color 

Button with color sample and no text.

Enumerator:
DATATYPE_String 
DATATYPE_Number 
DATATYPE_Bool 
DATATYPE_Time 
DATATYPE_Currency 
DATATYPE_Color 
Enumerator:
PROP_None 
PROP_Text 
PROP_FGColor 
PROP_BGColor 
PROP_BorderStyle 
PROP_Alignment 
PROP_DecimalPlaces 
PROP_ReadOnly 
PROP_DataType 
PROP_Param 
PROP_CellType 
PROP_CellTypeEx 
PROP_Label 
PROP_FGHColor 
PROP_BGHColor 
PROP_Bool 
PROP_MaxLen 
PROP_Icon 
PROP_All 

All properties.


Constructor & Destructor Documentation

MIGRIDCELL::MIGRIDCELL (  ) 

Constructor.

MIGRIDCELL::MIGRIDCELL ( const MIGRIDCELL  ) 

Constructor.

MIGRIDCELL::~MIGRIDCELL (  ) 

Destructor.


Member Function Documentation

void MIGRIDCELL::ClearAll (  ) 

Clear all properties to the "unset" state.

void MIGRIDCELL::ClearProperty ( PROPERTY  p  ) 

Clear given properties.

ALIGNMENT MIGRIDCELL::GetAlignment (  )  const [inline]

Get the alignment.

Returns:
the alignment.
const COLOR& MIGRIDCELL::GetBackColor (  )  const [inline]

Get background color.

const COLOR& MIGRIDCELL::GetBackColorHilighted (  )  const [inline]

Get background color while the cell is hilighted.

bool MIGRIDCELL::GetBool (  )  const [inline]

Gets a boolean value setable via SetBool().

BORDER MIGRIDCELL::GetBorder (  )  const [inline]

Get the border.

Returns:
The border.
CELLTYPE MIGRIDCELL::GetCellType (  )  const [inline]

Get the "cell type".

Returns:
The "cell type".

See SetCellType() for details.

int MIGRIDCELL::GetCellTypeEx (  )  const [inline]

Get the extra data value for the current cell type.

Returns:
The extra data value for the current cell type.
DATATYPE MIGRIDCELL::GetDataType (  )  const [inline]

Get the data type for the cell.

Returns:
The data type for the cell.
const COLOR& MIGRIDCELL::GetForeColor (  )  const [inline]

Retrieves the color used for drawing.

Returns:
The color used for drawing.
const COLOR& MIGRIDCELL::GetForeColorHilighted (  )  const [inline]

Retrieves the color used for drawing while the cell is hilighted.

Returns:
The color used for drawing while the cell is hilighted.

UGGrid calls this GetHTextColor().

int MIGRIDCELL::GetIconIndex (  )  const [inline]

Return the index of the icon associated with this entry.

Returns the index into the IMAGELIST for this grid. The IMAGELIST Is set with the MIGRIDCTRL::SetImageList() method. If no icon is set, returns -1. If an item has an icon, it will be displayed to the left of its content.

const MIUNICODE* MIGRIDCELL::GetLabelText (  )  const [inline]

Retrieves a const pointer to the label text.

Returns:
A const pointer to the label text. This is NOT the contents of the field. See SetLabelText() for details
int MIGRIDCELL::GetMaxLen (  )  const [inline]

Get the maximum length of the field, (-1) if no max set.

Returns:
The maximum length or -1 if no max is set.
double MIGRIDCELL::GetNumber (  )  const

Retrieves the value of the cell as a number.

Returns:
The value of the cell as a number.

If the cell is a string cell, it converts it to a number. An empty cell will return IEEE_NaN.

int MIGRIDCELL::GetNumberPlaces (  )  const [inline]

Get the number of decimal places to show on numeric fields.

Returns:
The number of decimal places to show on mumeric fields.
void* MIGRIDCELL::GetParam (  )  const [inline]

Gets a general-usage UserData pointer which can be set with SetParam.

bool MIGRIDCELL::GetReadOnly (  )  const [inline]

Sees if is read only.

const MIUNICODE* MIGRIDCELL::GetText (  )  const [inline]

Get pointer to the text.

Returns:
A const pointer to the text.
MIUNICODE* MIGRIDCELL::GetTextCopy (  )  const [inline]

Retrieves a copy of the string which you must free.

Returns:
A copy of the string which you must free, but it's not const.
bool MIGRIDCELL::HasProperty ( PROPERTY  property  )  const [inline]

Check to see if a given property is set on this cell.

This is called IsPropertySet() on the Ultimate Grid Control.

bool MIGRIDCELL::IsEmpty (  )  const [inline]

See if cell has a value.

Returns:
True if the cell has no value.
void MIGRIDCELL::MergeProperties ( const MIGRIDCELL cell,
bool  bBlendColors = false,
PROPERTY  mask = PROP_All 
)

Merges the properties from a given cell into this cell.

Any properties already set in this cell are left alone (except colors which can be blended if set in both cells).

MIGRIDCELL& MIGRIDCELL::operator= ( const MIGRIDCELL  ) 

Assignment operator.

void MIGRIDCELL::SetAlignment ( ALIGNMENT  alignment  ) 

Set the alignment.

void MIGRIDCELL::SetBackColor ( const COLOR color  ) 

Set background color.

void MIGRIDCELL::SetBackColorHilighted ( const COLOR color  ) 

Set the backgound color and make hilighted.

void MIGRIDCELL::SetBool ( bool  state  ) 

Sets a boolean value.

For toggle button type cells, toggles the cell on/off.

void MIGRIDCELL::SetBorder ( BORDER  border  ) 

Set the border.

void MIGRIDCELL::SetCellType ( CELLTYPE  type  ) 

Set the cell to the given cell type.

These are not enums like the SetDataType. Cell types are the result of calling MIGRIDCTRL::AddCellType()

void MIGRIDCELL::SetCellTypeEx ( INT32  val  ) 

Sets a cell "subtype", the value of which depends on the type of cell.

void MIGRIDCELL::SetDataType ( DATATYPE  type  ) 

Set the data type (text, number, bool, etc) for the cell.

void MIGRIDCELL::SetForeColor ( const COLOR color  ) 

Set the foreground color.

void MIGRIDCELL::SetForeColorHilighted ( const COLOR color  ) 

Set the foreground color and make hilighted.

void MIGRIDCELL::SetIconIndex ( int  icon  ) 

Set the index of the icon associated with this entry.

Sets the index into the IMAGELIST for this grid. The IMAGELIST Is set with the MIGRIDCTRL::SetImageList() method. Setting this to -1 means no icon. If an item has an icon, it will be displayed to the left of its content.

void MIGRIDCELL::SetLabelText ( const char *   ) 

Since this is used for naming icons, and we'd like to pass simple hardcoded strings.

For populating lists, you really want to use the Unicode version above.

void MIGRIDCELL::SetLabelText ( const MIUNICODE  ) 

Set the "label".

How this string is used is extremely celltype dependant. The name comes from the UltimateGrid control. It is ignored for most cell types.

CELLTYPE_Dropdown will use it as a list of values for the dropdown list. You seperate the possible values with "\n"s. Be sure that the last one ends in a
or it won't show up

CELLTYPE_Icon Set to the name of the icon to show in the button/label. The string should be of the form "group.name" (since there's only one string and you need to be able to set two parts)

CELLTYPE_IconButton Same as CELLTYPE_Icon, but optionally you can give it two icon names such as "group.officon group.onicon". The second entry will be used when the button is in the on state. To make a button act as a toggle, set the CellTypeEx(CELLTYPEEX_Toggle) and use SetBool() to turn the button on/off

void MIGRIDCELL::SetMaxLen ( int  num  ) 

Set the maximum lenght of the field.

Setting to -1 will make it no maximum.

void MIGRIDCELL::SetNumber ( double  num  ) 

Sets the value of the cell as a number.

Setting a cell to IEEE_NaN will cause it to be "empty".

void MIGRIDCELL::SetNumberDecimals ( int  num  ) 

Set the number of decimal places.

void MIGRIDCELL::SetParam ( void *  ptr  ) 

Sets a general-usage UserData pointer which can be retrieved with GetParam.

void MIGRIDCELL::SetReadOnly ( bool  state  ) 

Set to read only.

void MIGRIDCELL::SetText ( const MIUNICODE  ) 

Set the text that will show in the cell.


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