void CCtrlDialog::OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	*pResult = 0;

	CMainFrame *pMain = (CMainFrame *)AfxGetMainWnd();
	CSLDRView * pView = (CSLDRView *)(pMain->GetActiveView());
	CSLDRDoc* pDoc = pView->GetDocument();

	HTREEITEM iTem = m_bodyEleTree.GetSelectedItem();
	if(iTem == NULL) return;
	CString strSelItem = m_bodyEleTree.GetItemText(iTem);

	HTREEITEM rootItem, tempItem = iTem;
	do {
		rootItem = tempItem;
		tempItem = m_bodyEleTree.GetParentItem(tempItem);
	} while(tempItem != NULL);

	// Set selected item's information
	pDoc->m_selectedItem.m_strSelectedItem = strSelItem;
	CString rootStr = m_bodyEleTree.GetItemText(rootItem);
	rootStr = rootStr.Mid(rootStr.Find(' ')+1);
	pDoc->m_selectedItem.m_bodyIndex = atoi(rootStr.GetBuffer(rootStr.GetLength()));

	pView->Invalidate();
}
// CDlgMAFMARQuery message handlers
void CDlgMAFMARQuery::OnBnClickedBtnMafMarServicePlanReq()
{
	//1.先显示MAF phase 1对话框。
	UpdateData(TRUE);

	if ( m_strMARSSC.IsEmpty() )
	{
		AfxMessageBox(_T("SSC 不可以为空!"));
		return;
	}

	//先判断下时间填写是否正确
	CTime newStartTime;
	CTime newEndTime;
	GetNewStartEndDataTime(newStartTime, newEndTime);

	if (newStartTime >= newEndTime)
	{
		AfxMessageBox(_T("错误:'结束时间'早于或等于'开始时间'!"));
		return ;
	}

	//2.隐藏自己。
	this->ShowWindow(SW_HIDE);

	//3.3D下绘制信号线:pocc--->地面站
	CMainFrame* pMain = (CMainFrame*)AfxGetApp()->GetMainWnd();
	if (NULL != pMain)
	{
		CDASSimulationView* pView = (CDASSimulationView*)(pMain->GetActiveView());
		pView->StartDrawMAFMARPhase1ReuestSignal(TRUE);
	}	

}
Exemple #3
0
//--------------------------------------------------------------------------
//면 타입 설정
//--------------------------------------------------------------------------
//외곽선만 그리기
void CDrawProperty::OnClickedFaceType()
{
	UpdateData();
	CDrawPropertyValue::m_nsFaceType = m_nsFaceType;

	//////////////////////////////////////////////////////////////////////////
	//외곽선만 그릴 경우 컨트롤들의 비활성화
	m_sFillPtnCombo.EnableWindow(FALSE); //채우기 패턴(해치 타입) 비활성화
	//브러쉬(채우기)타입 라디오버튼 비활성화
	m_sFillTypeSolid.EnableWindow(FALSE);
	m_sFillTypeHatch.EnableWindow(FALSE);
	m_sFillTypeGradient.EnableWindow(FALSE);
	m_sLineJoinCombo.EnableWindow();

	m_sFillPtnCombo.EnableWindow(FALSE);//Hatch 패턴 콤보 박스 비활성화
	m_sGradientCombo.EnableWindow(FALSE); //그라디언트 콤보 박스 비활성화
	m_sFillColorBtn.EnableWindow(FALSE); //채우기색 버튼 비활성화
	m_sGradientEndColorBtn.EnableWindow(FALSE); //그라디언트 끝 색 버튼 비활성화

	//////////////////////////////////////////////////////////////////////////
	//뷰 영역에 외부명령임을 알리고, 브러쉬 패턴을 바꾸는 함수를 호출
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	pView->m_bExternalCmd = TRUE;
	pView->OnDrawpropertyBrushpattern();

	//모달리스 다이얼로그들과 동기화 작업
	if(pView->m_dlgBrushPtn != NULL)
		pView->m_dlgBrushPtn->SetDrawStyle();
}
/**
 *
 * \param nFlags 
 * \param point 
 */
