<< Return to Main Index

< Return to Class Index

CGXGridParam::m_nDisplayExpression

WORD m_nDisplayExpression;

Remarks

Toggles the display of formula expressions in inactive cells:

When using the formula engine, the default is GX_EXPR_DISPLAYACTIVE. The edit control will display formulas in the cell.

Otherwise the default is GX_EXPR_DISPLAYNEVER .

When you change this setting you will notice a change of behavior in the CGXEditControl::SetValue method. With GX_EXPR_DISPLAYNEVER CGXEditControl::SetValue calls GetControlText to convert the style value into the display text for the cell. With GX_EXPR_DISPLAYACTIVE CGXEditControl::SetValue will not call GetControlText and directly call SetWindowText.

Example:

void CGXEditControl::SetValue(LPCTSTR pszRawValue)
{
   // Convert the value to the text which should be
   // displayed in the current cell and show this
   // text.

   if (m_hWnd == NULL)
      return;

   if (Grid()->GetParam()->m_nDisplayExpression & GX_EXPR_DISPLAYACTIVE)
   {
      if (pszRawValue)
         SetWindowText(pszRawValue);
      else
         SetWindowText(Grid()->GetExpressionRowCol(m_nRow, m_nCol));
   }
   else
   {
      CString sText;
      GetControlText(sText, m_nRow, m_nCol, pszRawValue, *m_pStyle);
      SetWindowText(sText);
   }

   if (IsActive())
   {
      Grid()->DelayFloatCells(CGXRange(m_nRow, m_nCol));
      Grid()->EvalFloatCells(CGXRange(m_nRow, m_nCol));
      Grid()->EvalVisibleFloatMergeCells(CGXRange(m_nRow, m_nCol, Grid()->GetLastVisibleRow(), Grid()->GetLastVisibleCol()), TRUE);
   }
}

Also, the behavior of the CGXStatic::Draw method changes. With GX_EXPR_DISPLAYNEVER or GX_EXPR_DISPLAYINACTIVE CGXStatic::Draw calls GetControlText to convert the style value into the display text for the cell. With GX_EXPR_DISPLAYALWAYS CGXStatic::Draw will only call GetExpressionRowCol and not GetControlText any more.

See Also

CGXStatic CGXEditControl CGXGridCore::GetExpressionRowCol CGXControl::GetControlText CGXControl::SetValue

CGXGridParam

Class Overview | Class Members