Example #1
0
void CDisplayView::mouse(CDrawContext *dstcon, CPoint &where)
{
  unsigned long delta=250, ticks = getParent()->getTicks();
  bool dblclick = false;
	long button = dstcon->getMouseButtons();

  if (!(button & kLButton))
  {
		return;
  }

  dblclick = (ticks-stTicks)<delta;
  stTicks = ticks;

  if(dblclick)
  {
    if(mEdit)
    {
      getParent()->setEditView(this);
      setBackColor(kGreyCColor);
      setFontColor(kWhiteCColor);
      setText(mText);
      takeFocus(dstcon);
      mDrawText = true;
    }
  }
  else
  {
    if(mParentView)
    {
      mParentView->notify(mView,(const char *)VNTF_MOUSE);
      mParentView->mouse(dstcon,where);
    }
  }
}