Ejemplo n.º 1
0
void
TaskPointRenderer::Draw(const TaskPoint &tp, Layer layer)
{
  const OrderedTaskPoint &otp = (const OrderedTaskPoint &)tp;
  const AATPoint &atp = (const AATPoint &)tp;

  switch (tp.GetType()) {
  case TaskPointType::UNORDERED:
    if (layer == LAYER_LEG && location.IsValid())
      DrawTaskLine(location, tp.GetLocationRemaining());

    if (layer == LAYER_SYMBOLS)
      DrawBearing(tp);

    index++;
    break;

  case TaskPointType::START:
    index = 0;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawBearing(tp);
      DrawTarget(tp);
    }

    break;

  case TaskPointType::AST:
    index++;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawBearing(tp);
      DrawTarget(tp);
    }
    break;

  case TaskPointType::AAT:
    index++;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawIsoline(atp);
      DrawBearing(tp);
      DrawTarget(tp);
    }
    break;

  case TaskPointType::FINISH:
    index++;

    DrawOrdered(otp, layer);
    if (layer == LAYER_SYMBOLS) {
      DrawBearing(tp);
      DrawTarget(tp);
    }
    break;
  }
}
Ejemplo n.º 2
0
void C_CFPlayer::DrawTargets()
{
	if (m_hDirectTarget != m_hDrawingDirectTarget)
	{
		m_hDrawingDirectTarget = m_hDirectTarget;
		m_flReceivedDirectTarget = gpGlobals->curtime;
	}

	if (m_hRecursedTarget != m_hDrawingRecursedTarget)
	{
		m_hDrawingRecursedTarget = m_hRecursedTarget;
		m_flReceivedRecursedTarget = gpGlobals->curtime;
	}

	for (int i = 1; i < gpGlobals->maxClients; i++)
	{
		C_BasePlayer* pPlayer = UTIL_PlayerByIndex(i);

		if (!pPlayer)
			continue;

		C_CFPlayer* pCFPlayer = ToCFPlayer(pPlayer);

		if ( this == pCFPlayer )
			continue;

		if (!pPlayer->IsAlive())
			continue;

		Vector vecTargetPosition = pCFPlayer->GetAbsOrigin() + Vector(0, 0, 10);

		bool bTeammate = CFGameRules() && CFGameRules()->PlayerRelationship(this, pCFPlayer) == GR_TEAMMATE;

		float flWooshTime = 0;
		if (m_hDirectTarget == pCFPlayer)
			flWooshTime = gpGlobals->curtime - m_flReceivedDirectTarget;
		else
			flWooshTime = gpGlobals->curtime - m_flReceivedRecursedTarget;

		if ( (m_hDirectTarget == pCFPlayer || m_hRecursedTarget == pCFPlayer) )
		{
			DrawTarget(bTeammate?"effects/target_friend":"effects/target_enemy", vecTargetPosition, 0, flWooshTime);
		}

		if (m_hDirectTarget == pCFPlayer && m_hRecursedTarget != pCFPlayer && bTeammate)
		{
			QAngle angTarget;
			VectorAngles((m_hRecursedTarget->GetAbsOrigin() - pCFPlayer->GetAbsOrigin()), angTarget);
			DrawTarget(bTeammate?"effects/targeting_friend":"effects/targeting_enemy", vecTargetPosition, angTarget.y, flWooshTime);
		}

		if (pCFPlayer->m_hDirectTarget == this || pCFPlayer->m_hRecursedTarget == this)
		{
			QAngle angTarget;
			VectorAngles((GetAbsOrigin() - pCFPlayer->GetAbsOrigin()), angTarget);
			DrawTarget(bTeammate?"effects/targeting_friend":"effects/targeting_enemy", vecTargetPosition, angTarget.y, flWooshTime);
		}
	}
}
Ejemplo n.º 3
0
void DoPaint(HDC hdc)
{
	const char szInstructions[] = "Please touch the center of the target.";

	POINT p;
	int i, n;
	int old_rop;
	POINT last = current_target_location;
	HPEN hOldPen;
	
	if (current_target == total_targets) {
		RECT r = {10, yext/2,  xext - 10, yext/2 + 40};
		DrawDone(hdc, r);
		return;
	}
	
	if (current_target == 0)
	{
		RECT r = {10, yext - 85, xext - 10, yext - 10};
		DrawAbout(hdc, r);
	}

	current_target_location = GetTarget(current_target);

	old_rop = SetROP2(hdc, R2_XORPEN);
	hOldPen = SelectObject(hdc, GetStockObject(WHITE_PEN));

	n = 20;
	for (i=0; i < n; i++)
	{
		p.x = last.x + ((current_target_location.x - last.x) * i / n);
		p.y = last.y + ((current_target_location.y - last.y) * i / n);
		DrawTarget(hdc, p);
		Sleep(60);
		DrawTarget(hdc, p);
	}

	// final position
	SetROP2(hdc, R2_COPYPEN);
	SelectObject(hdc, GetStockObject(BLACK_PEN));

	DrawTarget(hdc, current_target_location);
	DrawLabel(hdc, current_target_location, szInstructions);

	// put things back
	SetROP2(hdc, old_rop);
	SelectObject(hdc, hOldPen);
}
Ejemplo n.º 4
0
void SightedBomb(
    float x, float y,        // 메인 캐릭터의 좌표
    float sx, float sy,      // 조준의 좌표
    float bvx, float bvy,    // 폭탄의 속도
    bool button              // 버튼의 상태(눌렸으면 true)
) {
    // 폭탄의 상태
    static bool bombing=false;  // 폭격중인지 아닌지를 나타내는 플래그
    static float bx, by;        // 폭탄의 좌표
    static float tx, ty;        // 착탄점의 좌표

    // 폭격중이 아닐 때:
    // 버튼이 눌렸다면 폭격을 수행함.
    // 폭탄의 초기좌표와 착탄점의 좌표를 설정함.
    if (!bombing) {
        if (button) {
            bombing=true;
            bx=x;
            by=y;
            tx=sx;
            ty=sy;
        }
    }

    // 폭격중 일 때:
    // 폭탄을 이동시킴.
    // 폭탄이 착탄점에 도달하였다면 폭발시킴.
    // 폭발의 구체적인 처리는 Explode 함수에서 수행하도록 함.
    else {
        bx+=bvx;
        by+=bvy;
        if (bx==tx && by==ty) {
            Explode();
            bombing=false;
        }
    }

    // 메인 캐릭터와 조준을 그리기:
    // 구체적인 처리는 DrawMyShip関数とDrawScope 함수에서 수행하기로 함.
    // 조준과 지상물과의 접촉 판정 처리를 수행하면,
    // 조준의 가장자리를 점멸하는 것도 가능.
    DrawMyShip(x, y);
    DrawScope(sx, sy);

    // 폭격중인 경우에는 착탄점과 폭탄을 그림:
    // 구체적인 처리는 DrawTarget 함수와 DrawBomb 함수에서 수행하기로 함.
    if (bombing) {
        DrawTarget(tx, ty);
        DrawBomb(bx, by);
    }
}
void
sstSequence::Draw( vsRenderQueue *queue )
{
	vsDisplayList *list = queue->GetGenericList();

	float musicTime = m_mode->GetMusicTime();
//	vsColor baseColor = vsColor::Blue;
//	vsColor c = vsColor::Blue;
	for ( int i = 0; i < m_beatCount; i++ )
		m_segment[i].m_color = vsColor::Blue * GetBrightnessForTimeDelta( musicTime - m_segment[i].m_time );

	float starBrightness = 0.5f;

	float starFadeInTime = 2.0f;
	float starFadeOutTime = 2.0f;

	if ( musicTime < m_start + starFadeInTime )
	{
		starBrightness = vsInterpolate( (musicTime-m_start) / starFadeInTime, 0.f, starBrightness );
	}
	else if ( musicTime < m_end - starFadeOutTime )
	{
		starBrightness = 0.5f;
	}
	else
	{
		float startFadingOutTime = m_end - starFadeOutTime;

		starBrightness = vsInterpolate( (musicTime-startFadingOutTime) / starFadeOutTime, starBrightness, 0.f );
	}

	list->SetColor( vsColor(1.0f, 1.0f, 1.0f, starBrightness) );
	for ( int i = 0; i < m_beatCount; i++ )
	{
		DrawStar( list, i );
	}

	for ( int i = 0; i < m_beatCount; i++ )
	{
		DrawTarget( list, i );

		if ( i < m_beatCount-1 )
		{
			DrawConnectingLine( list, i, i+1 );
		}
	}
}
Ejemplo n.º 6
0
void DisplayCalibration(
    IplImage* displayImage, 
    const QLCalibrationTarget* targets, 
    const QLCalibrationScore* leftScores, 
    const QLCalibrationScore* rightScores,
    int numTargets,
    const char * windowName)
{
    int tx = 0;
    int ty = 0;

    //Clear the calibration window
    memset(displayImage->imageData, 128, displayImage->imageSize);

    //Loop through each target.
    printf_s("\nCalibration Scores\n");
	for (int i = 0; i < numTargets; i++)
    {
        // Draw the target positions
        tx = (int)targets[i].x * displayImage->width / 100;
        ty = (int)targets[i].y * displayImage->height / 100;
        DrawTarget(displayImage, cvPoint(tx, ty),  20, CV_RGB(50, 50, 50));

        // Draw the left 
        tx = (int)(targets[i].x + leftScores[i].x) * displayImage->width / 100;
        ty = (int)(targets[i].y + leftScores[i].y) * displayImage->height / 100;
        DrawCross(displayImage, cvPoint(tx, ty), 10, CV_RGB(0, 255, 255), 1);

        // Draw the right 
        tx = (int)(targets[i].x + rightScores[i].x) * displayImage->width / 100;
        ty = (int)(targets[i].y + rightScores[i].y) * displayImage->height / 100;
        DrawCross(displayImage, cvPoint(tx, ty), 10, CV_RGB(255, 0, 0), 1);

	    cvShowImage(windowName, displayImage);

        printf_s("%2.2f %2.2f ", leftScores[i].score, rightScores[i].score);
    }
    printf_s("\n");


};
Ejemplo n.º 7
0
void TargetLauncher::Refresh()
{
  DrawTarget();
  WeaponLauncher::Refresh();
}
Ejemplo n.º 8
0
void TargetLauncher::Draw()
{
  WeaponLauncher::Draw();
  DrawTarget();
}
Ejemplo n.º 9
0
void Display( void )
{
    
    DoUpdateStep();
    
    float scale2;           /* real glui scale factor               */
    
    glutSetWindow( GrWindow );
    
    glDrawBuffer( GL_BACK );
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    glEnable( GL_DEPTH_TEST );
    
    glShadeModel( GL_FLAT );
    
    glMatrixMode( GL_PROJECTION );
    glLoadIdentity();
    
    if (WhichProjection == ORTHO)
        glOrtho(-3., 3.,     -1.7, 1.7,     0.1, 1000.);
    //glOrtho(-3., 3.,     -3., 3.,     0.1, 1000.);
    else
        gluPerspective(75., 1., 0.1, 1000.);
    // gluPerspective(90., 1.,      0.1, 1000.);
    
    glMatrixMode( GL_MODELVIEW );
    glLoadIdentity();
    gluLookAt( -3., 0., 3.,     0., 0., 0.,     0., 1., 0. );
    
    glTranslatef( TransXYZ[0], TransXYZ[1], -TransXYZ[2] );
    
    glRotatef( Yrot, 0., 1., 0. );
    glRotatef( Xrot, 1., 0., 0. );
    glMultMatrixf( (const GLfloat *) RotMatrix );
    
    glScalef( Scale, Scale, Scale );
    scale2 = 1. + Scale2;           /* because glui translation starts at 0. */
    if( scale2 < MINSCALE )
        scale2 = MINSCALE;
    glScalef( scale2, scale2, scale2 );
    
    if( AxesOn ) {
        glDisable(GL_LIGHTING);
        glCallList( AxesList );
        glEnable(GL_LIGHTING);
    }
    
    GLUI_Master.set_glutIdleFunc( Animate );
    
    DrawTarget(T);
    
    if (WhichMethod != COMPARE) {
        Tree* tree = ( WhichShape==YSHAPE ) ? &treeY : &treeDoubleY;
        tree->Draw();
    } else {
        GLfloat blue[] = { 0.2f, 0.2f, 0.8f, 1.0f };
        GLfloat green[] = { 0.3f, 0.6f, 0.3f, 1.0f };
        glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, green);
        treeDoubleYDLS.Draw();
        glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue);
        treeDoubleYSDLS.Draw();
    }
    
    if (EigenVectorsOn) {
        if ( WhichMethod == SDLS || WhichMethod == DLS || WhichMethod == PURE_PSEUDO ) {
            Jacobian* jacob;
            switch ( WhichShape ) {
                case YSHAPE:
                    jacob = jacobY;
                    break;
                case DBLYSHAPE:
                    jacob = jacobDoubleY;
                    break;
                default:
                    assert ( 0 );
            }
            jacob->DrawEigenVectors();
        }
    }
    
    glFlush();
    
    /*   FOLLOWING BLOCK OF CODE USED FOR MAKING MOVIES
     *        if ( WhichMethod == JACOB_TRANS && WhichShape==DBLYSHAPE && (SleepCounter%SleepsPerStep)==0 ) { 
     *                if (DumpCounter==0) {
     *                        T = 0.0;                // Set time back to zero
     } 
     if ( DumpCounter >= DumpCounterStart && DumpCounter<DumpCounterEnd ) {
         theScreenImage.LoadFromOpenglBuffer();
         int fileNum = DumpCounter - DumpCounterStart;
         char filename[23];
         sprintf( filename, "JTRANSPOSE/temp%03d.bmp", fileNum );
         theScreenImage.WriteBmpFile( filename );
     }
     DumpCounter++;
     }
     */
    
    glutSwapBuffers();
     }
