コード例 #1
0
/**
 * 显示连接的动画
 *
 * \param pApp
 * \param nStep 	连接第几步
 */
void TInitForm::_DrawDot(TApplication * pApp, int nStep)
{

	for(int i=0; i<LOADING_FORM_DOT_NUM; i++)
	{
		TImage* pTImage = NULL;
		pTImage = static_cast< TImage* >(this->GetControlPtr(nDotID[i]));
		if(pTImage!= NULL)
		{
			if(i<=nStep)
				pTImage->SetBitmapByResId (APP_KA_ID_BITMAP_Loading_dot_hl);
			else
				pTImage->SetBitmapByResId (APP_KA_ID_BITMAP_Loading_dot);
		}
	}	
	return;
}
コード例 #2
0
Boolean TInitForm::_OnWinInitEvent(TApplication * pApp, EventType * pEvent)
{
	for(int i=0; i<LOADING_FORM_DOT_NUM; i++)
	{
		TImage* pTImage = new TImage;
		if(pTImage->Create(this))
		{
			TRectangle obBtnRec(DOT_X+((SCR_W - DOT_X*2)/LOADING_FORM_DOT_NUM)*i, DOT_Y, DOT_W, DOT_H);
			nDotID[i] = pTImage->GetId();//save button ID
			pTImage->SetBounds(&obBtnRec); 	
			pTImage->SetBitmapByResId (APP_KA_ID_BITMAP_Loading_dot); 
		}
	}

	_DrawDot(pApp, nLoadStep);
	m_nTimerId = TIMER_Create(1000, TIMER_MODE_AUTORUN | TIMER_MODE_PERIOD, NULL, 0, 0);	
	return TRUE;
}