예제 #1
0
void CLineComputeView::OnSliderViewzoom()
{

    CMainFrame *pMain = (CMainFrame *)AfxGetApp()->m_pMainWnd;
    CMFCRibbonSlider *pSlider = DYNAMIC_DOWNCAST(CMFCRibbonSlider, pMain->m_wndRibbonBar.FindByID(ID_SLIDER_VIEWZOOM));
    scale = pSlider->GetPos()/10.0f;
    RenderScene();

}
예제 #2
0
int CMainFrame::GetSliderPos (UINT nID)
{
	CArray<CMFCRibbonBaseElement*, CMFCRibbonBaseElement*> ar;
	CArray<CMFCRibbonBaseElement*, CMFCRibbonBaseElement*> ar2;
	m_wndRibbonBar.GetElementsByID (ID_RIBBON_OBTN_5, ar);
	m_wndRibbonBar.GetElementsByID (ID_RIBBON_OBTN_6, ar2);

	ar.Append (ar2);

	int nPos1 = -1;
	int nPos2 = -1;

	for (int k = 0; k < 2; k++)
	{
		for (int i = 0; i < ar.GetSize (); i++)
		{
			CMFCRibbonSlider* pSlider = DYNAMIC_DOWNCAST (CMFCRibbonSlider, ar[i]);
			if (pSlider != NULL)
			{
				if (k == 0)
				{
					if (pSlider->GetID () != nID)
					{
						nPos2 = pSlider->GetPos ();
						nPos1 = nPos2;
						break;
					}
				}
				else
				{
					if (pSlider->GetID () == nID)
					{
						if (pSlider->GetPos () != nPos2)
						{
							nPos1 = pSlider->GetPos ();
						}
					}
				}
			}
		}
	}

	return nPos1;
}
예제 #3
0
// Return the factor of zooming the rectangle
double CRibbonAppDoc::GetSliderFactor(void)
{
    // Get a pointer to the ribbon bar
    CMFCRibbonBar* pRibbon = ((CMDIFrameWndEx*) AfxGetMainWnd())->GetRibbonBar();
    ASSERT_VALID(pRibbon);

    CMFCRibbonSlider* pSlider = DYNAMIC_DOWNCAST(CMFCRibbonSlider, pRibbon->FindByID(ID_RECT_SLIDER));
    // Get current position
    int position =pSlider->GetPos();
    return (double)position/(double)pSlider->GetRangeMax();
}
예제 #4
0
void CMainFrame::SetSliderPos (int nPos, UINT nID)
{
	CArray<CMFCRibbonBaseElement*, CMFCRibbonBaseElement*> ar;
	m_wndRibbonBar.GetElementsByID (nID, ar);

	for (int i = 0; i < ar.GetSize (); i++)
	{
		CMFCRibbonSlider* pSlider = DYNAMIC_DOWNCAST (CMFCRibbonSlider, ar[i]);
		if (pSlider != NULL)
		{
			if (pSlider->GetPos () != nPos)
			{
				pSlider->SetPos (nPos);
			}
		}
	}
}