Ejemplo n.º 10
0
int main (void)
{
    const double YS_PI=3.1415927;
    FsOpenWindow(16, 16, 800, 600, 1);
    
    int ObstaclesState[5];
    int x1[5], y1[5], x2[5], y2[5];
    
    int Point[10000];//trajectory
    int p[10000],q[10000];//trajectory
    
    srand((unsigned)time(NULL));
    
   // for(int i=0;i<10000;i++)
   // {
   //     Point[i]=1;
   // }//draw points
    
    for(int i=0;i<5;++i)
    {
    x1[i]=rand()%720;
    y1[i]=rand()%520;
    x2[i]=x1[i]+80+rand()%70;
    y2[i]=y1[i]+80+rand()%70;
    ObstaclesState[i]=1;
    }
    
    int terminate=0;
    int y=0;
    int x=30;
    int a=55;
    int b=545;
    
    double m=1.0;
    double dt=0.025;
    int CannonballState=0;
  
    int angle=30;
    
    double vx;
    double vy;

    int Hit=0;
    int TargetState=1;
    
  
    while(0==terminate)
 {
     FsPollDevice();
     
     angle++;
     if(angle>=90) angle=0;
     
     int key=FsInkey();
       if(FSKEY_ESC==key)
       {
          terminate=1;
       }
       else if(FSKEY_SPACE==key)
     {
         if(0==CannonballState)
       {
           CannonballState=1;

           vx=cos(angle*YS_PI/180)*400;
           vy=-sin(angle*YS_PI/180)*400;
       }
     }

     //draw screen
     glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

     if(0!=ObstaclesState)
		{
			for(int i=0; i<5; ++i)
			{
				if(0!=ObstaclesState[i])
                {
                    DrawObstacles(x1[i],y1[i],x2[i],y2[i]);
                if(0!=CannonballState && 0!=CheckCollision(a, b, x1[i], y1[i], x2[i], y2[i]))
                 {
                    printf("Hit An Obstacle!\n");
                    ObstaclesState[i]=0;
                    CannonballState=0;
                    Hit=1;
                    a=55;
                    b=545;
                 }
                }
                if(0!=Hit)
                {
                    DrawObstacles2(x1[i],y1[i],x2[i],y2[i]);
                }
            }
        }
     
    if(0!=TargetState)
                 {
                    if(0!=CannonballState && 0!=CheckHit(a, b, y))
                    {
                        printf("HitTarget!\n");
                        TargetState=0;
                        CannonballState=0;
                        break;
                    }
                 }
        
    DrawCannonLine(x);
    RotateCannonline(x, 90);
    DrawCannon();
    DrawTarget(y);
    MoveTarget(y, 600);

     if(0!=CannonballState)
     {
        DrawCannonball(a, b);
        MoveCannonball(a, b, vx, vy, m, dt);
         
        // for(int i=0;i<10000;i++)
        // {
        //     Point[i]=1;
        // }//draw points
         
       //  if(0!=Point)//not working
       //  {
             for(int i=0; i<10000; ++i)
             {
       //          if(0!=Point[i])
        //         {
                     p[i]=a;
                 //    printf("%d\n",a);
                     q[i]=b;
//                     DrawTrajectory(p[i], q[i]);
         ///        }
           //  }
         }
        if(a>800||b>600)
         {
             CannonballState=0;
             a=55;
             b=545;
         }
     }
    FsSwapBuffers();
    FsSleep(25);
 }
    return 0;
}
Ejemplo n.º 11
0
void
RenderTaskPoint::Draw(const TaskPoint &tp, Layer layer)
{
    const OrderedTaskPoint &otp = (const OrderedTaskPoint &)tp;
    const AATPoint &atp = (const AATPoint &)tp;

    switch (tp.GetType()) {
    case TaskPoint::UNORDERED:
        if (layer == LAYER_LEG)
            DrawTaskLine(location, tp.GetLocationRemaining());

        if (layer == LAYER_SYMBOLS)
            DrawBearing(tp);

        index++;
        break;

    case TaskPoint::START:
        index = 0;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawBearing(tp);
            DrawTarget(tp);
        }

        break;

    case TaskPoint::AST:
        index++;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawBearing(tp);
            DrawTarget(tp);
        }
        break;

    case TaskPoint::AAT:
        index++;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawIsoline(atp);
            DrawBearing(tp);
            DrawTarget(tp);
        }
        break;

    case TaskPoint::FINISH:
        index++;

        DrawOrdered(otp, layer);
        if (layer == LAYER_SYMBOLS) {
            DrawBearing(tp);
            DrawTarget(tp);
        }
        break;

    case TaskPoint::ROUTE:
        /* unreachable */
        assert(false);
        break;
    }
}
Ejemplo n.º 12
0
bool CalibrateTarget(
    QLCalibrationId calibrationId,
    QLCalibrationTarget target,
    IplImage* displayImage,
    const char* windowName)
{
    // Loop on this target until eye data was successfully collected for each
    // eye.
    QLCalibrationStatus status = QL_CALIBRATION_STATUS_OK;
    do
    {
	    //Clear the calibration window
	    memset(displayImage->imageData, 128, displayImage->imageSize);

	    // Display the cleared image buffer in the calibration window.
	    cvShowImage(windowName, displayImage);

        // Wait for a little bit so show the blanked screen.
        if(cvWaitKeyEsc == cvWaitKey(100))
            return false;

        // The target positions are in percentage of the area to be tracked so
        // we need to scale to the calibration window size.
        int tx = (int)target.x * displayImage->width / 100;
        int ty = (int)target.y * displayImage->height / 100;

	    // Draw a target to the image buffer
	    DrawTarget(displayImage, cvPoint(tx, ty),  20, CV_RGB(0, 255, 0));
    		
	    // Display the image buffer in the calibration window.
	    cvShowImage(windowName, displayImage);

	    // Wait a little bit so the user can see the target before we calibrate.
	    cvWaitKey(250);

        // Calibrate the target for 1000 ms. This can be done two ways; blocking and
        // non-blocking. For blocking set the block variable to true. for
        // non-blocking set it to false. 
	    bool block = false;
        QLCalibration_Calibrate(calibrationId, target.targetId, 1500, block);

        // When non-blocking is used, the status of the target needs to be
        // polled to determine when it has finished. During the polling we can
        // do other things like querying user input as we do here to see if
        // the user wants to quit the calibration.
        int keyPressed = 0;
        while(!block &&
            ((keyPressed = cvWaitKey(10)) != cvWaitKeyEsc) &&
            (QLCalibration_GetStatus(calibrationId, target.targetId, &status) == QL_ERROR_OK) &&
            (status == QL_CALIBRATION_STATUS_CALIBRATING));

        // If the user terminated the calibration early then return false.
        if(keyPressed == cvWaitKeyEsc)
            return false;

        // Get the status of the target.
        QLCalibration_GetStatus(calibrationId, target.targetId, &status);
    }while(status != QL_CALIBRATION_STATUS_OK);

    // Return true to indicate that the target has successfully been calibrated
    return true;
};
Ejemplo n.º 13
0
void MapWindow::DrawInfoPage(HDC hdc,  RECT rc, bool forceinit )
{
  HFONT		oldfont=0;
  //SIZE TextSize;
  TCHAR Buffer[LKSIZEBUFFERLARGE];
  TCHAR BufferTitle[LKSIZEBUFFERTITLE];
  TCHAR BufferValue[LKSIZEBUFFERVALUE];
  TCHAR BufferUnit[LKSIZEBUFFERUNIT];
  TCHAR Empty[2]; // 100407
  int index=-1;

  static short	column[PANELCOLUMNS+1], hcolumn[(PANELCOLUMNS*2)+1], qcolumn[(PANELCOLUMNS*4)+1];
  static short	row[PANELROWS+1], hrow[(PANELCOLUMNS*2)+1], qrow[(PANELROWS*4)+1];

  bool showunit=false;
  _tcscpy(Empty,_T(""));

  if (forceinit) DoInit[MDI_DRAWINFOPAGE]=true;

	oldfont = (HFONT)SelectObject(hdc, LKINFOFONT); // save font

  if (DoInit[MDI_DRAWINFOPAGE]) {
	DoInit[MDI_DRAWINFOPAGE]=false;
	// function can only be called in fullscreen  and thus can be inited here
	column[0]=LEFTLIMITER;
	column[1]=((rc.right-RIGHTLIMITER-LEFTLIMITER)/PANELCOLUMNS)+LEFTLIMITER;
	column[2]=column[1]*2-LEFTLIMITER;
	column[3]=column[1]*3-LEFTLIMITER*2;
	column[PANELCOLUMNS]=rc.right-RIGHTLIMITER;
	row[0]=rc.top+TOPLIMITER;
	row[1]=((rc.bottom-BottomSize-row[0]-BOTTOMLIMITER)/PANELROWS)+row[0];
	row[2]=((rc.bottom-BottomSize-row[0]-BOTTOMLIMITER)/PANELROWS)*2+row[0];
	row[3]=((rc.bottom-BottomSize-row[0]-BOTTOMLIMITER)/PANELROWS)*3+row[0];
	row[PANELROWS]=rc.bottom-BottomSize-BOTTOMLIMITER;

	hcolumn[0]=column[0];
	hcolumn[1]=(column[1]-column[0])/2;
	hcolumn[2]=column[1];
	hcolumn[3]=(column[2]-column[1])/2+column[1];
	hcolumn[4]=column[2];
	hcolumn[5]=(column[3]-column[2])/2+column[2];
	hcolumn[6]=column[3];
	hcolumn[7]=(column[4]-column[3])/2+column[3];
	hcolumn[8]=column[4];

	hrow[0]=row[0];
	hrow[1]=(row[1]-row[0])/2;
	hrow[2]=row[1];
	hrow[3]=(row[2]-row[1])/2+row[1];
	hrow[4]=row[2];
	hrow[5]=(row[3]-row[2])/2+row[2];
	hrow[6]=row[3];
	hrow[7]=(row[4]-row[3])/2+row[3];
	hrow[8]=row[4];

	qcolumn[0]=hcolumn[0];
	qcolumn[1]=(hcolumn[1]-hcolumn[0])/2+hcolumn[0];
	qcolumn[2]=hcolumn[1];
	qcolumn[3]=(hcolumn[2]-hcolumn[1])/2+hcolumn[1];
	qcolumn[4]=hcolumn[2];
	qcolumn[5]=(hcolumn[3]-hcolumn[2])/2+hcolumn[2];
	qcolumn[6]=hcolumn[3];
	qcolumn[7]=(hcolumn[4]-hcolumn[3])/2+hcolumn[3];
	qcolumn[8]=hcolumn[4];
	qcolumn[9]=(hcolumn[5]-hcolumn[4])/2+hcolumn[4];
	qcolumn[10]=hcolumn[5];
	qcolumn[11]=(hcolumn[6]-hcolumn[5])/2+hcolumn[5];
	qcolumn[12]=hcolumn[6];
	qcolumn[13]=(hcolumn[7]-hcolumn[6])/2+hcolumn[6];
	qcolumn[14]=hcolumn[7];
	qcolumn[15]=(hcolumn[8]-hcolumn[7])/2+hcolumn[7];
	qcolumn[16]=hcolumn[8];

	qrow[0]=hrow[0];
	qrow[1]=(hrow[1]-hrow[0])/2+hrow[0];
	qrow[2]=hrow[1];
	qrow[3]=(hrow[2]-hrow[1])/2+hrow[1];
	qrow[4]=hrow[2];
	qrow[5]=(hrow[3]-hrow[2])/2+hrow[2];
	qrow[6]=hrow[3];
	qrow[7]=(hrow[4]-hrow[3])/2+hrow[3];
	qrow[8]=hrow[4];
	qrow[9]=(hrow[5]-hrow[4])/2+hrow[4];
	qrow[10]=hrow[5];
	qrow[11]=(hrow[6]-hrow[5])/2+hrow[5];
	qrow[12]=hrow[6];
	qrow[13]=(hrow[7]-hrow[6])/2+hrow[6];
	qrow[14]=hrow[7];
	qrow[15]=(hrow[8]-hrow[7])/2+hrow[7];
	qrow[16]=hrow[8];

	qrow[5]+=NIBLSCALE(6);
	qrow[6]+=NIBLSCALE(6);
	qrow[7]+=NIBLSCALE(6);
	qrow[8]+=NIBLSCALE(6)*2;
	qrow[9]+=NIBLSCALE(6)*2;
	qrow[10]+=NIBLSCALE(6)*2;
	qrow[11]+=NIBLSCALE(6)*3;
	qrow[12]+=NIBLSCALE(6)*3;
	qrow[13]+=NIBLSCALE(6)*3;

  } // doinit

#include "./LKMW3include2.cpp"

	SelectObject(hdc, LK8PanelBigFont);
#include "./LKMW3include1.cpp"

	int curtype; // 100404
	bool ontarget=false;
	FLARM_TRAFFIC *pTarget=NULL;
	if ( (MapSpaceMode != MSM_INFO_TRF) && (MapSpaceMode != MSM_INFO_TARGET) ) {
		curtype=CURTYPE;
	} else {
		if (MapSpaceMode == MSM_INFO_TRF)
			curtype=IM_TRF + IM_TOP;
		else
			curtype=IM_TARGET + IM_TOP;

		if (LKTargetIndex<0 || LKTargetIndex>=MAXTRAFFIC) {
			ontarget=false;
		} else {
			if (DrawInfo.FLARM_Traffic[LKTargetIndex].ID <=0) {
				ontarget=false;
			} else {
				ontarget=true;
				pTarget=&DrawInfo.FLARM_Traffic[LKTargetIndex];
			}
		}
	}

	if (ontarget) DoTarget(&DrawInfo, &DerivedDrawInfo);

	switch (LKevent) {
		case LKEVENT_NONE:
			break;
		case LKEVENT_ENTER:
			break;
		case LKEVENT_NEWRUN:
			break;
		case LKEVENT_PAGEUP:
			break;
		case LKEVENT_PAGEDOWN:
			break;
		default:
			break;
	}
	LKevent=LKEVENT_NONE; 

	COLORREF icolor; // 091229

	// R0 C0	= status
	SelectObject(hdc, LK8PanelMediumFont);
	switch(curtype) {
		case IM_THERMAL:
			_stprintf(Buffer,_T("%d.%d %s"),ModeIndex, curtype+1, gettext(TEXT("_@M905_"))); // Thermal
			break;
		case IM_CRUISE:
			_stprintf(Buffer,_T("%d.%d %s"),ModeIndex, curtype+1, gettext(TEXT("_@M906_"))); // Cruise
			break;
		case IM_TASK:
			_stprintf(Buffer,_T("%d.%d %s"),ModeIndex, curtype+1, gettext(TEXT("_@M907_"))); // Task
			break;
		case IM_AUX:
			_stprintf(Buffer,_T("%d.%d %s"),ModeIndex, curtype+1, gettext(TEXT("_@M908_"))); // Custom
			break;
		case IM_TRI:
#ifndef LKCOMPETITION
			_stprintf(Buffer,_T("%d.%d %s"), ModeIndex, curtype+1, gettext(TEXT("_@M909_"))); // Turn
#else
			_stprintf(Buffer,_T("%d.%d %s"), ModeIndex, curtype+1, gettext(TEXT("_@M1600_"))); // DISABLED
#endif
			break;
		case IM_HSI:
			wsprintf(Buffer,_T("%d.%d %s"), ModeIndex, curtype+1, gettext(TEXT("_@M1860_"))); // HSI
			break;
		case IM_CONTEST:
			_stprintf(Buffer,_T("%d.%d %s"), ModeIndex, curtype+1, gettext(TEXT("_@M957_"))); // Contest
			break;
		case IM_TRF+IM_TOP:
			_stprintf(Buffer,_T("%d.%d %s"), ModeIndex, IM_TRF+1, gettext(TEXT("_@M910_"))); // Target
			break;
		case IM_TARGET+IM_TOP:
			_stprintf(Buffer,_T("%d.%d %s"), ModeIndex, IM_TARGET+1, gettext(TEXT("_@M911_"))); // Sight
			break;
		default:
			_stprintf(Buffer,_T("error"));
			break;
	}
        LKWriteText(hdc, Buffer, qcolumn[0],qrow[0], 0, WTMODE_NORMAL, WTALIGN_LEFT, RGB_LIGHTGREEN, false);

	// R0 C1
	icolor=RGB_WHITE;
	switch(curtype) {
		case IM_THERMAL:
		case IM_CRUISE:
		case IM_TASK:
		case IM_AUX:
			if ( ValidTaskPoint(ActiveWayPoint) != false ) {
				index = Task[ActiveWayPoint].Index;
				if ( index >=0 ) {
					_tcscpy(Buffer, WayPointList[index].Name);
				} else {
					_stprintf(Buffer,gettext(TEXT("_@M912_"))); // [no dest]
					icolor=RGB_AMBER;
				}
			} else {
				_stprintf(Buffer,gettext(TEXT("_@M912_"))); // [no dest]
				icolor=RGB_AMBER;
			}
			break;
		case IM_TRI:
#ifndef LKCOMPETITION
			_stprintf(Buffer,gettext(TEXT("_@M913_"))); // Experimental
#else
			_stprintf(Buffer,_T("---"));
#endif
			break;
		case IM_CONTEST:
		case IM_HSI: //for the HSI the title text is computed in his section down
			_stprintf(Buffer,gettext(TEXT("")));
			break;
		case IM_TRF+IM_TOP:
		case IM_TARGET+IM_TOP:
			if (ontarget) {
				switch (pTarget->Status ) {
					case LKT_GHOST:
						icolor=RGB_LIGHTYELLOW;
						break;
					case LKT_ZOMBIE:
						icolor=RGB_LIGHTRED;
						break;
					default:
						icolor=RGB_WHITE;
						break;
				}
				//TCHAR status[80];
				if (_tcslen(pTarget->Name) == 1) {
					_stprintf(Buffer,_T("%0x"),(unsigned)pTarget->ID);
				} else {
					_stprintf(Buffer,_T("%s"),pTarget->Name);
				}

			} else {
				_stprintf(Buffer,gettext(TEXT("_@M914_"))); // [no target]
				icolor=RGB_AMBER;
			}

			break;
		default:
			_stprintf(Buffer,_T("error"));
			icolor=RGB_AMBER;
			break;
	}
        LKWriteText(hdc, Buffer, qcolumn[8],qrow[1], 0, WTMODE_NORMAL, WTALIGN_CENTER, icolor, false);

	// R0 C2	= time of day
	if ( (curtype == (IM_TOP+IM_TRF)) || (curtype == (IM_TOP+IM_TARGET)) ) {
		if (ontarget) {
			TCHAR tpas[30];
			Units::TimeToTextDown(tpas,(int)(DrawInfo.Time - pTarget->Time_Fix));

			switch (pTarget->Status) {
				case LKT_REAL:
					_stprintf(Buffer,_T("LIVE"));
					break;
				case LKT_GHOST:
					_stprintf(Buffer,_T("ghost %s\""),tpas);
					break;
				case LKT_ZOMBIE:
					_stprintf(Buffer,_T("zombie %s\""),tpas);
					break;
				default:
					_stprintf(Buffer,_T("??? %s\""),tpas);
					break;
			}
        		LKWriteText(hdc, Buffer, qcolumn[16],qrow[0], 0, WTMODE_NORMAL, WTALIGN_RIGHT, icolor, false);
		} else {
			LKFormatValue(LK_TIME_LOCALSEC, false, BufferValue, BufferUnit, BufferTitle); // 091219
        		LKWriteText(hdc, BufferValue, qcolumn[16],qrow[0], 0, WTMODE_NORMAL, WTALIGN_RIGHT, RGB_WHITE, false);
		}
		if ( curtype == (IM_TOP+IM_TARGET) ) goto label_Target;
	} else {
		LKFormatValue(LK_TIME_LOCALSEC, false, BufferValue, BufferUnit, BufferTitle); // 091219
        	LKWriteText(hdc, BufferValue, qcolumn[16],qrow[0], 0, WTMODE_NORMAL, WTALIGN_RIGHT, RGB_WHITE, false);
	}

	if (curtype == IM_TRI) goto label_TRI;
	if (curtype == IM_HSI) goto label_HSI;

	VDrawLine(hdc,rc, qcolumn[0],qrow[2],qcolumn[16],qrow[2],RGB_DARKGREEN);
	VDrawLine(hdc,rc, qcolumn[0],qrow[8],qcolumn[16],qrow[8],RGB_DARKGREEN);

	// R1 C1
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_NEXT_DIST, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_NEXT_DIST, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_AUX:
			index=GetInfoboxType(1);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_CLASSIC_DIST, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_DIST, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4], &qrow[3],&qrow[4],&qrow[2]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4], &qrow[3],&qrow[4],&qrow[2]);
			break;
	}

	// R1 C2
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_BRG, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8],&qcolumn[8], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_BRGDIFF, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9],&qcolumn[8], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_FAI_DIST, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8],&qcolumn[8], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_AUX:
			index=GetInfoboxType(2);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8],&qcolumn[8], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_TO, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9],&qcolumn[8], &qrow[3],&qrow[4],&qrow[2]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9],&qcolumn[8], &qrow[3],&qrow[4],&qrow[2]);
			break;
	}


	// R1 C3
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_NEXT_ALTDIFF, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_NEXT_GR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_LEAGUE_DIST, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_AUX:
			index=GetInfoboxType(3);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12], &qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_GR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12], &qrow[3],&qrow[4],&qrow[2]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12], &qrow[3],&qrow[4],&qrow[2]);
			break;
	}

	// R1 C4
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_NEXT_GR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16],&qcolumn[16], 
											&qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_LD_AVR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16],&qcolumn[16], 
											&qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_3TPS_DIST, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16],&qcolumn[16], 
											&qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_AUX:
			index=GetInfoboxType(4);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16],&qcolumn[16], 
											&qrow[3],&qrow[4],&qrow[2]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_ALTARRIV, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16],&qcolumn[16], 
											&qrow[3],&qrow[4],&qrow[2]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16],&qcolumn[16], 
											&qrow[3],&qrow[4],&qrow[2]);
			break;
	}

	// R2  C1
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_HNAV, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_NEXT_ALTDIFF, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_CLASSIC_PREDICTED_DIST, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_AUX:
			index=GetInfoboxType(5);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_ALTDIFF, false, BufferValue, BufferUnit, BufferTitle);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			break;
	}
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4],&qcolumn[4], &qrow[6],&qrow[7],&qrow[5]);

	// R2  C2
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_GNDSPEED, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8], &qrow[6],&qrow[7],&qrow[5]);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_BRG, true , BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[8], &qrow[6],&qrow[7],&qrow[5]);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_FAI_PREDICTED_DIST, true , BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8], &qrow[6],&qrow[7],&qrow[5]);
			break;
		case IM_AUX:
			index=GetInfoboxType(6);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8], &qrow[6],&qrow[7],&qrow[5]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_BEARING, true , BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[8], &qrow[6],&qrow[7],&qrow[5]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[8], &qrow[6],&qrow[7],&qrow[5]);
			break;
	}

	// R2  C3
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_VARIO, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_LD_CRUISE, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CONTEST:
			_tcscpy(BufferValue,_T("")); 
            _tcscpy(BufferTitle,_T(""));
			break;
		case IM_AUX:
			index=GetInfoboxType(7);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_EMPTY, true , BufferValue, BufferUnit, BufferTitle);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			break;
	}
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12],&qrow[6],&qrow[7],&qrow[5]);

	// R2  C4
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_FL, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_LD_INST, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_3TPS_PREDICTED_DIST, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
		case IM_AUX:
			index=GetInfoboxType(8);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_EMPTY, false, BufferValue, BufferUnit, BufferTitle);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
	}
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[6],&qrow[7],&qrow[5]);

	// R3  C1
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_TC_GAIN, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CRUISE:
			showunit=LKFormatValue(LK_HNAV, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_TASK:
			showunit=LKFormatValue(LK_FIN_ALTDIFF, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CONTEST:
			//showunit=LKFormatValue(LK_OLC_PLUS_SCORE, false, BufferValue, BufferUnit, BufferTitle);
			showunit=LKFormatValue(LK_OLC_CLASSIC_SPEED, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_AUX:
			index=GetInfoboxType(9);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_ALT, false, BufferValue, BufferUnit, BufferTitle);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			break;
	}
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[9],&qrow[10],&qrow[8]);

	// R3  C2
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_TC_30S, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[9],&qrow[10],&qrow[8]);
			break;
		case IM_CRUISE:
			showunit=LKFormatValue(LK_TRACK, true, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[8],&qrow[9],&qrow[10],&qrow[8]);
			break;
		case IM_TASK:
			showunit=LKFormatValue(LK_FIN_DIST, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[9],&qrow[10],&qrow[8]);
			break;
		case IM_CONTEST:
			//showunit=LKFormatValue(LK_OLC_PLUS_PREDICTED_SCORE, false, BufferValue, BufferUnit, BufferTitle);
			showunit=LKFormatValue(LK_OLC_FAI_SPEED, false, BufferValue, BufferUnit, BufferTitle); 
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[9],&qrow[10],&qrow[8]);
			break;
		case IM_AUX:
			index=GetInfoboxType(10);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[9],&qrow[10],&qrow[8]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_SPEED, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[9],&qrow[10],&qrow[8]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[8],&qrow[9],&qrow[10],&qrow[8]);
			break;
	}

	// R3  C3
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_TC_AVG, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CRUISE:
			showunit=LKFormatValue(LK_GNDSPEED, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_TASK:
			showunit=LKFormatValue(LK_TASK_DISTCOV, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CONTEST:
			//showunit=LKFormatValue(LK_OLC_LEAGUE_SCORE, false, BufferValue, BufferUnit, BufferTitle);
			showunit=LKFormatValue(LK_OLC_LEAGUE_SPEED, true, BufferValue, BufferUnit, BufferTitle); 
			break;
		case IM_AUX:
			index=GetInfoboxType(11);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_VARIO, false, BufferValue, BufferUnit, BufferTitle);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			break;
	}
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12],&qrow[9],&qrow[10],&qrow[8]);


	// R3  C4
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_TC_ALL, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
		case IM_CRUISE:
			showunit=LKFormatValue(LK_FL, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_TASK:
			showunit=LKFormatValue(LK_FIN_GR, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_3TPS_SPEED, true, BufferValue, BufferUnit, BufferTitle); 
			_tcscpy(BufferUnit,_T(""));
			break;
		case IM_AUX:
			index=GetInfoboxType(12);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_AVGVARIO, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
	}
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[9],&qrow[10],&qrow[8]);


	// R4  C1
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_WIND, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[5], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_CRUISE:
			showunit=LKFormatValue(LK_WIND, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[5], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_TASK:
			showunit=LKFormatValue(LK_FIN_ALTDIFF0, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_CONTEST:
			showunit=LKFormatValue(LK_OLC_PLUS_SCORE, false, BufferValue, BufferUnit, BufferTitle);
			//showunit=LKFormatValue(LK_OLC_CLASSIC_SPEED, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_AUX:
			index=GetInfoboxType(13);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_TRF+IM_TOP:
			LKFormatValue(LK_EMPTY, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
			break;
	}

	// R4  C2
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_EMPTY, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[9],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_CRUISE:
			showunit=LKFormatValue(LK_TL_AVG, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[9],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_TASK:
			showunit=LKFormatValue(LK_LKFIN_ETE, false, BufferValue, BufferUnit, BufferTitle); 
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[9],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_CONTEST:
			//showunit=LKFormatValue(LK_OLC_FAI_SPEED, false, BufferValue, BufferUnit, BufferTitle); 
			showunit=LKFormatValue(LK_OLC_PLUS_PREDICTED_SCORE, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_AUX:
			index=GetInfoboxType(14);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_TARGET_EIAS, false, BufferValue, BufferUnit, BufferTitle); 
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[8], &qcolumn[8],&qrow[12],&qrow[13],&qrow[11]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[9], &qcolumn[9],&qrow[12],&qrow[13],&qrow[11]);
			break;
	}

	// R4  C3
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_EMPTY, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[13], &qcolumn[13],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_CRUISE:
			showunit=LKFormatValue(LK_TC_ALL, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[13], &qcolumn[13],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_TASK:
			showunit=LKFormatValue(LK_SPEEDTASK_ACH, true, BufferValue, BufferUnit, BufferTitle); 
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[13], &qcolumn[13],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_CONTEST:
			//showunit=LKFormatValue(LK_OLC_LEAGUE_SPEED, true, BufferValue, BufferUnit, BufferTitle); 
			showunit=LKFormatValue(LK_OLC_LEAGUE_SCORE, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_AUX:
			index=GetInfoboxType(15);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[12], &qcolumn[12],&qrow[12],&qrow[13],&qrow[11]);
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_EMPTY, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[13], &qcolumn[13],&qrow[12],&qrow[13],&qrow[11]);
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[13], &qcolumn[13],&qrow[12],&qrow[13],&qrow[11]);
			break;
	}

	// R4  C4
	showunit=false;
	switch(curtype) {
		case IM_THERMAL:
			showunit=LKFormatValue(LK_EMPTY, false, BufferValue, BufferUnit, BufferTitle);
			break;
		case IM_CRUISE:
		case IM_TASK:
			showunit=LKFormatValue(LK_MC, true, BufferValue, BufferUnit, BufferTitle); 
			break;
		case IM_CONTEST:
			_tcscpy(BufferValue,_T("")); 
            _tcscpy(BufferTitle,_T(""));
			//showunit=LKFormatValue(LK_OLC_3TPS_SPEED, true, BufferValue, BufferUnit, BufferTitle); 
			break;
		case IM_AUX:
			index=GetInfoboxType(16);
			showunit=LKFormatValue(index, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
		case IM_TRF+IM_TOP:
			showunit=LKFormatValue(LK_EMPTY, true, BufferValue, BufferUnit, BufferTitle); 
			break;
		default:
			LKFormatValue(LK_ERROR, false, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			break;
	}
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[12],&qrow[13],&qrow[11]);
	goto label_End;

	// This is the TRI page
	//
	// ATTENTION PLEASE
	// Some values are using direct access to CALCULATED_INFO for fast responses.
	// Other values are using the copy of struct made 1 second later
	//
label_TRI:
#ifndef LKCOMPETITION
	VDrawLine(hdc,rc, qcolumn[0],qrow[2],qcolumn[16],qrow[2],RGB_DARKGREEN);
	DrawTRI(hdc, rc);
	showunit=true; // 091219
	if (ScreenLandscape) {
		// right
		LKFormatValue(LK_TRACK, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[14], &qcolumn[14],&qrow[3],&qrow[4],&qrow[2]);
		LKFormatValue(LK_GNDSPEED, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[14], &qcolumn[14],&qrow[6],&qrow[7],&qrow[5]);
		LKFormatValue(LK_HNAV, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[15], &qcolumn[15],&qrow[9],&qrow[10],&qrow[8]);
		LKFormatValue(LK_VARIO, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[14], &qcolumn[14],&qrow[12],&qrow[13],&qrow[11]);

		// left
		LKFormatValue(LK_IAS, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[6],&qrow[7],&qrow[5]);
		LKFormatValue(LK_BANK_ANGLE, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[3],&qrow[4],&qrow[2]);
		LKFormatValue(LK_GLOAD, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[9],&qrow[10],&qrow[8]);
		LKFormatValue(LK_ODOMETER, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
	} else {
		// right
		LKFormatValue(LK_TRACK, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[14], &qcolumn[14],&qrow[3],&qrow[4],&qrow[2]);
		LKFormatValue(LK_GNDSPEED, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[6],&qrow[7],&qrow[5]);
		LKFormatValue(LK_HNAV, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[9],&qrow[10],&qrow[8]);
		LKFormatValue(LK_VARIO, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[12],&qrow[13],&qrow[11]);

		// left
		LKFormatValue(LK_IAS, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[6],&qrow[7],&qrow[5]);
		LKFormatValue(LK_BANK_ANGLE, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[3],&qrow[4],&qrow[2]);
		LKFormatValue(LK_GLOAD, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[9],&qrow[10],&qrow[8]);
		LKFormatValue(LK_ODOMETER, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
	}
#if 0
	_stprintf(BufferValue,_T("%0.1f"),CALCULATED_INFO.TurnRate);
	_stprintf(BufferTitle,_T("Rate"));
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[9],&qrow[10],&qrow[8]);

	LKFormatValue(LK_GLOAD, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
#endif
	wsprintf(BufferTitle, gettext(TEXT("_@M915_"))); // NOT FOR IFR USAGE
	SelectObject(hdc, LK8PanelSmallFont);
	LKWriteText(hdc, BufferTitle, qcolumn[8],qrow[12], 0, WTMODE_OUTLINED, WTALIGN_CENTER, RGB_ORANGE, false);
#endif // not in LKCOMPETITION 
	goto label_End; // End of TRI

	// This is the HSI page
label_HSI:
	VDrawLine(hdc,rc, qcolumn[0],qrow[2],qcolumn[16],qrow[2],RGB_DARKGREEN);
	static bool showQFU=false;
	static bool showVFRlanding=false;
	HSIreturnStruct HSI;
	HSI=DrawHSI(hdc,rc);
	if(HSI.landing) {
		showVFRlanding=!showVFRlanding; //make it blinking
		if(HSI.usingQFU) showQFU=!showVFRlanding;
		else showQFU=false;
	} else {
		showVFRlanding=false;
		if(HSI.usingQFU) showQFU=!showQFU; //make it blinking
		else showQFU=false;
	}
	if(showVFRlanding || showQFU) { //show QFU or "VFR landing"
		if(showVFRlanding) {
			wsprintf(Buffer,TEXT("VFR %s"),gettext(TEXT("_@M931_"))); //TODO: toupper()
			icolor=INVERTCOLORS?RGB_YELLOW:RGB_DARKYELLOW;
		}
		if(showQFU) {
			#ifndef __MINGW32__
			wsprintf(Buffer, TEXT("QFU: %d\xB0"),WayPointList[Task[ActiveWayPoint].Index].RunwayDir);
			#else
			wsprintf(Buffer, TEXT("QFU: %d°"),WayPointList[Task[ActiveWayPoint].Index].RunwayDir);
			#endif
			icolor=RGB_GREEN;
		}
	} else { //show next waypoint name
		icolor=RGB_WHITE;
		if(ValidTaskPoint(ActiveWayPoint)) {
			if(Task[ActiveWayPoint].Index >=0) _tcscpy(Buffer, WayPointList[Task[ActiveWayPoint].Index].Name);
			else {
				wsprintf(Buffer,gettext(TEXT("_@M912_"))); // [no dest]
				icolor=RGB_AMBER;
			}
		} else {
			wsprintf(Buffer,gettext(TEXT("_@M912_"))); // [no dest]
			icolor=RGB_AMBER;
		}
	}
	SelectObject(hdc, LK8PanelMediumFont);
	LKWriteText(hdc, Buffer, qcolumn[8],qrow[1], 0, WTMODE_NORMAL, WTALIGN_CENTER, icolor, false);
	showunit=true;
	if (ScreenLandscape) {
		LKFormatValue(LK_NEXT_ETE, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[3],&qrow[4],&qrow[2]);
		LKFormatValue(LK_NEXT_DIST, true, BufferValue, BufferUnit, BufferTitle);
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[7],&qrow[8],&qrow[6]);
		LKFormatValue(LK_NEXT_ETA, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
		if(!HSI.approach) { //if not landing print also dist, ETE and ETA respect task end
			LKFormatValue(LK_FIN_ETE, true, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[3],&qrow[4],&qrow[2]);
			LKFormatValue(LK_FIN_DIST, true, BufferValue, BufferUnit, BufferTitle);
			if(ScreenSize==ss800x480 || ScreenSize==ss480x272)
				WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[15], &qcolumn[15],&qrow[7],&qrow[8],&qrow[6]);
			else {
				_tcscpy(BufferUnit,_T(""));
				WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[7],&qrow[8],&qrow[6]);
			}
			LKFormatValue(LK_FIN_ETA, true, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[12],&qrow[13],&qrow[11]);
		} else { //show other interesting things for landing
			int col=16;
			bool unitInvisible=true;
			if(ScreenSize==ss800x480 || ScreenSize==ss480x272) {
				col=15;
				unitInvisible=false;
			}
			LKFormatValue(LK_IAS, true, BufferValue, BufferUnit, BufferTitle);
			if(unitInvisible) _tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[col], &qcolumn[col],&qrow[3],&qrow[4],&qrow[2]);
			LKFormatValue(LK_HAGL, true, BufferValue, BufferUnit, BufferTitle);
			if(unitInvisible) _tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[col], &qcolumn[col],&qrow[12],&qrow[13],&qrow[11]);
		}
	} else {
		LKFormatValue(LK_NEXT_ETE, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[3],&qrow[4],&qrow[2]);
		LKFormatValue(LK_NEXT_DIST, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[6],&qrow[7],&qrow[5]);
		LKFormatValue(LK_NEXT_ETA, true, BufferValue, BufferUnit, BufferTitle);
		_tcscpy(BufferUnit,_T(""));
		WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[4], &qcolumn[4],&qrow[12],&qrow[13],&qrow[11]);
		if(!HSI.approach) { //if not landing print also dist, ETE and ETA respect task end
			LKFormatValue(LK_FIN_ETE, true, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[3],&qrow[4],&qrow[2]);
			LKFormatValue(LK_FIN_DIST, true, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[6],&qrow[7],&qrow[5]);
			LKFormatValue(LK_FIN_ETA, true, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[12],&qrow[13],&qrow[11]);
		} else {
			LKFormatValue(LK_IAS, true, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[3],&qrow[4],&qrow[2]);
			LKFormatValue(LK_HAGL, true, BufferValue, BufferUnit, BufferTitle);
			_tcscpy(BufferUnit,_T(""));
			WriteInfo(hdc, &showunit, BufferValue, BufferUnit, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[12],&qrow[13],&qrow[11]);
		}
	}
	goto label_End; // End of HSI

	// Traffic Target page
	
