CGXDateTimeCtrl::EditableGadgetFromPoint
EditableGadgetFromPoint(CPoint point));
point
Point from which an editable gadget is to be located.
Remarks
EditableGadgetFromPoint is called to help activate the correct gadget under the point where the user clicked the control. The following code snippet from CGXDateTimeCtrl::LButtonUp shows how this call helps position to the correct gadget.
if (m_hWnd)
{
// See if there is an editable gadget under this point
int n = EditableGadgetFromPoint(pt);
if (n != INT_MAX && (Grid()->GetParam()->GetActivateCellFlags() & GX_CAFOCUS_CLICKINTEXT) > 0
|| Grid()->GetParam()->GetActivateCellFlags()&(GX_CAFOCUS_CLICKONCELL|GX_CAFOCUS_SETCURRENT))
{
if (IsActive())
PositionGadget(nFlags, pt);
else if ((nHitState&GX_SELECT) == 0 // set active when no cells were selected
&& OnStartEditing())
{
CRect rect = GetCellRect(m_nRow, m_nCol);
pt -= rect.TopLeft();
SetActive(TRUE);
Refresh();
//We now position the correct gadget
PositionGadget(nFlags, pt);