Beispiel #1
0
void UGameEngine::CreateGameViewport( UGameViewportClient* GameViewportClient )
{
	check(GameViewportWindow.IsValid());

	if( !GameViewportWidget.IsValid() )
	{
		CreateGameViewportWidget( GameViewportClient );
	}
	TSharedRef<SViewport> GameViewportWidgetRef = GameViewportWidget.ToSharedRef();

	auto Window = GameViewportWindow.Pin();

	Window->SetWidgetToFocusOnActivate( GameViewportWidgetRef );
	Window->SetOnWindowClosed( FOnWindowClosed::CreateUObject( this, &UGameEngine::OnGameWindowClosed ) );

	// SAVEWINPOS tells us to load/save window positions to user settings (this is disabled by default)
	int32 SaveWinPos;
	if (FParse::Value(FCommandLine::Get(), TEXT("SAVEWINPOS="), SaveWinPos) && SaveWinPos > 0 )
	{
		// Get WinX/WinY from GameSettings, apply them if valid.
		FIntPoint PiePosition = GetGameUserSettings()->GetWindowPosition();
		if (PiePosition.X >= 0 && PiePosition.Y >= 0)
		{
			int32 WinX = GetGameUserSettings()->GetWindowPosition().X;
			int32 WinY = GetGameUserSettings()->GetWindowPosition().Y;
			Window->MoveWindowTo(FVector2D(WinX, WinY));
		}
		Window->SetOnWindowMoved( FOnWindowMoved::CreateUObject( this, &UGameEngine::OnGameWindowMoved ) );
	}

	SceneViewport = MakeShareable( new FSceneViewport( GameViewportClient, GameViewportWidgetRef ) );
	GameViewportClient->Viewport = SceneViewport.Get();

	//GameViewportClient->CreateHighresScreenshotCaptureRegionWidget(); //  Disabled until mouse based input system can be made to work correctly.

	// The viewport widget needs an interface so it knows what should render
	GameViewportWidgetRef->SetViewportInterface( SceneViewport.ToSharedRef() );

	FViewportFrame* ViewportFrame = SceneViewport.Get();

	GameViewport->SetViewportFrame(ViewportFrame);
}
void CSplitterControl::OnLButtonUp(UINT nFlags, CPoint point) 
{
	if (m_bIsPressed)
	{
		ClientToScreen(&point);
		CWindowDC dc(NULL);

		DrawLine(&dc, m_nX, m_nY);
		CPoint pt(m_nX, m_nY);
		m_bIsPressed = FALSE;
		CWnd *pOwner = GetOwner();
		if (pOwner && IsWindow(pOwner->m_hWnd))
		{
			CRect rc;
			int delta;
			pOwner->GetClientRect(rc);
			pOwner->ScreenToClient(&pt);
			MoveWindowTo(pt);

			if (m_nType == SPS_VERTICAL)
				delta = m_nX - m_nSavePos;
			else
				delta = m_nY - m_nSavePos;
			
			
			SPC_NMHDR nmsp;
		
			nmsp.hdr.hwndFrom = m_hWnd;
			nmsp.hdr.idFrom   = GetDlgCtrlID();
			nmsp.hdr.code     = SPN_SIZED;
			nmsp.delta = delta;

			pOwner->SendMessage(WM_NOTIFY, nmsp.hdr.idFrom, (LPARAM)&nmsp);
		}
	}

	CStatic::OnLButtonUp(nFlags, point);
	ReleaseCapture();
}
FLOAT touchmind::util::ScrollBarHelper::MoveWindowLeft(FLOAT dx, bool *reachXBoundary) {
  MoveWindowTo(m_windowX - dx, m_windowY, reachXBoundary, nullptr);
  return m_windowX;
}
D2D1_POINT_2F touchmind::util::ScrollBarHelper::MoveWindowDelta(FLOAT dx, FLOAT dy, bool *reachXBoundary /*= nullptr*/,
                                                                bool *reachYBoundary /*= nullptr*/) {
  MoveWindowTo(m_windowX + dx, m_windowY + dy, reachXBoundary, reachYBoundary);
  return D2D1::Point2F(m_windowX, m_windowY);
}
D2D1_POINT_2F touchmind::util::ScrollBarHelper::MoveWindowToCenter() {
  return MoveWindowTo(m_windowX + m_windowWidth / 2.0f, m_windowY + m_modelHeight / 2.0f);
}
FLOAT touchmind::util::ScrollBarHelper::MoveVScrollPositionTo(INT y) {
  FLOAT _y = WindowYToModelY(y + m_windowHeight / 2);
  MoveWindowTo(m_windowX, _y);
  return m_windowY;
}
FLOAT touchmind::util::ScrollBarHelper::MoveHScrollPositionTo(INT x) {
  FLOAT _x = WindowXToModelX(x + m_windowWidth / 2);
  MoveWindowTo(_x, m_windowY);
  return m_windowX;
}
FLOAT touchmind::util::ScrollBarHelper::MoveWindowDown(FLOAT dy, bool *reachYBoundary) {
  MoveWindowTo(m_windowX, m_windowY + dy, nullptr, reachYBoundary);
  return m_windowX;
}
Beispiel #9
0
BOOL CHello2Dlg::OnInitDialog()
{

	SHELLEXECUTEINFO   execInf;  
	ZeroMemory   (&execInf,   sizeof   (execInf));    
	execInf.cbSize   =   sizeof   (SHELLEXECUTEINFO);    
	execInf.fMask   =   NULL;
	execInf.nShow = SW_SHOWNORMAL;
	execInf.lpFile   =   _T("\\windows\\explorer.exe");    
	execInf.lpVerb   =   NULL;  
	execInf.lpParameters = _T("\\windows");
	execInf.hInstApp = NULL;
	execInf.hwnd = NULL;
	ShellExecuteEx (&execInf);

	CDialog::OnInitDialog();
	CTabCtrl *ct = (CTabCtrl*)GetDlgItem(IDC_TAB1);
	ct->SetMinTabWidth(50);
	// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
	//  执行此操作
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标
	CenterWindow(GetDesktopWindow());	// center to the hpc screen
	CRect rect;
	GetWindowRect(&rect);
	this->MoveWindow(0,0,rect.Width(),rect.Height());
	m_prbdlg = new CProbeDialog();
	m_prbdlg->Create(IDD_PROBE2_CFG,this);
	MoveWindowTo(m_prbdlg,0,MOVETOTOP,SW_HIDE);

	m_sysdlg = new CSystemDialog();
	m_sysdlg->Create(IDD_SYSTEM2_CFG,this);
	MoveWindowTo(m_sysdlg,0,MOVETOTOP,SW_HIDE);

	m_fltdlg = new CFilterDialog();
	m_fltdlg->Create(IDD_FILTER2_CFG,this);
	MoveWindowTo(m_fltdlg,0,MOVETOTOP,SW_HIDE);

	m_ccfg = new CCoefDialog();
	m_ccfg->Create(IDD_COEF_DIALOG,this);
	MoveWindowTo(m_ccfg,0,MOVETOTOP,SW_HIDE);

	m_keydlg = new CKeyDialog();
	m_keydlg->Create(IDD_KEYDIALOG,this);
	MoveWindowTo(m_keydlg,1,MOVETOBOTTOM,SW_HIDE);

	for(int i=0;i<sizeof(m_ridlgs)/sizeof(CRunitemDialog*);i++){
		m_ridlgs[i] = new CRunitemDialog();
		m_ridlgs[i]->m_ch = i+1;
		m_ridlgs[i]->cfg_now = CFGTYPE_NONE;
		m_ridlgs[i]->Create(IDD_RUNITEM,this);
		m_ridlgs[i]->LoadLastConfig();
		/*
		m_runtab.InsertItem(i,name);
		m_ridlgs[i]->DisplayBar(true);
		MoveWindowTo(m_ridlgs[i],0,MOVETOTOP,SW_HIDE);
		*/
	}
	CSpinButtonCtrl *spin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1);
	spin->SetBuddy(GetDlgItem(IDC_RUNCOUNT));
	spin->SetRange(-1,10000);


	m_cfgtab.InsertItem(0,_T("   铂电阻测温   "));
	m_cfgtab.InsertItem(1,_T("   热电偶测温   "));
	m_cfgtab.InsertItem(2,_T("    探头设置    "));
	m_cfgtab.InsertItem(3,_T("    标准设置    "));
	m_cfgtab.InsertItem(4,_T("    滤波设置    "));
	m_cfgtab.SetCurSel(0);
	curview = 0;


	
	thread_cmd = CMD_ABORT;
	cur_prg = NULL;
	hThread = CreateThread(NULL,NULL,OneRunThread,this ,0,&dwThreadId);
	// TODO: Add extra initialization here
	SetTimer(1,TIMER_LEN,NULL);

	LoadCurrentView();

//	m_chlist.SetCurSel(curview);

	return TRUE;  // 除非设置了控件的焦点,否则返回 TRUE
}