Beispiel #1
0
void CMcdCtrl::SetNumbers(long x, long y) 
{
     m_a=x;
	 m_b=y;
	 //控件重绘=>OnDraw()=>Mcd()
	 InvalidateControl();
}
void CLREnvelopeEditorCtrl::OnMButtonDown(UINT nFlags, CPoint point)
{
	switch(m_lMouseMode) {
	case 0:		//add/drag key
		m_lDragMode=3;
		m_lDragAnchor=translateScreenXToEnvelopeX(point.x);
		m_cpDragStart=point;
		if(m_bHasSelection) {
			m_bHasSelection=FALSE;
			InvalidateControl();
		}
		SetCapture();
		break;
	case 1:
		break;
	case 2:
		break;
	case 3:
		break;
	case 4:
		break;
	}
	
	COleControl::OnMButtonDown(nFlags, point);
}
void CLREnvelopeEditorCtrl::OnRButtonDown(UINT nFlags, CPoint point)
{
	BOOL	bRedraw=FALSE;
	switch(m_lMouseMode) {
	case 0:		//add/drag key
		if((keyHitTest(point)==m_lKeyUnderMouse)
			&& (m_lKeyUnderMouse!=-1)) {
			m_lSelectedKey=m_lKeyUnderMouse;
			long i=m_lKeyUnderMouse;
			float fVal,fTens,fCont,fBias;
			long lType;
			try {
				fVal=m_pEnvelope->getKeyValueAtIndex(i);
				fTens=m_pEnvelope->getKeyTensionAtIndex(i);
				fCont=m_pEnvelope->getKeyContinuityAtIndex(i);
				fBias=m_pEnvelope->getKeyBiasAtIndex(i);
				lType=m_pEnvelope->getKeyTypeAtIndex(i);
			}
			catch(LR::Exception &e) {
				AfxMessageBox(e.getDescription());
				return;
			}
			FireKeyValueChanged(fVal);
			FireKeyTensionChanged(fTens);
			FireKeyContinuityChanged(fCont);
			FireKeyBiasChanged(fBias);
			FireKeyTypeChanged(lType);
			bRedraw=TRUE;
		}
		if(m_bMouseOverKeyRange) {
			m_lDragMode=5;	//right,key range
			m_cpDragStart=point;
			bRedraw=TRUE;
			m_lPositionOffset=0;
			m_lFirstKeyPositionBeforeDrag=m_lFirstKeyPosition;
			m_lLastKeyPositionBeforeDrag=m_lLastKeyPosition;
			SetCapture();
		}
		else if((keyHitTest(point)!=-1)) {
			m_lDragMode=2;	//right,single key
			m_lFirstKeyPositionBeforeDrag=m_lFirstKeyPosition;
			m_lLastKeyPositionBeforeDrag=m_lLastKeyPosition;
			m_lDraggedKey=m_lKeyUnderMouse;
			SetCapture();
		}
		break;
	case 1:
		break;
	case 2:
		break;
	case 3:
		break;
	case 4:
		break;
	}
	if(bRedraw) InvalidateControl();
	
	COleControl::OnRButtonDown(nFlags, point);
}
Beispiel #4
0
long CRTabsCtrl::SelectTab(long tab) 
{
	CWnd* currentWindow=SelectTabBody(tab);
	FireSelectTab((long)currentWindow);
	m_iCurrentSelection=tab;
	InvalidateControl();
	return (long)currentWindow;
}
void CLesson18Ctrl::OnTimer(UINT_PTR nIDEvent)
{
    // TODO: 在此添加消息处理程序代码和/或调用默认值
    //Invalidate();
    InvalidateControl();

    COleControl::OnTimer(nIDEvent);
}
Beispiel #6
0
void CCircCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
	// Redraw the control.
	if (InCircle(point))
		InvalidateControl();

	COleControl::OnLButtonUp(nFlags, point);
}
Beispiel #7
0
void CRTreeCtrl::SetText(LPCTSTR text, short index) 
{
	if (m_list[index]!=NULL) delete m_list[index];
	m_list[index]=new char[strlen(text)+1]; // include terminating null character
	// remember to delete it
	strcpy(m_list[index],text);
	InvalidateControl();
}
void CLREnvelopeEditorCtrl::OnMButtonDblClk(UINT nFlags, CPoint point)
{
	if(m_bHasSelection) {
		m_bHasSelection=FALSE;
		InvalidateControl();
	}
	
	COleControl::OnMButtonDblClk(nFlags, point);
}
Beispiel #9
0
void CRTabsCtrl::AddTab(LPCTSTR text, long pWnd) 
{
	char* buffer=new char[strlen(text)+1]; // include terminating null character
	strcpy(buffer,text);
	m_textList.AddTail(buffer);
	m_windowList.AddTail((CWnd*)pWnd);
	TRACE1("Total tabs: %d",m_textList.GetCount());
	InvalidateControl();
}
Beispiel #10
0
void CRJoyCfgCtrl::SetY(long nNewValue) 
{
	if (m_y!=nNewValue)
	{
		m_y=nNewValue;
		SetModifiedFlag();
		InvalidateControl();
	}
}
Beispiel #11
0
void CCircCtrl::SetNote(LPCTSTR lpszNewValue)
{
	if (m_note != lpszNewValue)
	{
		m_note = lpszNewValue;
		SetModifiedFlag();
		InvalidateControl();
		BoundPropertyChanged(dispidNote);
	}
}
Beispiel #12
0
void CCircCtrl::SetCircleOffset(short nNewValue)
{
	// Validate the specified offset value
	if ((m_circleOffset != nNewValue) && m_circleShape && InBounds(nNewValue))
	{
		m_circleOffset = nNewValue;
		SetModifiedFlag();
		InvalidateControl();
	}
}
Beispiel #13
0
void CMcdCtrl::SetNumbers(long x, long y) 
{
	// TODO: Add your dispatch handler code here
	
	m_a = x;
	m_b = y;

	//OnDraw()  会调用  Mcd()
	InvalidateControl();
}
Beispiel #14
0
void CCircCtrl::OnCircleShapeChanged()
{
	SetModifiedFlag();

	// force the control to redraw itself
	InvalidateControl();

	// reset the circle offset, if necessary
	if (m_circleShape)
		SetCircleOffset(0);
}
Beispiel #15
0
void CRTabsCtrl::Clear() 
{
	m_windowList.RemoveAll();
	POSITION position=m_textList.GetHeadPosition();
	for (int x=0;x<m_textList.GetCount();x++)
	{
		delete m_textList.GetNext(position);
	}
	m_textList.RemoveAll();
	InvalidateControl();
}
Beispiel #16
0
void CColorButtonCtrl::SetBevelWidth(short nNewValue)
{
    if (nNewValue < 1 || nNewValue > 10) {
        CString str;
        str.LoadString(IDS_BEVELERROR);
        AfxMessageBox(str, MB_ICONINFORMATION);
        return;
    }
    m_BevelWidth = nNewValue;
    InvalidateControl();
    SetModifiedFlag();
}
Beispiel #17
0
void CSpindialCtrl::SetNeedlePosition(short nNewValue)
{
	// Constrain value to 0..3 range
	if ( (nNewValue > 3) || (nNewValue < 0) )
		m_needlePosition = 0;
	else
		m_needlePosition = nNewValue;

	SetModifiedFlag(TRUE);

	InvalidateControl();
}
Beispiel #18
0
void CRTreeCtrl::SetDepth(long nNewValue) 
{
	Clear();
	m_lDepth=nNewValue;
	int size=(int)pow(2,m_lDepth+1)-1;
	m_list=new char*[size];
	for (int x=0;x<size;x++)
	{
		m_list[x]=NULL;
	}
	InvalidateControl();
	SetModifiedFlag();
}
Beispiel #19
0
void CTimeCtrl::OnAmbientPropertyChange(DISPID dispid)
{
	if (dispid == DISPID_AMBIENT_USERMODE)
	{
		// Start or stop the timer
		if (GetEnabled())
		{
			if (AmbientUserMode())
				StartTimer();
			else
				StopTimer();
		}

		InvalidateControl();
	}
}
Beispiel #20
0
void CRScrlBarCtrl::OnLButtonUp(UINT nFlags, CPoint point) 
{
	m_offset=-1;
	if (m_timerID) 
	{
		KillTimer(m_timerID);
		m_timerID=0;
	}
	if (m_button)
	{
		m_button=0;
		InvalidateControl();
	}
	ReleaseCapture();
	COleControl::OnLButtonUp(nFlags, point);
}
Beispiel #21
0
// NOTE: Host / CPU Thread
void TASInputDlg::SetSliderValue(Control* control, int CurrentValue)
{
  if (CurrentValue != (int)control->default_value)
  {
    control->value = CurrentValue;
    control->set_by_keyboard = true;
  }
  else if (control->set_by_keyboard)
  {
    control->value = control->default_value;
    control->set_by_keyboard = false;
  }
  else
  {
    return;
  }

  InvalidateControl(control);
}
Beispiel #22
0
// NOTE: Host / CPU Thread
void TASInputDlg::SetStickValue(Control* control, int CurrentValue, int center)
{
  if (CurrentValue != center)
  {
    control->value = CurrentValue;
    control->set_by_keyboard = true;
  }
  else if (control->set_by_keyboard)
  {
    control->value = center;
    control->set_by_keyboard = false;
  }
  else
  {
    return;
  }

  InvalidateControl(control);
}
Beispiel #23
0
void CTesthelpCtrl::OnName3Changed()
{
		  SetModifiedFlag();
		  InvalidateControl();
}
void UIRect::SetVisible (bool bVisible)
{
	m_bVisible = bVisible;
	InvalidateControl (false);
}
Beispiel #25
0
void CRTabsCtrl::SetFontNum(long nNewValue) 
{
	m_FontNum=nNewValue;
	InvalidateControl();
	SetModifiedFlag();
}
Beispiel #26
0
void CRTabsCtrl::SetHorzAlign(BOOL bNewValue) 
{
	m_bHorzAlign=bNewValue;
	SetModifiedFlag();
	InvalidateControl();
}
Beispiel #27
0
void CRScrlBarCtrl::SetPageSize(long nNewValue) 
{
	m_pagesize=nNewValue;
	InvalidateControl();
	SetModifiedFlag();
}
Beispiel #28
0
void CRScrlBarCtrl::SetScrollPos(long nNewValue) 
{
	m_iScrollPos=nNewValue;
	InvalidateControl();
	SetModifiedFlag();
}
// *****************************************************************
//		OnDrawingLayersChanged()
// *****************************************************************
void CMapView::OnDrawingLayersChanged()
{
	ScheduleVolatileRedraw();
	if (!_lockCount)
		InvalidateControl();
}
Beispiel #30
0
void CRJoyCfgCtrl::SetControlPicture(LPPICTUREDISP newValue) 
{
	m_pic.SetPictureDispatch(newValue);
	InvalidateControl();
	SetModifiedFlag();
}