void	CUnitListBox::OnLButtonUp(UINT nFlags, CPoint point)
{
	if (m_bDragging && m_pDragImage != NULL)
	{
		ReleaseCapture ();

		m_bDragging = FALSE;

		m_pDragImage->DragLeave (GetDesktopWindow ());
		m_pDragImage->EndDrag ();
		delete m_pDragImage;

		CPoint pt(point);
		ClientToScreen(&pt);
		
		CWnd* pDropWnd = WindowFromPoint (pt);
		if (pDropWnd)
		{
			if (pDropWnd->IsKindOf (RUNTIME_CLASS (CView)))
			{
				CMainFrame* pMainFrame = (CMainFrame*)(AfxGetMainWnd());
				if (pMainFrame)
				{
					
					wmCreateUnit c;
					strcpy(c.Name, m_szFileName.GetBuffer());

					// 通知文件窗口
					::SendMessage(pMainFrame->GetActiveView()->m_hWnd,
						WM_CREATE_UNIT, (WPARAM)&c, NULL);
				}
			}
		}
	}
}
Exemple #5
0
//blue edit
void CDarkStormyDlg::OnEnUpdateDarkStormyBlueValue()
{
	// TODO:  RICHEDIT 컨트롤인 경우, 이 컨트롤은
	// CDialogEx::OnInitDialog() 함수를 재지정 
	//하여, IParam 마스크에 OR 연산하여 설정된 ENM_SCROLL 플래그를 지정하여 컨트롤에 EM_SETEVENTMASK 메시지를 보내지 않으면
	// 편집 컨트롤이 바뀐 텍스트를 표시하려고 함을 나타냅니다.

	// TODO:  여기에 컨트롤 알림 처리기 코드를 추가합니다.
	CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();            //View호출
	CMakoryView* pView = (CMakoryView*)pFrame->GetActiveView();      //View호출

	if(UpdateData(TRUE)){

		int ipos;
		double dpos;
		CString String;

		mDarkStormyBlueValue.GetWindowTextA(String);
		ipos = _ttoi(String);
		mDarkStormyBlueS.SetPos(ipos);
		dpos = (double)ipos * 0.00392156; //슬라이더는 소숫점이 사용이 안됨
		pView->HotAirBalloon.darkstormyblue=dpos;//풍선 빨간색값을 바꿔줌

		pView->Invalidate(FALSE);
	}
}
Exemple #6
0
//외곽선은 그리지 않고 채우기만하기
void CDrawProperty::OnFaceOnlyfill()
{
	UpdateData();
	CDrawPropertyValue::m_nsFaceType = m_nsFaceType;

	//////////////////////////////////////////////////////////////////////////
	//컨트롤 활성화/비활성화
	m_sFillPtnCombo.EnableWindow();
	m_sFillTypeSolid.EnableWindow();
	m_sFillTypeHatch.EnableWindow();
	m_sFillTypeGradient.EnableWindow();
	m_sLineJoinCombo.EnableWindow(FALSE);

	AdjustControl();

	//////////////////////////////////////////////////////////////////////////
	//뷰 영역에 외부명령임을 알리고, 브러쉬 패턴을 바꾸는 함수를 호출
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	pView->m_bExternalCmd = TRUE;
	pView->OnDrawpropertyBrushpattern();

	//모달리스 다이얼로그들과 동기화 작업
	if(pView->m_dlgBrushPtn != NULL)
		pView->m_dlgBrushPtn->SetDrawStyle();
}
Exemple #7
0
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);
}
Exemple #8
0
void CPageImageProcess::OnBnClickedBtnGamma()
{
	// TODO: 在此添加控件通知处理程序代码
	UpdateData(TRUE);
	CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();
	CCOXRayView *pView = (CCOXRayView *)pFrame->GetActiveView();
	::SendMessage(pView->GetSafeHwnd(),WM_GAMMA_CHANGE_ENSURE,0,0);
}
Exemple #9
0
void CMSInfoDlg::PostNcDestroy() 
{
	CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
	((CServerToolView*)pMainFrame->GetActiveView())->m_pMSInfoDlg = NULL;

	delete this;
	
	CDialog::PostNcDestroy();
}
Exemple #10
0
void CDxfset::OnOK()
{
    CMainFrame *pMain = (CMainFrame*)AfxGetApp()->m_pMainWnd;//獲取已建立的View指針
    CHM_MachineView *pView = (CHM_MachineView *)pMain->GetActiveView();
    CCompiler* pCompiler = (CCompiler*)pView->m_DlgArray.GetAt(1);
    pCompiler->m_DxfRate = GetDlgItemInt(IDC_EDITCOMDXFRATE);
    GetDlgItemText(IDC_EDITCOMDXFZDOWN, pCompiler->m_DxfZdown);
    AfxGetMainWnd()->SetLayeredWindowAttributes(0, (255 * 100) / 100, LWA_ALPHA);//主視恢復窗透明化
    CDialogEx::OnOK();
}
Exemple #11
0
CClientView* CMFCUtil::getActiveView()
{
	CMainFrame* fram = CMFCUtil::getMainFrame();
	if (fram != NULL)
	{
		CClientView*   pView = (CClientView*)fram->GetActiveView();
		return pView;
	}
	return NULL;
}
Exemple #12
0
void ThreadCheckVersion()
{
	//app dir
	CString myAppDir;
	CMyCommApp *myApp = (CMyCommApp *)AfxGetApp();
	CMainFrame * myMain = (CMainFrame *) myApp->GetMainWnd();
	CStdioFile myfile;
	myAppDir = myApp->m_AppDir;
	CString vertext = myAppDir + "\\version";
	if(!myfile.Open(vertext,CFile::modeRead))
	{
		
		CString myver;
		char s[256];
		_tcscpy(s,vertext.GetBuffer(vertext.GetLength())) ;
		if(myMain->DonwLoadFile("https://github.com/liquanhai/LSDComm/version/ver.txt",
			s))
			myMain->m_IsNewVertxt = TRUE;
		return;
	}
	else{
	   CString myverion;
	   myfile.ReadString(myverion); //line:1
	   myverion.TrimLeft();  myverion.TrimRight();
       if (atof(myApp->m_AppVersion)<atof(myverion))
	   {
			//new version
			CMyCommView * myview = (CMyCommView *) myMain->GetActiveView();
			//myview->m_EditLogger.AddText(vertext);
			//myview->m_EditLogger.AddText(myApp->m_AppVersion+"\r\n");
			myview->m_EditLogger.AddText(">>最新版本:"+myverion+"\r\n");
			CString strLine;
			myfile.ReadString(strLine); // downfilename line:2
			myApp->m_downfileexefilename = strLine;
			myfile.ReadString(strLine); //line:3
			myview->m_EditLogger.AddText(">>"+strLine +"\r\n");
			myview->m_EditLogger.AddText(">>升级点击主菜单的[帮助]->[在线升级]\r\n");

			myfile.Close();
			myMain->m_IsNewVertxt = TRUE;
	   }
	   else{
		   
		   char s[256];
		   _tcscpy(s,vertext.GetBuffer(vertext.GetLength())) ;
		   if(myMain->DonwLoadFile("https://github.com/liquanhai/LSDComm/version/ver.txt",
			   s))
				myMain->m_IsNewVertxt = TRUE;
		   myfile.Close();
		   
		   return;
	   }
	}
	
}
Exemple #13
0
void ThreadCheckVersion()
{
#if 1
	//app dir
	CString myAppDir;
	CMyCommApp *myApp = (CMyCommApp *)AfxGetApp();
	CMainFrame * myMain = (CMainFrame *) myApp->GetMainWnd();
	CStdioFile myfile;
	myAppDir = myApp->m_AppDir;
	CString vertext = myAppDir + "\\version";
	if(!myfile.Open(vertext,CFile::modeRead))
	{
		
		CString myver;
		char s[256];
		_tcscpy(s,vertext.GetBuffer(vertext.GetLength())) ;
		if(myMain->DonwLoadFile("http://git.oschina.net/yihui/lsdcomm/raw/master/release/version.txt",
			s))
			myMain->m_IsNewVertxt = TRUE;
		return;
	}
	else{
	   CString myverion;
	   myfile.ReadString(myverion); //line:1
	   myverion.TrimLeft();  myverion.TrimRight();
       if (atof(myApp->m_AppVersion)<atof(myverion))
	   {
			//new version
			CMyCommView * myview = (CMyCommView *) myMain->GetActiveView();
			//myview->m_EditLogger.AddText(vertext);
			//myview->m_EditLogger.AddText(myApp->m_AppVersion+"\r\n");
			myview->m_EditLogger.AddText(">>Latest Version:"+myverion+"\r\n");
			CString strLine;
			myfile.ReadString(strLine); // downfilename line:2
			myApp->m_downfileexefilename = strLine;
			myfile.ReadString(strLine); //line:3
			myview->m_EditLogger.AddText(">>"+strLine +"\r\n");
			myview->m_EditLogger.AddText(">>Click menu[Help]->[Upgrade]\r\n");

			myfile.Close();
			myMain->m_IsNewVertxt = TRUE;
	   }
	   else{
		   char s[256];
		   _tcscpy(s,vertext.GetBuffer(vertext.GetLength())) ;
		   if(myMain->DonwLoadFile("http://git.oschina.net/yihui/lsdcomm/raw/master/release/version.txt",
			   s))
				myMain->m_IsNewVertxt = TRUE;
		   myfile.Close();
		   
		   return;
	   }
	}
#endif
}
Exemple #14
0
void CMyDlg::OnRecoEvent()
{
	//CMyPackManApp *pApp = (CMyPackManApp *)AfxGetApp();   //View -> App
	CMainFrame *pMain = (CMainFrame *)AfxGetMainWnd();  //View -> MainFrm
	CMyPackManView *pView = (CMyPackManView *)pMain->GetActiveView();

	USES_CONVERSION;
	CSpEvent event;
	//MessageBox(L"A");
	while (event.GetFrom(m_cpRecoCtxt) == S_OK)
	{

		switch (event.eEventId)
		{
		case SPEI_RECOGNITION:
		{
			m_bReco = TRUE;
			static const WCHAR wszUnrecognized[] = L"fail";

			CSpDynamicString dstrText;
			if (FAILED(event.RecoResult()->GetText(SP_GETWHOLEPHRASE, SP_GETWHOLEPHRASE, TRUE,
				&dstrText, NULL)))
			{
				dstrText = wszUnrecognized;
			}

			dstrText.Append(L" ");

			m_Edit = dstrText;

			//if (m_Edit == "up " || m_Edit == "Up " || m_Edit == "Down " || m_Edit == "down " || m_Edit == "left " || m_Edit == "Left " || m_Edit == "Right " || m_Edit == "right "
			//	|| m_Edit == "let " || m_Edit == "light " || m_Edit == "night ")
			//	pView->m_EditV = m_Edit;
			////::SendDlgItemMessage(m_hWnd, IDC_EDIT_DICT, EM_REPLACESEL, TRUE, (LPARAM)W2T(dstrText));
			//UpdateData(TRUE);
			//m_pView->Invalidate();

			if (m_Edit == "down " || m_Edit == "Down ")
				m_pView->mKey = DOWN;
			else if (m_Edit == "up " || m_Edit == "Up ")
				m_pView->mKey = UP;
			else if (m_Edit == "one " || m_Edit == "One ")
				m_pView->mKey = LEFT;
			else if (m_Edit == "two " || m_Edit == "Two ")
				m_pView->mKey = RITE;

			UpdateData(TRUE);
			//UpdateData(FALSE);

		}
		break;
		}
	}
}
void CDialogT3::OnTimer(UINT_PTR nIDEvent)
{
    CMainFrame* pMain = (CMainFrame*)AfxGetApp()->m_pMainWnd;
    CView* pNewView = pMain->m_pViews[5];
    CView* pActiveView = pMain->GetActiveView();

    if ( pNewView != pActiveView )    // current is minipanel dialog
    {
        KillTimer(T3_MODEL);
    }

#if 1
    static int nCount = 0,nCount2 = 0;

    nCount++;
    nCount2++;

    if (T3_MODEL == nIDEvent)
    {
        CTime now;
        now = CTime::GetCurrentTime();
        //m_datetime = now.Format(_T("%A,%B %d,%Y  %H:%M:%S"));		// "Saturday, April 12, 2012"

        //UpdateData(FALSE);

        if (nCount% 30 == 0)
        {

            nCount = 0;
            BOOL flag=MiniUpdateData();

            if (flag)
            {
                ShowDialogData();
                SetPaneString(2,_T("Online!"));

            }

        }
        if (nCount2%60*10 == 0)
        {
            nCount2 = 0;
            Updatedatabase();

        }


    }

#endif

    CFormView::OnTimer(nIDEvent);
}
BOOL CPropPage_Groups::OnSetActive() 
{
	CMainFrame* pMainFrame = (CMainFrame*) (AfxGetApp()->m_pMainWnd);
	CPostMostView* pView = (CPostMostView*) pMainFrame->GetActiveView();

#ifdef INCLUDESOUND
	if(pView->m_Settings.m_bSound)
		PlaySound((LPCTSTR) IDR_WAVE_CLAP, NULL, SND_ASYNC | SND_RESOURCE | SND_NOSTOP);
#endif

	return CPropertyPage::OnSetActive();
}
void CAirQuality::OnTimer(UINT_PTR nIDEvent)
{
	CMainFrame* pMain = (CMainFrame*)AfxGetApp()->m_pMainWnd;
	CView* pNewView = pMain->m_pViews[7];
	CView* pActiveView = pMain->GetActiveView();

	if ( pNewView != pActiveView )    // current is minipanel dialog
	{
		KillTimer(AirQualityTimer);
	}

#if 1
	static int nCount = 0,nCount2 = 0,scantime = 30;

	nCount++;
	nCount2++;

	if (AirQualityTimer == nIDEvent)
	{
		CTime now;
		now = CTime::GetCurrentTime();
		m_clock = now.Format(_T("%A,%B %d,%Y  %H:%M:%S"));		// "Saturday, April 12, 2012"		

		UpdateData(FALSE);

		if (nCount%scantime == 0)
		{

			nCount = 0;

			if (prodtopc())
			{
				ShowAirqualityDialog();
				SetPaneString(1,_T("Online!"));

				if (writedb)
				{
					pctodb();
					writedb = FALSE;
					scantime = 60*3;
				}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
			}
			

		}



	}

#endif
CFormView::OnTimer(nIDEvent);
}
Exemple #18
0
// CDxfset 訊息處理常式
BOOL CDxfset::OnInitDialog()
{
    CDialogEx::OnInitDialog();
    AfxGetMainWnd()->SetLayeredWindowAttributes(0, (255 * 70) / 100, LWA_ALPHA);//主視窗透明化
    CMainFrame *pMain = (CMainFrame*)AfxGetApp()->m_pMainWnd;//獲取已建立的View指針
    CHM_MachineView *pView = (CHM_MachineView *)pMain->GetActiveView();
    CCompiler* pCompiler = (CCompiler*)pView->m_DlgArray.GetAt(1);
    SetDlgItemInt(IDC_EDITCOMDXFRATE, pCompiler->m_DxfRate);
    SetDlgItemText(IDC_EDITCOMDXFZDOWN, pCompiler->m_DxfZdown);
    return TRUE;  // return TRUE unless you set the focus to a control
                  // EXCEPTION: OCX 屬性頁應傳回 FALSE
}
Exemple #19
0
//--------------------------------------------------------------------------
// 투명도 지정
//--------------------------------------------------------------------------
void CDrawProperty::SetAlphaSpin(void)
{
	if(m_sAlphaSpin.GetSafeHwnd())
		m_sAlphaSpin.SetPos(CDrawPropertyValue::m_nsAlpha);

	//모달리스 다이얼로그들과 동기화 작업
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	if(pView->m_dlgBrushPtn != NULL)
		pView->m_dlgBrushPtn->SetAlphaSpin();
	if(pView->m_dlgLinePtn != NULL)
		pView->m_dlgLinePtn->SetAlphaSpin();
}
Exemple #20
0
//--------------------------------------------------------------------------
//펜 스타일 설정
//--------------------------------------------------------------------------
void CDrawProperty::OnSelchangeLinepattern()
{
	CDrawPropertyValue::m_nsPenStyle  = m_sLinePtnCombo.GetCurSel();
	//뷰 영역에 외부명령임을 알리고, 라인 패턴을 바꾸는 함수를 호출
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	pView->m_bExternalCmd = TRUE;
	pView->OnDrawpropertyLinepattern();

	//모달리스 다이얼로그들과 동기화 작업
	if(pView->m_dlgLinePtn != NULL)
		pView->m_dlgLinePtn->SetLinePattern();
}
Exemple #21
0
//--------------------------------------------------------------------------
//채우기 색
//--------------------------------------------------------------------------
void CDrawProperty::OnBnClickedButtonFillcolor()
{
	CColorDialog dlg;
	if (dlg.DoModal() == IDOK) 
	{
		CDrawPropertyValue::m_sBrushColor = dlg.GetColor(); //채우기 색 지정
		Invalidate(TRUE); //바꾼 색으로 버튼 색 변경
	}
	//뷰 영역에 브러쉬 컬러(채우기색)를 바꾸는 메시지를 날림
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	pView->SendMessage(UM_CHANGEFILLCOLOR);
}
Exemple #22
0
//--------------------------------------------------------------------------
// 라인 색
//--------------------------------------------------------------------------
void CDrawProperty::OnBnClickedButtonFgcolor()
{
	CColorDialog dlg;
	if (dlg.DoModal() == IDOK)
	{
		CDrawPropertyValue::m_sLineColor = dlg.GetColor(); //라인색 지정
		Invalidate();
	}
	//뷰 영역에 라인컬러를 바꾸는 메시지를 날림
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	pView->SendMessage(UM_CHANGELINECOLOR);
}
Exemple #23
0
void CStageEyeDialog::OnKillfocusEyeClipfront()
{
    // TODO: Add your control notification handler code here
    CMainFrame *pMainFrame = (CMainFrame *)GetTopLevelFrame();
    if (!pMainFrame || !pMainFrame->IsKindOf(RUNTIME_CLASS(CMainFrame)))
    {
        return;
    }
    CStageView *pView = (CStageView *)pMainFrame->GetActiveView();
    if (!pView || !pView->IsKindOf(RUNTIME_CLASS(CStageView)))
    {
        return;
    }
    CStageDoc *pDoc = pView->GetDocument();
    if (!pDoc || !pDoc->IsKindOf(RUNTIME_CLASS(CStageDoc)))
    {
        return;
    }
    CWnd *pCBox;
    char s[32];
    GLdouble clipFront;
    RECT rect;

    pMainFrame->GetWindowRect(&rect);
    if (rect.right - rect.left < YO_THRESH_WIDTH || pMainFrame->m_wndDlgEyeVisible == FALSE
            || pMainFrame->m_wndDlgEye == NULL)
    {
        return;
    }

    pCBox = (CComboBox*)pMainFrame->m_wndDlgEye->GetDlgItem(IDC_EYE_CLIPFRONT);
    pCBox->GetWindowText(s, 32);
    sscanf(s, "%lf", &clipFront);
    pView->m_clipFront = clipFront / pDoc->m_unitScaleFactor;

    pView->m_clipFront = YO_MAX(pView->m_clipFront, 0.1);
    pView->m_clipFront = YO_MIN(pView->m_clipFront, pView->m_clipRear);
    sprintf(s, "%.2lf", pView->m_clipFront * pDoc->m_unitScaleFactor);
    pCBox->SetWindowText(s);
    pCBox->UpdateWindow();

    ::glMatrixMode(GL_PROJECTION);
    ::glLoadIdentity();
    ::gluPerspective(pView->m_fieldOfView, pView->m_aspectRatio,
                     pView->m_clipFront, pView->m_clipRear);
    ::glMatrixMode(GL_MODELVIEW);

    pView->YoRender(YO_RENDER_LIGHT);
    pView->YoRender(YO_RENDER_FULL);
    return;
}
Exemple #24
0
//--------------------------------------------------------------------------
//해치 스타일 설정
//--------------------------------------------------------------------------
void CDrawProperty::OnSelchangeFillpattern()
{
	CDrawPropertyValue::m_nsHatchStyle = m_sFillPtnCombo.GetCurSel();

	//뷰 영역에 외부명령임을 알리고, 브러쉬 패턴을 바꾸는 함수를 호출
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	pView->m_bExternalCmd = TRUE;
	pView->OnDrawpropertyBrushpattern();

	//모달리스 다이얼로그들과 동기화 작업
	if(pView->m_dlgBrushPtn != NULL)
		pView->m_dlgBrushPtn->SetHatchPattern();
}
Exemple #25
0
//--------------------------------------------------------------------------
// 라인조인 설정
//--------------------------------------------------------------------------
void CDrawProperty::OnCbnSelchangeComboLinejoin()
{
	CDrawPropertyValue::m_nsLineJoin = m_sLineJoinCombo.GetCurSel();

	//////////////////////////////////////////////////////////////////////////
	//뷰 영역에 외곽선 형태를 바꾸는 메시지를 날림
	CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
	CGraphicEditorView* pView = (CGraphicEditorView*)pMainFrm->GetActiveView();
	pView->SendMessage(UM_CHANGELINEJOIN);

	//모달리스 다이얼로그들과 동기화 작업
	if(pView->m_dlgBrushPtn != NULL)
		pView->m_dlgBrushPtn->SetLineJoin();
}
void CDialogLinTran::OnBnClickedButton1()
{
	CString strFa;
	CString strFb;

	m_edtFa.GetWindowText(strFa);
	m_edtFb.GetWindowText(strFb);

	double dFa = StrToDouble(strFa);
	double dFb = StrToDouble(strFb);

	CMainFrame* mf = (CMainFrame*)AfxGetMainWnd();
	mf->biDoc.LinTran(dFa,dFb);
	mf->GetActiveView()->Invalidate();
}
Exemple #27
0
void CStageEyeDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
    CMainFrame *pMainFrame = (CMainFrame *)GetTopLevelFrame();
    if (!pMainFrame || !pMainFrame->IsKindOf(RUNTIME_CLASS(CMainFrame)))
    {
        return;
    }
    CStageView *pView = (CStageView *)pMainFrame->GetActiveView();
    if (!pView || !pView->IsKindOf(RUNTIME_CLASS(CStageView)))
    {
        return;
    }
    char s[32];
    CWnd *pCBox;

    if ((CSliderCtrl *)pScrollBar == &m_eyeSliderFOV)
    {
        pView->m_fieldOfView = m_eyeSliderFOV.GetPos();
        sprintf(s, "%.1lf", pView->m_fieldOfView);
        pCBox = (CComboBox*)pMainFrame->m_wndDlgEye->GetDlgItem(IDC_EYE_FOV);
        pCBox->SetWindowText(s);
        pCBox->UpdateWindow();

        ::glMatrixMode(GL_PROJECTION);
        ::glLoadIdentity();
        ::gluPerspective(pView->m_fieldOfView, pView->m_aspectRatio,
                         pView->m_clipFront, pView->m_clipRear);
        ::glMatrixMode(GL_MODELVIEW);

        //::glMatrixMode(GL_MODELVIEW);
        //::glLoadIdentity();
        //::gluLookAt(pView->m_eye[0], pView->m_eye[1], pView->m_eye[2],
        //	pView->m_eye[3], pView->m_eye[4], pView->m_eye[5],
        //	pView->m_eye[6], pView->m_eye[7], pView->m_eye[8]);

        if (nSBCode == SB_ENDSCROLL)
        {
            pView->YoRender(YO_RENDER_LIGHT);
            pView->YoRender(YO_RENDER_FULL);
        }
        else
        {
            pView->YoRender(YO_RENDER_QUICK);
        }
    }

    CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CNetworkControllView::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: Add your message handler code here and/or call default
	CMainFrame* pMain = (CMainFrame*)AfxGetApp()->m_pMainWnd;
	CView* pNewView = pMain->m_pViews[1];
	CView* pActiveView = pMain->GetActiveView();

	if ( pNewView != pActiveView )    // current is CM5 dialog
	{
		KillTimer(1);
		return;
	}

	Fresh();
	CFormView::OnTimer(nIDEvent);
}
Exemple #29
0
void CPageImageProcess::OnLButtonUp(UINT nFlags, CPoint point)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	CRect rect;
	m_SliderGamma.GetWindowRect(&rect);
	ScreenToClient(&rect);

	if (rect.PtInRect(point))
	{
		CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();
		CCOXRayView *pView = (CCOXRayView *)pFrame->GetActiveView();
		::SendMessage(pView->GetSafeHwnd(),WM_GAMMA_CHANGE_ENSURE,0,0);
	}

	CDialogEx::OnLButtonUp(nFlags, point);
}
void CCtrlDialog::OnBnClickedMfcbuttonDepthestim()
{
	// TODO: 在此添加控件通知处理程序代码
	CDepthEstimation estimator(m_pAsmbBody);
	estimator.Estimate();

	CWnd *pWnd = GetDlgItem(IDC_MFCBUTTON_DEPTHESTIM);
	pWnd->EnableWindow(FALSE);

	pWnd = GetDlgItem(IDC_MFCBUTTON_RECONSTRUCTION);
	pWnd->EnableWindow(TRUE);

	CMainFrame *pMain = (CMainFrame *)AfxGetMainWnd();
	CSLDRView * pView = (CSLDRView *)(pMain->GetActiveView());
	pView->Invalidate(); 
}