<< Return to Main Index

< Return to Class Index

CGXGridCore::ChangeStylesMap

virtual BOOL ChangeStylesMap(const CGXStylesMap& stylesMap, UINT nFlags = GX_UPDATENOW, GXCmdType ctCmd = gxDo);

stylesMap

A reference to the styles-map object with the new settings. The settings will be copied to the styles-map object that is attached to the grid.

nFlags

GX_INVALIDATE - invalidates the window

ctCmd

Specifies if the executed command is undone (gxUndo), redone (gxRedo), executed the first time (gxDo) or rolled back (gxRollback).

Return Value

TRUE if the command has been successfully executed; it is FALSE if the command failed.

Remarks

Call this method if you want to reinitialize the styles-map, for example after you have displayed the CGXStylesDialog and the user did make changes to the base-styles. The user will be able to undo these changes.

Here is how you should open the styles dialog and then apply the changes to the grid:

void CMyGridView::OnFormatStyles()
{
   CGXStylesDialog dlg;
   dlg.SetStylesMap(*GetParam()->GetStylesMap());
   dlg.SetParam(GetParam());

   if (dlg.DoModal() == IDOK)
      ChangeStylesMap(dlg.GetStylesMap());
}

See Also

CGXStylesDialog CGXStylesMap

CGXGridCore

Class Overview | Class Members