コード例 #1
0
//
/// Changes the text within the static control. If the splash screen does not have a
/// static control, this doesn't do anything.
//
void
TSplashWindow::SetText(LPCTSTR text)
{
  if (HasStyle(MakeStatic))
    if (GetStatic() && GetStatic()->IsWindow()) {
      GetStatic()->SetText(text);
      GetApplication()->PumpWaitingMessages();
    }
}
コード例 #2
0
ファイル: CAnimation.cpp プロジェクト: CSPshala/Bulletsponge
////////////////////////////////////////
//		PUBLIC UTILITY FUNCTIONS
////////////////////////////////////////
// Gets the current frame in the animation
// and moves to the next one in order.
RECT CAnimation::GetFrame()
{
	SetTimeWaited(GetTimeWaited() + GAME->GetTimer().GetDeltaTime());

	RECT tRect;
	
	tRect.left = GetCurrentFrame() * GetFrameWidth();
	tRect.top = 0;
	tRect.right = tRect.left + GetFrameWidth();
	tRect.bottom = tRect.top + GetFrameHeight();	
	
				
	if(GetTimeWaited() > GetTimePerFrame() && !GetStatic())
	{	
		SetTimeWaited(0.0f);
		SetCurrentFrame(GetCurrentFrame() + 1);

		if(GetCurrentFrame() > GetFrameCount())
		{
			if(GetLooping())
				ResetAnimation();	
			else
			{
				SetCurrentFrame(GetFrameCount());
				SetStatic(true);
			}
		}
		
	}

	return tRect;
}
コード例 #3
0
	void CAnalysisHowPage::UpdateCtrl()
	{

		//this->GetCheckedRadioButton(IDC_TIME_TRANSFORMATION_RADIO, IDC_FINAL_COMPUTATION_RADIO);
		bool bEnable = m_selectCtrl.GetCheck();
		//EnableGroupboxControls(::GetDlgItem(m_hWnd, IDC_SELECT_TIME_TRANSFORMATION), bEnable);
		//EnableGroupboxControls(::GetDlgItem(m_hWnd, IDC_SELECT_FINAL_COMPUTATION), !bEnable);

		bool bEnableEvent = bEnable && GetComputationKind() == CAnalysisComputation::EVENT;
		bool bEnableK = bEnableEvent && CAnalysisComputation::HaveK(m_eventTypeCtrl.GetCurSel());
		bool bEnablePreviousStat = m_pParent->GetDatabaseType() == CBioSIMDatabase::DATA_STATISTIC;
		bool bEnableStat = bEnable && !bEnableEvent;

		m_previousStatisticCtrl.EnableWindow(bEnablePreviousStat);

		m_TTTypeCtrl.EnableWindow(bEnable);
		m_TTModeCtrl.EnableWindow(bEnable);

		m_statisticCtrl.EnableWindow(bEnable);
		m_statisticTypeCtrl.EnableWindow(bEnableStat);
		m_eventCtrl.EnableWindow(bEnable);
		m_eventTypeCtrl.EnableWindow(bEnableEvent);
		m_KCtrl.EnableWindow(bEnableK);
		m_bDropYearCtrl.EnableWindow(bEnableEvent);

		for (int i = 0; i < NB_STATIC; i++)
			GetStatic(i).EnableWindow(bEnable);

		GetDlgItem(IDC_CT_TYPE)->EnableWindow(FALSE);
		GetDlgItem(IDC_CT_MODE)->EnableWindow(FALSE);

	

		//Update Image
		short type = m_TTTypeCtrl.GetCurItemData();
		short TMode = m_TTModeCtrl.GetCurItemData();
		UINT ID = NULL;
		if (type == CTRef::ANNUAL)
			ID = TMode ? IDB_OVER_ALL_YEARS_A : IDB_FOR_EACH_YEARS_A;
		else if (type == CTRef::MONTHLY)
			ID = TMode ? IDB_OVER_ALL_YEARS_M : IDB_FOR_EACH_YEARS_M;
		else if (type == CTRef::DAILY)
			ID = TMode ? IDB_OVER_ALL_YEARS_D : IDB_FOR_EACH_YEARS_D;

		m_imageModeCtrl.ShowWindow(ID ? SW_SHOW : SW_HIDE);
		m_imageModeCtrl.m_bTopImage = TRUE;
		m_imageModeCtrl.m_nAlignStyle = CMFCButton::ALIGN_CENTER;
		m_imageModeCtrl.SetImage(ID);
		m_imageModeCtrl.SizeToContent();
		m_imageModeCtrl.EnableWindow(bEnable);
		m_imageModeCtrl.RedrawWindow();


	}
