当前位置: 首页>>代码示例>>C++>>正文


C++ CTimeSpan::GetMinutes方法代码示例

本文整理汇总了C++中CTimeSpan::GetMinutes方法的典型用法代码示例。如果您正苦于以下问题:C++ CTimeSpan::GetMinutes方法的具体用法?C++ CTimeSpan::GetMinutes怎么用?C++ CTimeSpan::GetMinutes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTimeSpan的用法示例。


在下文中一共展示了CTimeSpan::GetMinutes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UpdateItem

void CDialogToDoHistory::UpdateItem( int iItem )
{
	DWORD dwId;
	m_listTodoHistory.GetItemData(iItem,dwId);
	ToDoTask todo = g_todoSet.GetToDo(dwId);
	ATLASSERT(todo.id!=ToDoTask::ERROR_TASKID);

	//改变的文字颜色
	COLORREF clrBgn,clrText;
	m_listTodoHistory.GetItemColours(iItem,m_iColCreateTime,clrBgn,clrText);
	m_listTodoHistory.SetItemColours(iItem,m_iColCreateTime,clrBgn,RGB(0X66,0X66,0X66));
	m_listTodoHistory.SetSubItemData(iItem,m_iColCreateTime,GlobeFuns::TimeToInt(todo.tmCreateTime));

	m_listTodoHistory.SetItemText(iItem,m_iColTitle,todo.strTask.c_str());

	m_listTodoHistory.SetItemText(iItem,m_iColPriority,ToDoTask::PriorityText(todo.priority));
	m_listTodoHistory.SetItemColours(iItem,m_iColPriority,RGB(10,170-todo.priority*25,10),RGB(0,0,0));
	m_listTodoHistory.SetSubItemData(iItem,m_iColPriority,todo.priority);

	CString strTime;
	if (todo.tmPlanFinshTime>=todo.tmCreateTime)
	{
		CTimeSpan ts = todo.tmPlanFinshTime-todo.tmCreateTime;

		CString strTmp;
		if (ts.GetDays()>0)
		{
			strTmp.Format("%d天",ts.GetDays());
			strTime += strTmp;
		}
		if (ts.GetHours()>0)
		{
			strTmp.Format("%d时",ts.GetHours());
			strTime += strTmp;
		}
		if (ts.GetDays()==0		//任务持续一天以上的,就不要精确到分钟了。
			&& ts.GetMinutes()>0)
		{
			strTmp.Format("%d分",ts.GetMinutes());
			strTime += strTmp;
		}
		if (strTime.IsEmpty())
		{
			strTmp.Format("%d秒",ts.GetSeconds());
			strTime += strTmp;
		}
		m_listTodoHistory.SetSubItemData(iItem,m_iColTotleHours,GlobeFuns::TimeToInt(CTime(0)+ts));
	}
	else
	{
		strTime = "(无数据)";
	}
	m_listTodoHistory.SetItemText(iItem,m_iColTotleHours,strTime);

	m_listTodoHistory.SetItemText(iItem,m_iColRemark,todo.strRemark.c_str());
}
开发者ID:blog2i2j,项目名称:greentimer,代码行数:56,代码来源:DialogToDoHistory.cpp

示例2: UpdateElapsedTime

// 경과 시간 갱신
VOID CConsoleManager::UpdateElapsedTime( VOID )
{
	CTime CurrentTime = CTime::GetCurrentTime();
	LONGLONG dElapsedHour = 0;
	CTimeSpan ElapsedTime;

	// m_stOperationTime.StartTime와 CurrentTime 비교
	if( m_stOperationTime.StartTime > CurrentTime )
	{
		g_Log.WriteLog( false,
						LOG_CLASS_WARNING,
						TEXT( "%s | Operation time value is invalid.\n" ),
						TEXT( __FUNCTION__ ) );

		m_stOperationTime.wElapsedHour = 0;
		m_stOperationTime.wElapsedMinute = 0;
		return;
	}

	ElapsedTime = CurrentTime - m_stOperationTime.StartTime;

	// 경과 시 갱신
	dElapsedHour = ElapsedTime.GetTotalHours();
	if( 9999 < dElapsedHour )  // 365일 * 24시간 = 8760시간
		m_stOperationTime.wElapsedHour = 9999;
	else
		m_stOperationTime.wElapsedHour = static_cast<WORD>( dElapsedHour );

	// 경과 분 갱신
	m_stOperationTime.wElapsedMinute = static_cast<WORD>( ElapsedTime.GetMinutes() );
}
开发者ID:fghj1,项目名称:TheFirstIdeal,代码行数:32,代码来源:Console.cpp

