コード例 #1
0
ファイル: PageImageProcess.cpp プロジェクト: Binggoo/XRay
void CPageImageProcess::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	CSliderCtrl *pSlider = (CSliderCtrl*)pScrollBar; 
	CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();
	CCOXRayView *pView = (CCOXRayView *)pFrame->GetActiveView();

	//多个 SLIDER 控件控制 
	switch( pSlider->GetDlgCtrlID() ) 
	{ 
	case IDC_SLIDER_GAMMA:
		{
			m_dbEditGamma = tan(RAD(pSlider->GetPos()));

			m_Gamma.SetGamma(m_dbEditGamma);
			
			if (m_bLBDown)
			{
				::SendMessage(pView->GetSafeHwnd(),WM_GAMMA_CHANGE_PREVIEW,0,0);
			}
			
		}
		
		break;
	} 

	CDialogEx::OnHScroll(nSBCode, nPos, pScrollBar);
}
コード例 #2
0
ファイル: CCorrectDialog.cpp プロジェクト: Lamobo/Lamobo-D1
void CCCorrectDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	//if (nSBCode != SB_ENDSCROLL) {
		//CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
		//return;
	//}

	CSliderCtrl * pSliderCtrl = (CSliderCtrl *)pScrollBar;
	int iID = pSliderCtrl->GetDlgCtrlID();
	int iPos = pSliderCtrl->GetPos();

again:
	if (IDC_SLIDER_C11 == iID) {
		m_CCorrect.ccMtrx[0][0] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C11_VAL);
	}else if (IDC_SLIDER_C12 == iID) {
		m_CCorrect.ccMtrx[0][1] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C12_VAL);
	}else if (IDC_SLIDER_C13 == iID) {
		m_CCorrect.ccMtrx[0][2] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C13_VAL);
	}else if (IDC_SLIDER_C21 == iID) {
		m_CCorrect.ccMtrx[1][0] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C21_VAL);
	}else if (IDC_SLIDER_C22 == iID) {
		m_CCorrect.ccMtrx[1][1] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C22_VAL);
	}else if (IDC_SLIDER_C23 == iID) {
		m_CCorrect.ccMtrx[1][2] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C23_VAL);
	}else if (IDC_SLIDER_C31 == iID) {
		m_CCorrect.ccMtrx[2][0] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C31_VAL);
	}else if (IDC_SLIDER_C32 == iID) {
		m_CCorrect.ccMtrx[2][1] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C32_VAL);
	}else if (IDC_SLIDER_C33 == iID) {
		m_CCorrect.ccMtrx[2][2] = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_C33_VAL);
	}else if (IDC_SLIDER_ILOW == iID) {
		m_CCorrect.cc_thrs_low = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_ILOW_VAL);
	}else if (IDC_SLIDER_IHIGH == iID) {
		m_CCorrect.cc_thrs_high = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_IHIGH_VAL);
	}

	if (JudgeHighLow(iID, iPos) == 1) {
		(pSliderCtrl = ((CSliderCtrl *)GetDlgItem(iID)))->SetPos(iPos);
		goto again;
	}

	__super::OnHScroll(nSBCode, nPos, pScrollBar);
}
コード例 #3
0
ファイル: OptionsGeneral.cpp プロジェクト: tchv71/ScadViewer
void COptionsGeneral::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	CDialog::OnHScroll(nSBCode, nPos, pScrollBar);

	if( !pScrollBar || !m_bManualThumbChange)
		return;
	
	CSliderCtrl * pSlider = reinterpret_cast<CSliderCtrl*>( pScrollBar );
	
	if( pSlider && pSlider->GetDlgCtrlID() == IDC_WIDTH_SLIDER )
	{
		int pos = pSlider->GetPos();

		if( m_nThumbnailWidth != pos )
		{
			if( m_bSyncChangeThumbSize )
			{
				int nNewHeight = int(pos/m_fAspect);
				int nMaxHeight, nMinHeight;
				
				m_ThumbHeightSlider.GetRange( nMinHeight, nMaxHeight );
				if( nNewHeight < nMinHeight || nNewHeight > nMaxHeight )
				{
					MessageBeep( MB_ICONEXCLAMATION );
					pSlider->SetPos( m_nThumbnailWidth);
				}
				else
				{
					CSCADString str;

					m_nThumbnailWidth = pos;
					m_nThumbnailHeight = nNewHeight;
					m_bManualThumbChange = false;
					m_ThumbHeightSlider.SetPos( m_nThumbnailHeight);
					m_bManualThumbChange = true;
					str.Format( _T("%d"), m_nThumbnailWidth );
					GetDlgItem( IDC_WIDTH_EDIT )->SetWindowText( str );
					str.Format( _T("%d"), m_nThumbnailHeight );
					GetDlgItem( IDC_HEIGHT_EDIT )->SetWindowText( str );
				}
			}
			else
			{
				CSCADString str;

				str.Format( _T("%d"), pos );
				GetDlgItem( IDC_WIDTH_EDIT )->SetWindowText( str );
				m_nThumbnailWidth = pos;
			}
			UpdateThumbnail();

		}
	}
}
コード例 #4
0
ファイル: DemosaicDialog.cpp プロジェクト: Lamobo/Lamobo-D1
void CDemosaicDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	CSliderCtrl * pSliderCtrl = (CSliderCtrl *)pScrollBar;
	int iID = pSliderCtrl->GetDlgCtrlID();
	int iPos = pSliderCtrl->GetPos();

	if (IDC_SLIDER_THRESOLD == iID) {
		m_Demosaic.threshold = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_THRESOLD_VAL);
	}

	__super::OnHScroll(nSBCode, nPos, pScrollBar);
}
コード例 #5
0
ファイル: BBDialog.cpp プロジェクト: Lamobo/Lamobo-D1
void CBBDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	CSliderCtrl * pSliderCtrl = (CSliderCtrl *)pScrollBar;
	int iID = pSliderCtrl->GetDlgCtrlID();
	int iPos = pSliderCtrl->GetPos();

	if (IDC_SLIDER_R_OFFSET == iID) {
		m_BackBalance.r_offset = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_RVALUE);
	}else if (IDC_SLIDER_G_OFFSET == iID) {
		m_BackBalance.g_offset = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_GVALUE);
	}else if (IDC_SLIDER_B_OFFSET == iID) {
		m_BackBalance.b_offset = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_BVALUE);
	}

	__super::OnHScroll(nSBCode, nPos, pScrollBar);
}
コード例 #6
0
void CMyPage2::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	// 3개의 슬라이더 컨트롤에 대한 반응
	CSliderCtrl* pSlider = (CSliderCtrl*)pScrollBar;

	switch(pSlider->GetDlgCtrlID())
	{
	case IDC_SLIDER1: // 첫 번째 슬라이더 컨트롤 조작시
		SetDlgItemInt(IDC_RED, pSlider->GetPos());
		break;
		
	case IDC_SLIDER2: // 두 번째 슬라이더 컨트롤 조작시
		SetDlgItemInt(IDC_GREEN, pSlider->GetPos());
		break;

	case IDC_SLIDER3: // 세 번째 슬라이더 컨트롤 조작시
		SetDlgItemInt(IDC_BLUE, pSlider->GetPos());
        break;
	}
	
	CurrentFillColor();	// 현재 색상 표시 
	CPropertyPage::OnHScroll(nSBCode, nPos, pScrollBar);
}
コード例 #7
0
ファイル: AWBDialog.cpp プロジェクト: Lamobo/Lamobo-D1
void CAWBDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	//if (nSBCode != SB_ENDSCROLL) {
		//CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
		//return;
	//}

	CSliderCtrl * pSliderCtrl = (CSliderCtrl *)pScrollBar;
	int iID = pSliderCtrl->GetDlgCtrlID();
	int iPos = pSliderCtrl->GetPos();


	int nIndex, num;
	CString GroupValue;

	nIndex = m_ComGroupValue.GetCurSel();
	m_ComGroupValue.GetLBText(nIndex, GroupValue);
	num = _ttoi(GroupValue);

