Int32 CtrlAddItemToPanel_Image(TWindow*pWin, TPanel* pPanel, Coord nX, Coord nY, Coord nWidth, Coord nHeight, TBitmap * pBmp) { TImage* pImage = new TImage(); Int32 nImageId = 0; if(pImage->Create(pPanel)) { TRectangle obBtnRec(0,0,0,0); nImageId=pImage->GetId(); obBtnRec.SetRect(nX, nY, nWidth, nHeight); pImage->SetBounds(&obBtnRec); pImage->SetBitmap(pBmp); pImage->SetEnabled(TRUE); } return nImageId; }
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; }