示例3:

CString CTradeStatistic2::CalculateElapseTime()
{
	CString strElapsedTime;
	CTime tmNow = CTime::GetCurrentTime();
	CTimeSpan tElapsed = tmNow - m_tmBegin;
	strElapsedTime.Format("%d小时 %d分钟 %d秒", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds());
	return strElapsedTime;
}
开发者ID:realgtk,项目名称:trade,代码行数:8,代码来源:TradeStatistic2.cpp

示例4: FormatElapsed

string VirtualListCtrlFT::FormatElapsed(CTimeSpan &span)
{
	string ret;
	char buf[4096];

	if(span.GetTotalHours()==0)	// < hour
	{
		sprintf(buf,"%u:%02u",span.GetMinutes(),span.GetSeconds());
	}
	else	//	> hour
	{
		sprintf(buf,"%u:%02u:%02u",span.GetHours(),span.GetMinutes(),span.GetSeconds());
	}
			
	ret=buf;

	return ret;
}
开发者ID:vdrive,项目名称:TrapperKeeper,代码行数:18,代码来源:VirtualListCtrlFT.cpp

示例5: RecordTimerEvent

//录像定时事件
void CDLGscreen::RecordTimerEvent()
{
	for(int i=0;i<MAX_DEVICE_NUM;i++)
	{
		if(m_videoInfo[i].isRecord == true)
		{
			CTime nowtime=CTime::GetTickCount();
			CTimeSpan ts = nowtime - m_videoInfo[i].startTime;
			int recMinutes = ts.GetMinutes();
			if(recMinutes >= DlgSetSystem.m_record_cuttime)
			{
				StopRecord(i);
				DlgMain->DlgTabVideo.DlgNormal.OpenRecord(i);
			}
		}
#if OPEN_RECORD
		//定时录制
		if(DlgMain->DlgTabVideo.DlgSetRecord.NeedRecord(m_videoInfo[i].camID))
		{
			if(m_videoInfo[i].isRecord == false)
			{
				m_videoInfo[i].planRecord = true;
				DlgMain->DlgTabVideo.DlgNormal.OpenRecord(i);	//开始录制
			}
		}
		else
		{
			if(m_videoInfo[i].planRecord == true)
			{
				m_videoInfo[i].planRecord = false;
				if(m_videoInfo[i].isRecord == true)
				{
					DlgMain->DlgTabVideo.DlgNormal.CloseRecord(i);	//停止录制
				}
			}
		}
#endif
	}

	//定时录像放这里ZOG
	//FOR N个摄像头
#if OPEN_RECORD
	if(DlgMain->DlgTabVideo.DlgSetRecord.NeedRecord(CAMID) )
	{
		if(m_videoInfo[i].isRecord)
		//不做事情
		else
		//开始录制
	
	}
	else
	{
		if(m_videoInfo[i].isRecord)
开发者ID:dulton,项目名称:brpj,代码行数:54,代码来源:DLGscreen.cpp

示例6: ShowDuration

void SaveBinaryNoParsingDlg::ShowDuration(CTimeSpan ts, UINT id)
{
  char buf[128];
  //CTimeSpan ts = CTime::GetCurrentTime() - startTime;
  if(ts.GetDays() > 0)
  {
    sprintf_s(buf, 128, "%d day(s) and %02d:%02d:%02d", (int)ts.GetDays(), (int)ts.GetHours(), (int)ts.GetMinutes(), (int)ts.GetSeconds());
  }
  else
  {
    sprintf_s(buf, 128, "%02d:%02d:%02d", (int)ts.GetHours(), (int)ts.GetMinutes(), (int)ts.GetSeconds());
  }
  GetDlgItem(id)->SetWindowText(buf);
}
开发者ID:asion0,项目名称:GNSS_Viewer_V2,代码行数:14,代码来源:SaveBinaryNoParsingDlg.cpp

示例7: tmNow

int XgnExtDataDlg::Transfer5MinTimet(int tmIn)
{
	CTime tmNow (tmIn);
	CTime tmb (tmNow.GetYear (),tmNow.GetMonth (),tmNow.GetDay (),9,35,0);
	if(tmNow<tmb)
		return (int)tmb.GetTime ();

	CTimeSpan sp = tmNow-tmb;
	int nMinute = sp.GetMinutes ();

	int nRtn = nMinute%5==0?(nMinute/5):(nMinute/5+1);
	nRtn = nRtn*5*60 + tmb.GetTime ();

	return nRtn;
}
开发者ID:ifzz,项目名称:yinhustock,代码行数:15,代码来源:XgnExtDataDlg.cpp

示例8: SWait

void CPMotion::SWait(short Seconds)				//waits n seconds
{
    //OK
    CTime WaitUntilTime = CTime::GetCurrentTime();
    WaitUntilTime += CTimeSpan(0, 0, 0, Seconds);
    bool done = false;

    while (!done)
    {
        m_Robot->DoWindowMessages();
        CTime StartTime = CTime::GetCurrentTime();
        CTimeSpan TimeDiff = WaitUntilTime - StartTime;

        if ((TimeDiff.GetHours() == 0) && (TimeDiff.GetMinutes() == 0) &&
                (TimeDiff.GetSeconds() <= 0))
        {
            done = true;
        }
    }
}
开发者ID:dogshoes,项目名称:map-n-zap,代码行数:20,代码来源:PMotion.cpp

示例9: RWait

bool CPMotion::RWait(short Seconds)				//waits n seconds or exit on nudge
{
    //OK
    CTime WaitUntilTime = CTime::GetCurrentTime();
    WaitUntilTime += CTimeSpan(0, 0, 0, Seconds);
    bool done = false;

    while ((!done) && (!(m_Robot->m_Nudged)))
    {
        m_Robot->DoWindowMessages();
        CTime StartTime = CTime::GetCurrentTime();
        CTimeSpan TimeDiff = WaitUntilTime - StartTime;

        if ((TimeDiff.GetHours() == 0) && (TimeDiff.GetMinutes() == 0) &&
                (TimeDiff.GetSeconds() <= 0))
        {
            done = true;
        }
    }

    return (done || (m_Robot->m_Nudged));	// ||boolean
}
开发者ID:dogshoes,项目名称:map-n-zap,代码行数:22,代码来源:PMotion.cpp

示例10: UpdateDuration

void CAddTimer::UpdateDuration()
{
	CTimeSpan aday(1,0,0,0);
	CTimeSpan tempduration;
	CTime end, start;
	UpdateData(TRUE);

	//m_endtime.GetTime(end);
	//m_starttime.GetTime(start);
	end = m_endtimex;
	start = m_starttimex;

	if (end < start) end += aday;

	tempduration = end - start;

	//Only enable ok button if duration is greater than 0
	if((tempduration.GetTotalSeconds() > 0) && (m_channellist.GetCurSel() != LB_ERR)){
		m_ok.EnableWindow(TRUE);
	}else{
		m_ok.EnableWindow(FALSE);
	}

	CString temp;
	if(tempduration.GetHours()>0) temp += tempduration.Format("%Hhr");
	if(tempduration.GetMinutes()>0)  temp += tempduration.Format("%Mmin");
	//temp += duration.Format("%Ssec");
	m_duration = temp;
	
	
	//Get programme name from guide
	CProgGuideDlg pgdlg(NULL,NULL);
	m_progname = pgdlg.getProg(m_channellist.GetCurSel(),m_starttimex);

	UpdateData(FALSE);

}
开发者ID:mylesmacrae,项目名称:softvcr,代码行数:37,代码来源:AddTimer.cpp

示例11: CheckBspProcess

void CheckBspProcess( void )
{
	char    outputpath[1024];
	char    temppath[512];
	DWORD   exitcode;
	char*   out;
	BOOL    ret;
	
	if ( !bsp_process )
		return;
		
	ret = GetExitCodeProcess( bsp_process, &exitcode );
	if ( !ret )
		Error( "GetExitCodeProcess failed" );
	if ( exitcode == STILL_ACTIVE )
		return;
		
	bsp_process = 0;
	
	GetTempPath( 512, temppath );
	sprintf( outputpath, "%sjunk.txt", temppath );
	
	LoadFile( outputpath, ( void** )&out );
	Sys_Printf( "%s", out );
	Sys_Printf( "\ncompleted.\n" );
	free( out );
	
	CTime tEnd = CTime::GetCurrentTime();
	CTimeSpan tElapsed = tEnd - g_tBegin;
	CString strElapsed;
	strElapsed.Format( "Run time was %i hours, %i minutes and %i seconds", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds() );
	Sys_Printf( strElapsed.GetBuffer( 0 ) );
	
	
	Sys_Beep();
	Pointfile_Check();
	// run game if no PointFile and pref is set
	//++timo needs to stop after BSP if leaked .. does run through vis and light instead ..
	if ( g_PrefsDlg.m_bRunQuake == TRUE  && !g_qeglobals.d_pointfile_display_list )
	{
		char cCurDir[1024];
		GetCurrentDirectory( 1024, cCurDir );
		CString strExePath = "../../qio.exe";
		//= g_PrefsDlg.m_strQuake2;
		CString strOrgPath;
		CString strOrgFile;
		ExtractPath_and_Filename( currentmap, strOrgPath, strOrgFile );
		if ( g_PrefsDlg.m_bSetGame == TRUE )  // run in place with set game.. don't copy map
		{
			CString strBasePath = ValueForKey( g_qeglobals.d_project_entity, "basepath" );
			strExePath += " +set game ";
			strExePath += strBasePath;
			WinExec( strExePath, SW_SHOW );
		}
		else
		{
			CString strCopyPath = strExePath;
			char* pBuffer = strCopyPath.GetBufferSetLength( _MAX_PATH + 1 );
			pBuffer[strCopyPath.ReverseFind( '\\' ) + 1] = '\0';
			strCopyPath.ReleaseBuffer();
			SetCurrentDirectory( strCopyPath );
			CString strOrgPath;
			CString strOrgFile;
			ExtractPath_and_Filename( currentmap, strOrgPath, strOrgFile );
			AddSlash( strCopyPath );
			FindReplace( strOrgFile, ".map", ".bsp" );
			//++timo modified for Quake3 !!
			strCopyPath += "baseq3\\maps\\";
			strCopyPath += strOrgFile;
			AddSlash( strOrgPath );
			strOrgPath += strOrgFile;
			bool bRun = ( strOrgPath.CompareNoCase( strCopyPath ) == 0 );
			if ( !bRun )
				bRun = ( CopyFile( strOrgPath, strCopyPath, FALSE ) == TRUE );
			if ( bRun )
			{
				FindReplace( strOrgFile, ".bsp", "" );
				strExePath += " +map ";
				strExePath += strOrgFile;
				WinExec( strExePath, SW_SHOW );
			}
		}
		SetCurrentDirectory( cCurDir );
	}
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:85,代码来源:Win_qe3.cpp

示例12: OnUpdate


//.........这里部分代码省略.........
  else
    bInserting = true;    // different counts, must re-do list

  if (bInserting)
    pList.DeleteAllItems ();

// add all documents to the list

 	pos = App.m_pWorldDocTemplate->GetFirstDocPosition();

	for (int nItem = 0; pos != NULL; nItem++)
	{
    CMUSHclientDoc* pDoc = (CMUSHclientDoc*) App.m_pWorldDocTemplate->GetNextDoc(pos);

    if (bInserting)
      pDoc->m_view_number = nItem + 1;    // so we can use Ctrl+1 etc.
    else
      nItem = pDoc->m_view_number - 1;    // use existing item number

    CString strSeq;
    CString strLines;
    CString strNewLines;
    CString strStatus;
    CString strSince;
    CString strDuration;

    strSeq.Format   ("%ld", pDoc->m_view_number);
    strNewLines.Format ("%ld", pDoc->m_new_lines);
    strLines.Format ("%ld", pDoc->m_total_lines);

// work out world status

    strStatus = GetConnectionStatus (pDoc->m_iConnectPhase);

// when they connected

    if (pDoc->m_iConnectPhase == eConnectConnectedToMud)
      strSince = pDoc->FormatTime (pDoc->m_tConnectTime, "%#I:%M %p, %d %b");
    else
      strSince.Empty ();

// work out world connection duration

    // first time spent in previous connections
    CTimeSpan ts = pDoc->m_tsConnectDuration;
    
    // now time spent connected in this session, if we are connected
    if (pDoc->m_iConnectPhase == eConnectConnectedToMud)
      ts += CTime::GetCurrentTime() - pDoc->m_tConnectTime;
  
    if (ts.GetDays () > 0)
      strDuration = ts.Format ("%Dd %Hh %Mm %Ss");
    else
      if (ts.GetHours () > 0)
        strDuration = ts.Format ("%Hh %Mm %Ss");
      else
        if (ts.GetMinutes () > 0)
          strDuration = ts.Format ("%Mm %Ss");
        else
          strDuration = ts.Format ("%Ss");
	
    // sequence
    if (bInserting)
      pList.InsertItem (nItem, strSeq);  //  eColumnSeq
	  pList.SetItemText(nItem, eColumnMush, pDoc->m_mush_name);
		pList.SetItemText(nItem, eColumnNew, strNewLines);
 		pList.SetItemText(nItem, eColumnLines, strLines);
  	pList.SetItemText(nItem, eColumnStatus, strStatus);
		pList.SetItemText(nItem, eColumnSince, strSince);
		pList.SetItemText(nItem, eColumnDuration, strDuration);

    if (bInserting)
      pList.SetItemData(nItem, (DWORD) pDoc);

    LVITEM lvitem;

    memset (&lvitem, 0, sizeof lvitem);

    // update where tick goes
    lvitem.iImage = 0;
    
    if (pDoc->m_pActiveCommandView || pDoc->m_pActiveOutputView)
      lvitem.iImage = 1;  // show the tick

    lvitem.mask = LVIF_IMAGE;
    lvitem.iItem = nItem;

    pList.SetItem (&lvitem);



   }    // end of searching for all documents

// make sure in same order that we left them

  pList.SortItems (CompareFunc, m_reverse << 8 | m_last_col); 

  m_bUpdateLockout = FALSE;

}     // end of CActivityView::OnUpdate
开发者ID:Twisol,项目名称:mushclient,代码行数:101,代码来源:ActivityView.cpp

示例13: OnMouseMove

void COscillogram::OnMouseMove(UINT nFlags, CPoint point) 
{
	CStringArray valArray;
	CDWordArray colArray;
	CString     strVal;
	CRect		mRect;
	CClientDC	dc(this);
	float		length;		//鼠标位置绝对象素数
	float		gValue;
	int			oldMode;
	int			curCell;	//所在单元格
	CPen pen(PS_SOLID,0,RGB(0,0,0));
	BOOL		PtState = FALSE;

	//(整个函数过程的功能)计算所有线所在单元格的数值
	oldMode = dc.SetMapMode(MM_LOMETRIC);
	SetOscillogramRect(&dc);
	dc.SelectObject(&pen);
	dc.SetROP2(R2_NOTXORPEN);
	dc.DPtoLP(&point);

	//如果 鼠标不在波形图内 或者 没有曲线 不做处理返回
	if(!(point.x >= m_GridRect.left  && point.x <= m_GridRect.right+3
		&& point.y <= m_GridRect.top && point.y >= m_GridRect.bottom)
		|| GetCurveCount() < 1 || m_showTitle == FALSE)
	{
		if(m_bPt.x != -1)
		{
			DrawMouseLine(&dc,m_bPt);
			m_bPt =-1;
		}
		m_TitleTip.ShowWindow(SW_HIDE);
		return;
	}
	
	//绘画跟随鼠标的十字线
	if(m_bPt.x == -1)
	{
		m_bPt = point;
		DrawMouseLine(&dc,point);
	}
	else
	{	
		DrawMouseLine(&dc,m_bPt);
		m_bPt = point;
		DrawMouseLine(&dc,point);
	}

	//计算个单元格数值
	length  = (float)( point.x - m_GridRect.left );
	curCell = (int)( length / m_xSpan );
	
	if(!m_showTime)
	{
		float n1 = (m_xMaxVal - m_xMinVal)/(m_xCount-1);
		float n2 = m_xMinVal + curCell*n1;
		strVal.Format("%s: %.2f",m_xText,n2);
	}
	else
	{
		CTimeSpan m_xTimeSpan = 0;
		CTimeSpan sc    = m_endTime - m_beginTime;
		CTime	cnTime  = m_beginTime;
		
		double secCount = (sc.GetDays()*86400) + (sc.GetHours()*3600) + 
			(sc.GetMinutes()*60) + sc.GetSeconds();
		secCount = secCount / (m_xCount-1);
		
		int day    = (int)secCount/86400;	//天
		secCount  -= day*86400;
		int hour   = (int)secCount/3600;	//小时
		secCount  -= hour*3600;
		int minute = (int)secCount/60;		//分钟
		secCount  -= minute*60;
		int second = (int)secCount;			//秒
		m_xTimeSpan = CTimeSpan(day,hour,minute,second);

		for(int j=0;j<curCell;j++)
			cnTime += m_xTimeSpan;
		strVal.Format("%s: %s",m_xText,cnTime.Format("%Y/%m/%d  %H:%M:%S"));
	}
	colArray.Add(RGB(0,0,0));
	valArray.Add(strVal);

	for(int i=0;i<GetCurveCount();i++)
	{
		gValue = GetCurve(i)->ptVal.GetPointValue(curCell,PtState);
		
		if(PtState)
			strVal.Format("%s: %.2f",GetCurveName(i),gValue);
		else
			strVal.Format("%s: ",GetCurveName(i));
		colArray.Add(GetCurve(i)->lColor);
		valArray.Add(strVal);
	}

	//显示浮动窗体
	dc.LPtoDP(&point);
	dc.SetMapMode(oldMode);

//.........这里部分代码省略.........
开发者ID:marco-sun,项目名称:arbi6,代码行数:101,代码来源:Oscillogram.cpp

示例14: DrawGrid

void COscillogram::DrawGrid(CDC *dc)
{
	//_DrawGrid(dc);

	CString tempStr;
	CSize	tempSzie;
	int		tempPos;
	CFont	m_cFont, *oldFont;
	CPen	pen(PS_SOLID,6,m_GridColor);

	m_cFont.CreatePointFont(260,"宋体");//"Arial");
	oldFont = dc->SelectObject(&m_cFont);
	dc->SelectObject(&pen);
	dc->SetTextColor(m_xyTextColor);

	float m_xTemp = (float)m_GridRect.Width() / (m_xShowCount-1);
	float m_yTemp = (float)m_GridRect.Height() / (m_yShowCount-1);
	CTimeSpan m_xTimeSpan = 0;

	if(m_showTime)
	{
		CTimeSpan sc    = m_endTime - m_beginTime;

		double secCount = (sc.GetDays()*86400) + (sc.GetHours()*3600) + 
						  (sc.GetMinutes()*60) + sc.GetSeconds();
		secCount = secCount / (m_xShowCount-1);

		int day    = (int)secCount/86400;	//天
		secCount  -= day*86400;
		int hour   = (int)secCount/3600;	//小时
		secCount  -= hour*3600;
		int minute = (int)secCount/60;		//分钟
		secCount  -= minute*60;
		int second = (int)secCount;			//秒

		m_xTimeSpan = CTimeSpan(day,hour,minute,second);
	}
	
	for(int i=0;i<m_xShowCount;i++)
	{
		tempPos =   m_GridRect.left + (int)(m_xTemp*i);
		
		DotLine(dc, tempPos, 
			        m_GridRect.top ,
				    tempPos , 
				    m_GridRect.bottom ,
				    m_GridColor );
		
		if(!m_showTime)
			tempStr.Format("%.2f", 
					(m_xMaxVal-m_xMinVal)/(m_xShowCount-1) 
					* i	+ m_xMinVal );
		else
		{
			CTime cnTime = m_beginTime;;

			for(int j=0;j<i;j++)
				cnTime += m_xTimeSpan;

			tempStr = cnTime.Format("%H:%M:%S");//%Y/%m/%d 
		}

		tempSzie =  dc->GetTextExtent(tempStr);
		dc->TextOut(tempPos - tempSzie.cx/2 , 
					m_GridRect.bottom - 15 ,
					tempStr );
	}

	for(int j=0;j<m_yShowCount;j++)
	{
		tempPos = m_GridRect.top + (int)(m_yTemp*j);

		DotLine(dc, m_GridRect.left , 
			        tempPos ,
				    m_GridRect.right ,
				    tempPos ,
				    m_GridColor );
	
		tempStr.Format("%.2f",
					(m_yMaxVal-m_yMinVal)/(m_yShowCount-1)
					* (m_yShowCount-1-j) + m_yMinVal );

		tempSzie =  dc->GetTextExtent(tempStr);

		dc->TextOut(m_GridRect.left - tempSzie.cx-15 , 
					tempPos + tempSzie.cy/2 ,
					tempStr );
	}
	
	//X轴文本
	tempSzie = dc->GetTextExtent(m_xText);
	dc->TextOut(m_GridRect.right + 15,m_GridRect.bottom + tempSzie.cy/2,m_xText);
	//Y轴文本
	tempSzie = dc->GetTextExtent(m_yText);
	dc->TextOut(m_GridRect.left - tempSzie.cx/2,m_GridRect.top + tempSzie.cy + 15,m_yText);

	//XY轴线
	dc->MoveTo(m_GridRect.left,m_GridRect.top);
	dc->LineTo(m_GridRect.left,m_GridRect.bottom);
	dc->MoveTo(m_GridRect.left,m_GridRect.bottom);
//.........这里部分代码省略.........
开发者ID:marco-sun,项目名称:arbi6,代码行数:101,代码来源:Oscillogram.cpp

示例15: DLLBuildDone

void DLLBuildDone()
{
  g_hToolThread = NULL;
  CTime tEnd = CTime::GetCurrentTime();
  CTimeSpan tElapsed = tEnd - g_tBegin;
  CString strElapsed;
  strElapsed.Format("Run time was %i hours, %i minutes and %i seconds", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds());
	Sys_Printf(strElapsed.GetBuffer(0));
	Pointfile_Check();

  if (g_PrefsDlg.m_bRunQuake == TRUE)
  {
    char cCurDir[1024];
    GetCurrentDirectory(1024, cCurDir);
    CString strExePath = g_PrefsDlg.m_strQuake2;
    CString strOrgPath;
    CString strOrgFile;
    ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
    if (g_PrefsDlg.m_bSetGame == TRUE) // run in place with set game.. don't copy map
    {
	    CString strBasePath = ValueForKey(g_qeglobals.d_project_entity, "basepath");
      strExePath += " +set game ";
      strExePath += strBasePath;
      WinExec(strExePath, SW_SHOW);
    }
    else
    {
      CString strCopyPath = strExePath;
      char* pBuffer = strCopyPath.GetBufferSetLength(_MAX_PATH + 1);
      pBuffer[strCopyPath.ReverseFind('\\') + 1] = '\0';
      strCopyPath.ReleaseBuffer();
      SetCurrentDirectory(strCopyPath);
      CString strOrgPath;
      CString strOrgFile;
      ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
      AddSlash(strCopyPath);
      FindReplace(strOrgFile, ".map", ".bsp");
      strCopyPath += "\\baseq2\\maps\\";
      strCopyPath += strOrgFile;
      AddSlash(strOrgPath);
      strOrgPath += strOrgFile;
      bool bRun = (strOrgPath.CompareNoCase(strCopyPath) == 0);
      if (!bRun)
        bRun = (CopyFile(strOrgPath, strCopyPath, FALSE) == TRUE);
      if (bRun)
      {
        FindReplace(strOrgFile, ".bsp", "");
        strExePath += " +map ";
        strExePath += strOrgFile;
        WinExec(strExePath, SW_SHOW);
      }
    }
    SetCurrentDirectory(cCurDir);
  }

}
开发者ID:Izhido,项目名称:qrevpak,代码行数:56,代码来源:Win_main.cpp


注:本文中的CTimeSpan::GetMinutes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。