label_Target:
	VDrawLine(hdc,rc, qcolumn[0],qrow[2],qcolumn[16],qrow[2],RGB_DARKGREEN);
	// pass the sight rectangle to use on the screen. Warning: DrawTarget will cache these values
	// and will not use them after the first run time anymore...
	DrawTarget(hdc, rc, qrow[3],qrow[15],qcolumn[3],qcolumn[13]);

	showunit=false; // 091219

	// left
	
	showunit=LKFormatValue(LK_TARGET_DIST, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[3],&qrow[4],&qrow[2]);

	showunit=LKFormatValue(LK_TARGET_EIAS, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[6],&qrow[7],&qrow[5]);

	showunit=LKFormatValue(LK_TARGET_AVGVARIO, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[9],&qrow[10],&qrow[8]);

	showunit=LKFormatValue(LK_TARGET_GR, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[3], &qcolumn[3],&qrow[12],&qrow[13],&qrow[11]);

	// right
	showunit=LKFormatValue(LK_TARGET_ALTDIFF, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[3],&qrow[4],&qrow[2]);

	showunit=LKFormatValue(LK_EMPTY, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[6],&qrow[7],&qrow[5]);

	showunit=LKFormatValue(LK_EMPTY, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[9],&qrow[10],&qrow[8]);

	showunit=LKFormatValue(LK_TARGET_ALTARRIV, true, BufferValue, BufferUnit, BufferTitle);
	WriteInfo(hdc, &showunit, BufferValue, Empty, BufferTitle, &qcolumn[16], &qcolumn[16],&qrow[12],&qrow[13],&qrow[11]);


label_End:
  // restore font and return
  SelectObject(hdc, oldfont); 

}