again:
	if (IDC_SLIDER_RHIGH == iID) {
		m_stAwbInfo[num].r_high = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_RH_VAL);
	}else if (IDC_SLIDER_RLOW == iID) {
		m_stAwbInfo[num].r_low = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_RL_VAL);
	}else if (IDC_SLIDER_GHIGH == iID) {
		m_stAwbInfo[num].g_high = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_GH_VAL);
	}else if (IDC_SLIDER_GLOW == iID) {
		m_stAwbInfo[num].g_low = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_GL_VAL);
	}else if (IDC_SLIDER_BHIGH == iID) {
		m_stAwbInfo[num].b_high = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_BH_VAL);
	}else if (IDC_SLIDER_BLOW == iID) {
		m_stAwbInfo[num].b_low = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_BL_VAL);
	}else if (IDC_SLIDER_RGBHIGH == iID) {
		m_stAwbInfo[num].grb_high = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_RGBH_VAL);
	}else if (IDC_SLIDER_RGBLOW == iID) {
		m_stAwbInfo[num].grb_low = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_RGBL_VAL);
	}else if (IDC_SLIDER_GRHIGH == iID) {
		m_stAwbInfo[num].gr_high = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_GRH_VAL);
	}else if (IDC_SLIDER_GRLOW == iID) {
		m_stAwbInfo[num].gr_low = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_GRL_VAL);
	}else if (IDC_SLIDER_GBHIGH == iID) {
		m_stAwbInfo[num].gb_high = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_GBH_VAL);
	}else if (IDC_SLIDER_GBLOW == iID) {
		m_stAwbInfo[num].gb_low = iPos;
		ProcessStaticText(pSliderCtrl, IDC_STATIC_GBL_VAL);
	}else {
		fprintf(stderr, "AWB page Unknown slider ID(%d)\n", iID);
	}
	
	if (JudgeHighLow(iID, iPos) == 1) {
		(pSliderCtrl = ((CSliderCtrl *)GetDlgItem(iID)))->SetPos(iPos);
		goto again;
	}

	CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}