コード例 #4
0
	void CAnalysisWhenPage::UpdateCtrl()
	{
		bool bEnable = m_selectPeriodCtrl.GetCheck();
		bool bEnableBegin = bEnable && !m_useCurrentDataCtrl1.GetCheck();
		bool bEnableEnd = bEnable && !m_useCurrentDataCtrl2.GetCheck();
		bool bEnableShift1 = bEnable && m_useCurrentDataCtrl1.GetCheck();
		bool bEnableShift2 = bEnable && m_useCurrentDataCtrl2.GetCheck();

		m_beginCtrl.EnableWindow(bEnableBegin);
		m_endCtrl.EnableWindow(bEnableEnd);

		m_continuousCtrl.EnableWindow(bEnable);
		m_yearByYearCtrl.EnableWindow(bEnable);

		m_useCurrentDataCtrl1.EnableWindow(bEnable);
		m_shiftCtrl1.EnableWindow(bEnableShift1);
		m_useCurrentDataCtrl2.EnableWindow(bEnable);
		m_shiftCtrl2.EnableWindow(bEnableShift2);

		CTRef begin(m_beginCtrl.GetTemporalReference());
		CTRef end(m_endCtrl.GetTemporalReference());

		short inversed = begin.IsInversed(end) ? 1 : 0;
		//if( m_inversed==-1 || inversed!=m_inversed)
		{
			m_inversed = inversed;
			UINT ID1 = m_inversed ? IDB_CONTINUOUS_PERIOD2 : IDB_CONTINUOUS_PERIOD1;
			UINT ID1C = m_inversed ? IDB_CONTINUOUS_PERIOD2_CHECKED : IDB_CONTINUOUS_PERIOD1_CHECKED;
			UINT ID2 = m_inversed ? IDB_YEAR_BY_YEAR2 : IDB_YEAR_BY_YEAR1;
			UINT ID2C = m_inversed ? IDB_YEAR_BY_YEAR2_CHECKED : IDB_YEAR_BY_YEAR1_CHECKED;


			m_continuousCtrl.m_bTopImage = TRUE;
			m_continuousCtrl.m_nAlignStyle = CMFCButton::ALIGN_CENTER;
			m_continuousCtrl.SetImage(ID1);
			m_continuousCtrl.SetCheckedImage(ID1C);
			m_continuousCtrl.SizeToContent();
			//m_continuousCtrl.Invalidate();
			m_continuousCtrl.RedrawWindow();

			m_yearByYearCtrl.m_bTopImage = TRUE;
			m_yearByYearCtrl.m_nAlignStyle = CMFCButton::ALIGN_CENTER;
			m_yearByYearCtrl.SetImage(ID2);
			m_yearByYearCtrl.SetCheckedImage(ID2C);
			m_yearByYearCtrl.SizeToContent();
			//m_yearByYearCtrl.Invalidate();
			m_yearByYearCtrl.RedrawWindow();
			//UpdateWindow();
		}

		int v = NB_STATIC;
		for (int i = 0; i < NB_STATIC; i++)
			GetStatic(i).EnableWindow(bEnable);
	}