// 鼠标左键按下事件处理
void CDlgPopup::OnLButtonDown(UINT nFlags, CPoint point)
{
	BOOL bIsSelect = false;
	m_bIsLButtonDblClk = FALSE;

	if(m_pFocusControl != m_pControl && m_pFocusControl != NULL)
	{
		m_pFocusControl->OnFocus(false);
		m_pFocusControl = NULL;
	}
	if (m_pControl)
	{
		if(m_pControl->GetVisible())
		{
			if (m_pControl->PtInRect(point) && m_pControl->OnCheckMouseResponse(nFlags, point))
			{
				bIsSelect = TRUE;
				m_bIsLButtonDown = TRUE;

				m_pFocusControl = m_pControl;
				m_pControl->OnLButtonDown(nFlags, point);	
			}
		}
		else
		{
			m_pControl = NULL;
		}
	}	

	// 当前控件是否可以捕获鼠标
	if (bIsSelect && !m_bIsSetCapture && ((m_pControl == NULL) || m_pControl->OnCheckMouseResponse(nFlags, point)))
	{
		SetCapture();
		m_bIsSetCapture = TRUE;
		ResetControl();

		return;
	}

	// 调用自身的函数
	if(OnLButtonDown(point))
	{
		DrawWindow();	
		return;
	}

	ResetControl();

	//PostMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(point.x, point.y));

	//CWnd::OnLButtonDown(nFlags, point);
}
Exemple #2
0
void CIA6526::OnReset() {
  ResetPorts();
  ResetTimers();
  ResetTOD();
  ResetSDR();
  ResetControl();
}
void NodePalette::disconnectSignals()
{
    // signals and slots disconnetions
    disconnect(editEditButton, SIGNAL(clicked()), this, SLOT(EndEdit()));
    disconnect(DeleteNode, SIGNAL(clicked()), this, SLOT(DelN()));
    disconnect(AddNode, SIGNAL(clicked()), this, SLOT(AddN()));
    disconnect(MoveNode, SIGNAL(clicked()), this, SLOT(MoveN()));
    disconnect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
    disconnect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
    disconnect(ResNode, SIGNAL(clicked()), this, SLOT(ResetControl()));
    disconnect(Res1Node, SIGNAL(clicked()), this, SLOT(Reset1Control()));
    disconnect(BezierClose, SIGNAL(clicked()), this, SLOT(CloseBezier()));
    disconnect(PolySplit, SIGNAL(clicked()), this, SLOT(SplitPoly()));
    disconnect(MoveControl, SIGNAL(clicked()), this, SLOT(MoveK()));
    disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
    disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
    disconnect(PolyMirrorH, SIGNAL(clicked()), this, SLOT(MirrorH()));
    disconnect(PolyMirrorV, SIGNAL(clicked()), this, SLOT(MirrorV()));
    disconnect(PolyShearR, SIGNAL(clicked()), this, SLOT(ShearR()));
    disconnect(PolyShearL, SIGNAL(clicked()), this, SLOT(ShearL()));
    disconnect(PolyShearU, SIGNAL(clicked()), this, SLOT(ShearU()));
    disconnect(PolyShearD, SIGNAL(clicked()), this, SLOT(ShearD()));
    disconnect(RotateCCW, SIGNAL(clicked()), this, SLOT(doRotCCW()));
    disconnect(RotateCW, SIGNAL(clicked()), this, SLOT(doRotCW()));
    disconnect(Shrink, SIGNAL(clicked()), this, SLOT(doShrink()));
    disconnect(Expand, SIGNAL(clicked()), this, SLOT(doExpand()));
    disconnect(Reduce, SIGNAL(clicked()), this, SLOT(doReduce()));
    disconnect(Enlarge, SIGNAL(clicked()), this, SLOT(doEnlarge()));
    disconnect(ResetCont, SIGNAL(clicked()), this, SLOT(ResetContour()));
    disconnect(ResetContClip, SIGNAL(clicked()), this, SLOT(ResetContourToImageClip()));
    disconnect(ResetShape2Clip, SIGNAL(clicked()), this, SLOT(ResetShapeToImageClip()));
}
// 鼠标左键双击事件处理
void CDlgPopup::OnLButtonDblClk(UINT nFlags, CPoint point)
{
	m_bIsLButtonDblClk = TRUE;

	if(m_pControl)
	{
		if(m_pControl->GetVisible() && m_pControl->GetRresponse())
		{
			CRect rc = m_pControl->GetRect();
			m_pControl->OnLButtonDblClk(nFlags, point);				

			if (!rc.PtInRect(point))
			{
				m_pControl = NULL;
			}
		}
		else
		{
			m_pControl = NULL;
		}
	}

	// 调用自身的函数
	if(OnLButtonDblClk(point))
	{
		DrawWindow();
	}

	ResetControl();

	CWnd::OnLButtonDblClk(nFlags, point);
}
void HisMastersVoice::Execute(int cmd, int param)
{
  switch(cmd)
    {
    case 2:
      MarkTarget(param);
      break;
    case 3:
      RevertTarget(param);
      break;
    case 4:
      ResetControl();
      break;
    }
}
LRESULT CDlgPopup::OnMouseLeave(WPARAM wParam, LPARAM lParam)
{
	m_bTracking = FALSE;
	if (!m_bIsLButtonDown)
	{
		if (m_pControl)
		{
			m_pControl->OnMouseMove(0, CPoint(-1, -1));
			ResetControl();
		}

		m_pControl = NULL;
	}

	return 0;
}
void	CReportCtrl::InitControl(int Rows, int Style)
{
	while (DeleteColumn(0));	// delete any existing columns
	for (int i = 0; i < m_Columns; i++) {
		InsertColumn(i, m_Column[i].Title, 
			m_Column[i].Align, m_Column[i].Width, i);
	}
#if _MFC_VER < 0x0700	// if MFC 6
	if (Style & SORT_ARROWS) {
		// create header image list containing sort arrows
		m_HdrImgList.Create(IDB_HEADER_SORT, 8, 0, RGB(0, 128, 128));
		GetHeaderCtrl()->SetImageList(&m_HdrImgList);
	}
#endif
	m_Style = Style;
	ModifyStyle(0, LVS_REPORT);	// force report view
	ResetControl(Rows);
}
void main()
{
  main_thread.Begin();
  while (1)
    {
      char chs[200] = "";
      float p1 = 0, p2 = 0;
      int x = 0;
      scanf("%s", &chs);
      char ch = chs[0];
      scanf("%f", &p1);
      x = (int)(p1+0.5);
      if (ch!='\0')
	{
	  if (ch == 't')
	    {
	      MarkTarget(x);
	    }
	  else if (ch == 'r')
	    {
	      RevertTarget(x);
	    }
	  else if (ch == 'z')
	    {
	      ResetControl();
	    }
	  else if (ch == 'd')
	    {
	      scanf("%f", &p2);
	      p1 *= M_PI*1.1;
	      p2 *= M_PI*1.1;
	      printf("DIRECT (scaled) request for %g %g\n", p1, p2);
	      RequestOrientation(p1,p2);
	    }
	}
      else
	{
	  printf("Tick...\n");
	  YARPTime::DelayInSeconds(1.0);
	}
    }
}
// 鼠标左键放开事件处理
void CDlgPopup::OnLButtonUp(UINT nFlags, CPoint point)
{
	if (m_bIsSetCapture)
	{
		ReleaseCapture();
		m_bIsSetCapture = false;
	}

	m_bIsLButtonDown = FALSE;

	if (m_pControl)
	{
		if(m_pControl->GetVisible())
		{
			CRect rc = m_pControl->GetRect();
			
			m_pControl->OnLButtonUp(nFlags, point);

			if (!rc.PtInRect(point))
			{
				m_pControl = NULL;
			}	
		}
		else
		{
			m_pControl = NULL;
		}
	}

	m_bIsLButtonDblClk = FALSE;

	// 调用自身的函数
	if(OnLButtonUp(point))
	{
		DrawWindow();
	}

	ResetControl();

	CWnd::OnLButtonUp(nFlags, point);
}
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestEditorContainer::~CBCTestEditorContainer()
    {
    ResetControl();   
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestSearchFieldContainer::~CBCTestSearchFieldContainer()
    {
    ResetControl();   
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CTestSDKTPContainer::~CTestSDKTPContainer()
    {
    ResetControl();   
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestScrollerContainer::~CBCTestScrollerContainer()
    {
    ResetControl();   
    }
// --------------------------------------------------------------------------
// Destructor
// --------------------------------------------------------------------------
//
CBCTestToolBarContainer::~CBCTestToolBarContainer()
{
    ResetControl();
}
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestTemplateContainer::~CBCTestTemplateContainer()
    {
    ResetControl();   
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestLocationContainer::~CBCTestLocationContainer()
    {    
    ResetControl();   
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestEikFrmContainer::~CBCTestEikFrmContainer()
    {
    ResetControl();   
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestSkinsContainer::~CBCTestSkinsContainer()
    {
    ResetControl();   
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CBCTestNoteContainer::~CBCTestNoteContainer()
    {
    ResetControl();
    }
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CInputFrameContainer::~CInputFrameContainer()
{

    ResetControl();

}
Exemple #21
0
// 鼠标移动事件处理
void CDlgPopup::OnMouseMove(UINT nFlags, CPoint point)
{
	if (!m_bTracking)
	{
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = m_hWnd;
		tme.dwFlags = TME_LEAVE | TME_HOVER;
		tme.dwHoverTime = 1;
		m_bTracking = ::_TrackMouseEvent(&tme);
	}

	BOOL bInvalidateRect = false;

	if (m_pControl)
	{
		if(((m_pControl->PtInRect(point) && m_pControl->OnCheckMouseResponse(nFlags, point)) || m_bIsLButtonDown) && m_bTracking)
		{			
			m_pControl->OnMouseMove(nFlags, point);
			ResetControl();
			return;
		}
	}

	if (!m_bIsLButtonDown)
	{
		CControlBase * pOldControl = m_pControl;
		BOOL bIsSelect = FALSE;
		BOOL bIsSystemSelect = FALSE;

		if(m_bTracking)
		{
			// 用户控件
			for (size_t i = 0; i < m_vecControl.size(); i++)
			{
				CControlBase * pControlBase = m_vecControl.at(i);
				if (pControlBase)
				{
					pControlBase->OnMouseMove(nFlags, point);
					if (!bIsSystemSelect)
					{
						if(pControlBase->PtInRect(point) && pControlBase->GetRresponse())
						{
							m_pControl = pControlBase;
							bIsSelect = TRUE;
						}
					}						
				}		
			}
		}

		if (!bIsSelect && !bIsSystemSelect)
		{
			m_pControl = NULL;
		}

		// 调用自身的OnMouseMove
		if(OnMouseMove(point))
		{
			DrawWindow();
		}

		ResetControl();
	}
}