BCGSuite for MFC
virtual UINT CBCGPGridCtrl::OnInplaceEditSetSel ( CBCGPGridItem pCurItem,
UINT  nReason 
) const
protectedvirtual

Defines how grid control manages selection of in-place editor content when in-place editor has been created.

Returns

This function returns a combination of the following InplaceEditSetSelFlags:

  • SetSel_CaretByCursor - set caret at the current position of mouse cursor (for example, if you click a grid item to start in-place editing, the caret will be placed at the character nearest to mouse position)
  • SetSel_CaretAtLeft - set caret at the left of in-place edit control
  • SetSel_CaretAtRight - set caret at the right of in-place edit control
  • SetSel_SelectAll - select content of in-place edit control

Override this function in a derived class to customize initial state of in-place edit control.

The default implementation returns SetSel_SelectAll if nReason is BeginEdit_Return or BeginEdit_ComboReturn. In other cases it's SetSel_CaretAtLeft.

nReason can be one of the following enumerated BeginEditFlags flags:

  • BeginEdit_None = 0x0,

Key reasons:

  • BeginEdit_Return = 0x10,
  • BeginEdit_Tab = 0x20,
  • BeginEdit_Left = 0x40,
  • BeginEdit_Right = 0x80,
  • BeginEdit_Up = 0x100,
  • BeginEdit_Down = 0x200,
  • BeginEdit_ArrowBtn = BeginEdit_Left | BeginEdit_Right | BeginEdit_Up | BeginEdit_Down,
  • BeginEdit_F2 = 0x400,
  • BeginEdit_F4 = 0x800,
  • BeginEdit_Shift = 0x1000,
  • BeginEdit_Ctrl = 0x2000,

Other reasons:

  • BeginEdit_ReOpen = 0x4000,
  • BeginEdit_MouseClick = 0x8000,
  • BeginEdit_MouseDblClick = 0x10000,
  • BeginEdit_Char = 0x20000,
  • BeginEdit_ComboOpen = 0x40000,
  • BeginEdit_ComboReturn = 0x80000
Parameters
pCurItemA pointer to currently selected item.
nReasonThe combination of BeginEditFlags, which specifies the reason why in-place editor is created.