void __fastcall TMainForm::Timer1Timer(TObject *Sender) { int i; TColor color; if (cntTimer > 3) { for (i = 0; i < ErrorTimer.CountTarget; i++) { SetObjectColor(ErrorTimer.Target[i], clWindow); } cntTimer = 0; Timer1->Enabled = false; return; } if (cntTimer % 2 == 0) color = clError; else color = clWindow; for (i = 0; i < ErrorTimer.CountTarget; i++) SetObjectColor(ErrorTimer.Target[i], color); cntTimer++; }
EditControl::EditControl(window_ptr Owner, SimpleScreenObject* Parent, parent_processkey_t&& ParentProcessKey, Callback* aCallback, History* iHistory, FarList* iList, DWORD iFlags): Edit(Owner), pHistory(iHistory), pList(iList), m_ParentProcessKey(ParentProcessKey? std::move(ParentProcessKey) : [Parent](const Manager::Key& Key) {return Parent->ProcessKey(Key); }), MaxLength(-1), CursorSize(-1), CursorPos(0), PrevCurPos(0), MacroSelectionStart(-1), SelectionStart(-1), MacroAreaAC(MACROAREA_DIALOGAUTOCOMPLETION), ECFlags(iFlags), Selection(false), MenuUp(false), ACState(ECFlags.Check(EC_ENABLEAUTOCOMPLETE)), CallbackSaveState(false) { SetObjectColor(); if (aCallback) { m_Callback=*aCallback; } else { m_Callback.Active=true; m_Callback.m_Callback=nullptr; m_Callback.m_Param=nullptr; } }
void __fastcall TMainForm::ShowError(TError err) { int i; for (i = 0; i < err.CountTarget; i++) { SetObjectColor(err.Target[i], clRed); } }
uintptr_t CPROC DrawSectorLines( INDEX pSector, uintptr_t unused ) { _POINT o, n; POBJECT object = CreateObject(); INDEX iWorld = DrawThis.iWorld; INDEX pStart, pCur; int count=0; int priorend = unused; DrawThis.object = object; // origin at z +1 scale( o, VectorConst_Y, 10.0 );//SetPoint( o, VectorConst_Z ); // direction z+1 SetPoint( n, VectorConst_Y ); AddPlane( object, o, n, 0 ); Invert( n ); Invert( o ); AddPlane( object, o, n, 0 ); //DrawSpaceLines( display->pImage, pSector->spacenode ); lprintf( WIDE("Adding Sector %d"), pSector ); pCur = pStart = GetFirstWall( iWorld, pSector, &priorend ); do { _POINT tmp; LOGICAL d = IsSectorClockwise( iWorld, pSector ); //GETWORLD( display->pWorld ); INDEX iLine; PFLATLAND_MYLINESEG Line; //VECTOR p1, p2; iLine = GetWallLine( iWorld, pCur ); GetLineData( iWorld, iLine, &Line ); // stop infinite looping... may be badly linked... count++; if( count > 20 ) { xlprintf(LOG_ALWAYS)( WIDE("Conservative limit of 20 lines on a wall has been reached!") ); DebugBreak(); break; } { _POINT o, n, r; //int d; o[0] = Line->r.o[0]; o[1] = Line->r.o[2]; o[2] = Line->r.o[1]; tmp[0] = Line->r.n[0]; tmp[1] = Line->r.n[2]; tmp[2] = Line->r.n[1]; if( priorend ) { lprintf( WIDE("prior end causes reversal...") ); Invert( tmp ); } if( d ) { lprintf( WIDE("Sector clockwise..>") ); Invert( tmp ); } //SetPoint( o, Line->r.o ); crossproduct( n, VectorConst_Y, tmp ); /* if( priorend ) { d = 1; Invert( n ); } else { d = 1; } */ lprintf( WIDE("Adding plane to object... ") ); PrintVector( o ); PrintVector( n ); AddPlane( DrawThis.object, o, n, (GetMatedWall( iWorld, pCur )==INVALID_INDEX)?0:2 ); } pCur = GetNextWall(l.world , pCur, &priorend ); }while( pCur != pStart ); if( IntersectObjectPlanes( object ) ) { // destroy these planes, and add new ones. //priorend = FALSE; //DestroyObject( &object ); } // oh - add lines first one way and then the other... interesting // to test both directions of priorend! if( !unused ) DrawSectorLines( pSector, 1 ); PutIn( object, DrawThis.root ); { PFLATLAND_TEXTURE texture; INDEX iTexture = GetSectorTexture( l.world, pSector ); GetTextureData( l.world, iTexture, &texture ); SetObjectColor( object, texture->data.color /*BASE_COLOR_BLUE*/ ); } return 0; // continue drawing... non zero breaks loop... }