Code:
//=============================================================================
//FRS Range Function Definitions - Copyright ©2008 Songezo Nkukwana
//=============================================================================
#include "RFSAntenna.h"
// =============================================================================
// Globals
//=============================================================================
int ErrMsg(const TCHAR* s)
{
return MessageBox(0,s,_T("ERROR"),MB_OK|MB_ICONEXCLAMATION);
}
//=============================================================================
//handles the WM_CREATE message of the main, parent window; return -1 to fail
HWND OnCreate(const HWND hwnd,CREATESTRUCT *cs, RECT rc, HMENU EditID)
{
return CreateEdit(hwnd,cs->hInstance,0,rc,EditID,_T(""));
}
// EDIT control
HWND CreateEdit(const HWND hParent,const HINSTANCE hInst,DWORD dwStyle,
const RECT rc, HMENU id,const TCHAR* caption)
{
dwStyle|=WS_CHILD|WS_VISIBLE;
return CreateWindowEx(WS_EX_CLIENTEDGE,
_T("edit"),
caption,
dwStyle,
rc.left,
rc.top,
rc.right,
rc.bottom,
(HWND)hParent,
id,
hInst,
0);
}
//=============================================================================
// BUTTON Control
HWND CreateButton(const HWND hParent,const HINSTANCE hInst,DWORD dwStyle,
const RECT rc, HMENU id,const TCHAR* caption)
{
dwStyle|=WS_CHILD|WS_VISIBLE;
return CreateWindowEx(0,
_T("button"),
caption,
dwStyle,
rc.left,
rc.top,
rc.right,
rc.bottom,
hParent,
id,
hInst,
0);
}
// Purpose: Draws rectangle object on the parent window
void paintObject(HWND hwnd, const RECT rc, RGBColor *color, HDC hdc, int border, int brush)
{
HPEN hpen=CreatePen(PS_SOLID, 2, RGB(color[border].R, color[border].G, color[border].B));
HBRUSH hbrush=CreateSolidBrush(RGB(color[brush].R, color[brush].G, color[brush].B));
DrawARectangle(hwnd, hpen, hdc, hbrush, rc);
DeleteObject(hpen);
DeleteObject(hbrush);
}
// Draw Rectangles on Window Area
void drawArea(HWND hwnd, HDC hdc, RGBColor *colors)
{
paintObject(hwnd,initRecArea(10,10,340,230),colors, hdc, BLACK, GREY); // Left window (RADAR ANTENNA)
paintObject(hwnd,initRecArea(345,10,625,285),colors, hdc, BLACK, GREY); // Right window (RADAR TRANSMITTER/RECEIVER)
paintObject(hwnd,initRecArea(10,235,340,335),colors, hdc, BLACK, GREY); // Second left (TARGET)
paintObject(hwnd,initRecArea(10,340,340,440),colors, hdc, BLACK, GREY); // Third left (GENERAL PARAMETERS)
paintObject(hwnd,initRecArea(10,445,690,780),colors, hdc, BLACK, KHAKI); // Yellow window (RESULTS)
paintObject(hwnd,initRecArea(390,550,680,770),colors, hdc, BLACK, KHAKI); // Yellow mini window (RESULTS)
// Ranges small Rectangles
paintObject(hwnd,initRecArea(580,605,640,625),colors, hdc, RED, YELLOW);
paintObject(hwnd,initRecArea(580,635,640,655),colors, hdc, RED, YELLOW);
paintObject(hwnd,initRecArea(580,665,640,685),colors, hdc, RED, YELLOW);
paintObject(hwnd,initRecArea(580,705,640,760),colors, hdc, RED, YELLOW);
}
// Purpose: Draws a rectangle which will have text boxes for input data
void DrawARectangle(HWND hwnd, HPEN hpen, HDC hdc, HBRUSH hbrush, const RECT rc)
{
// Select the new pen and brush, and then draw.
HPEN hpenOld=(HPEN)SelectObject(hdc, hpen);
HBRUSH hbrushOld=(HBRUSH)SelectObject(hdc, hbrush);
Rectangle(hdc,rc.left,rc.top,rc.right,rc.bottom);
SelectObject(hdc, hpenOld);
SelectObject(hdc, hbrushOld);
}
// Initialize rectangle area
RECT initRecArea(int left, int top, int right, int bottom)
{
static RECT rec;
rec.left=left;
rec.top=top;
rec.right=right;
rec.bottom=bottom;
return rec;
}
// Display text on screen
void printText(HWND hWnd, TCHAR txt[], RECT rc, HDC hDC, DWORD fnWeight,
COLORREF bkgrndClr, COLORREF txtColor, BOOL italics)
{
long lfHeight=-MulDiv(12, GetDeviceCaps(hDC, LOGPIXELSY), 72);
HFONT font=CreateFont(lfHeight, 0, 0, 0, fnWeight, italics,
0, 0, 0, 0, 0, 0, 0, _T("Times New Roman"));
HGDIOBJ hDefFont=SelectObject(hDC, font);
SetBkColor(hDC, bkgrndClr);
SetTextColor(hDC, txtColor);
TextOut(hDC, rc.left, rc.top, txt, (int)_tcslen(txt));
SelectObject(hDC, hDefFont);
DeleteObject(hDefFont);
}
// ======================================================================================================
// User Interface functions
/* Labes for Radar Antenna Area */
void RadaAntennaText(HWND hwnd, TCHAR rdrAntenaLbl[5][25], TCHAR deg[], TCHAR db[],
TCHAR halfMin[], TCHAR mtrs[], HDC hdc, TXTFONT fntClr[])
{
// Display semicolons
POINT dsplPos={188, 45};
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 75);
dsplPos.x=188;
dsplPos.y=130;
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 190);
// Display Text (Labels)
printText(hwnd, _T("Radar Antenna"), initRecArea(15,15,0,0), hdc,
fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle); // Header
printText(hwnd, rdrAntenaLbl[AZIM], initRecArea(55,45,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, deg, initRecArea(265,45,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrAntenaLbl[ELEV], initRecArea(48,75,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, deg, initRecArea(265,75,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrAntenaLbl[GAIN], initRecArea(156,130,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, db, initRecArea(265,130,0,0), hdc, fntClr[1].boldStyle,
fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrAntenaLbl[RPM], initRecArea(151,160,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, halfMin, initRecArea(265,160,0,0), hdc, fntClr[1].boldStyle,
fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrAntenaLbl[HGTH], initRecArea(145,190,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, mtrs, initRecArea(265,190,0,0), hdc, fntClr[1].boldStyle,
fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
}
/* Labes for Radar Transceiver Area */
void RadarReceiverText(HWND hwnd, TCHAR rdrTrans_recv[8][20], TCHAR hz[], TCHAR mhz[], TCHAR mtrs[],
TCHAR kw[], TCHAR usec[], TCHAR db[], TCHAR wvlFig[], HDC hdc, TXTFONT fntClr[])
{
// Display semicolons
POINT dsplPos={462, 45};
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 255);
/* Radar Transmitter/Receiver Area */
printText(hwnd, _T("Radar Transmitter/Receiver"),
initRecArea(350,15,0,0), hdc, fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[FREQ], initRecArea(395,45,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, mhz, initRecArea(540,45,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, wvlFig, initRecArea(490,75,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[WVLNTH], initRecArea(388,75,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, mtrs, initRecArea(540,75,0,0), hdc, fntClr[1].boldStyle,
fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[PP], initRecArea(384,105,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, kw, initRecArea(540,105,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[PW], initRecArea(386,135,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, usec, initRecArea(540,135,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[PRF], initRecArea(431,165,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, hz, initRecArea(540,165,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[BNDWTH], initRecArea(401,195,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, mhz, initRecArea(540,195,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[NF], initRecArea(380,225,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, db, initRecArea(540,225,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[LOSS], initRecArea(415,255,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, db, initRecArea(540,255,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
}
/* Labes for Target Area */
void TargetText(HWND hwnd, TCHAR targetLbl[3][30], TCHAR sqm[], TCHAR mtrs[], HDC hdc, TXTFONT fntClr[])
{
char temp[30];
// Display semicolons
POINT dsplPos={188, 270};
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 300);
strcpy(temp,targetLbl[0]);
printText(hwnd, _T("Target"), initRecArea(15,240,0,0), hdc,
fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle); // Header
printText(hwnd, strcat(targetLbl[RCS], targetLbl[RCS+2]), initRecArea(25,270,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, sqm, initRecArea(265,270,0,0), hdc, fntClr[1].boldStyle,
fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, targetLbl[DP], initRecArea(87,300,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, mtrs, initRecArea(265,300,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
strcpy(targetLbl[0], temp);
}
/* Labes for General Parameters Area */
void GenParams(HWND hwnd, TCHAR genPara[2][30], TCHAR FARErng[], TCHAR DPrang[], HDC hdc, TXTFONT fntClr[])
{
// Display semicolons
POINT dsplPos={188, 375};
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 405);
printText(hwnd, _T("General Parameters"), initRecArea(15,345,0,0), hdc,
fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle); // Header
printText(hwnd, genPara[RCS], initRecArea(18,375,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, FARErng, initRecArea(255,375,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, genPara[DP], initRecArea(57,405,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, DPrang, initRecArea(255,405,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
}
// Display text around radio buttons
void RadioButtonsText(HWND hwnd, HDC hdc, TCHAR polarLbl[], TXTFONT fntClr[])
{
printText(hwnd, polarLbl, initRecArea(115,100,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, _T("c"), initRecArea(222,100,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, _T("h"), initRecArea(252,100,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, _T("v"), initRecArea(282,100,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
}
// Insert Edit Controls
void EditBoxes(HWND hwnd, CREATESTRUCT *cs)
{
int next, cnt;
/* RADAR ANTENNA - Edit Boxes */
OnCreate(hwnd,cs,initRecArea(205,45,55,20),rdr_tbl[0]);
OnCreate(hwnd,cs,initRecArea(205,75,55,20),rdr_tbl[1]);
for (next=130, cnt=2;next<=190;next+=30, cnt++){
OnCreate(hwnd,cs,initRecArea(205,next,55,20),rdr_tbl[cnt]);
}
/* RADAR TRANSMITTER/RECEIVER - Edit Boxes */
OnCreate(hwnd,cs,initRecArea(480,45,55,20),rdr_tbl[cnt]);
for (next=105;next<=255;next+=30,cnt++){
OnCreate(hwnd,cs,initRecArea(480,next,55,20),rdr_tbl[cnt]);
}
/* TARGET - Edit Boxes */
OnCreate(hwnd,cs,initRecArea(205,270,55,20),rdr_tbl[cnt++]);
OnCreate(hwnd,cs,initRecArea(205,300,55,20),rdr_tbl[cnt++]);
/* GENERAL PARAMETERS - Edit Boxes */
OnCreate(hwnd,cs,initRecArea(205,375,45,20),rdr_tbl[cnt++]);
OnCreate(hwnd,cs,initRecArea(205,405,45,20),rdr_tbl[cnt++]);
}
// Results Window
void DisplayResultsBox(HWND hwnd, HDC hdc, TCHAR rdrTrans_recv[8][20], TCHAR targetLbl[3][30], TXTFONT fntClr[])
{
POINT dsplPos={280, 480};
/* Initialize headings and labels */
static TCHAR CalcParams[4][34]={_T("Antenna Gain"), _T("Polarisation Loss"),
_T("Signal To Noise Required"), _T("Intergration Improvement Factor")};
static TCHAR rdrRng[]=_T("Radar Range"), rng[]=_T("Ranges"),rdrHrzn[]=_T("Radar Horizon"),
constnt[]=_T("Constant"), db[]=_T("db"),km[]=_T("km"), prfRng[]=_T("PRF-Range"), max[25]=_T("Maximum ");
static TCHAR itlcText[6][20]={_T(" (Two Way)"), _T(" (Static Target)"), _T(" (Moving Target)"),
_T("Figure of Merit"), _T("(Free Space)"), _T("Maximum Radar Range")};
printText(hwnd, _T("Calculated Parameters"), initRecArea(15,450,0,0), hdc,
fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
// Display semicolons
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 750);
dsplPos.x=340;
displayTxtData(hwnd, hdc, dsplPos, fntClr, "dB", 750);
/* Displaying Labels */
printText(hwnd, rdrTrans_recv[PP], initRecArea(202,480,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, CalcParams[AG], initRecArea(123,510,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, itlcText[TW], initRecArea(204,510,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[2].italicStyle);
printText(hwnd, CalcParams[PL], initRecArea(178,540,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, targetLbl[0], initRecArea(152,570,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[1], initRecArea(208,600,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[5], initRecArea(223,630,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, rdrTrans_recv[6], initRecArea(202,660,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, CalcParams[STNR], initRecArea(24,690,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, itlcText[ST], initRecArea(182,690,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[2].italicStyle);
printText(hwnd, CalcParams[STNR], initRecArea(14,720,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
printText(hwnd, itlcText[MT], initRecArea(170,720,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[2].italicStyle);
printText(hwnd, CalcParams[IIF], initRecArea(80,750,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
//Losses
printText(hwnd, rdrTrans_recv[LOSS], initRecArea(390,480,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
dsplPos.x=432;
dsplPos.y=480;
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 480);
dsplPos.x=475;
displayTxtData(hwnd, hdc, dsplPos, fntClr, "dB", 480);
// Constant
printText(hwnd, constnt, initRecArea(535,480,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
dsplPos.x=590;
dsplPos.y=480;
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 510);
dsplPos.x=640;
displayTxtData(hwnd, hdc, dsplPos, fntClr, "dB", 510);
// Figure of Merit
printText(hwnd, itlcText[3], initRecArea(491,510,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[2].italicStyle);
//Ranges
dsplPos.x=570;
dsplPos.y=605;
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 665);
dsplPos.x=645;
dsplPos.y=605;
displayTxtData(hwnd, hdc, dsplPos, fntClr, "km", 665);
dsplPos.x=570;
dsplPos.y=720;
displayTxtData(hwnd, hdc, dsplPos, fntClr, " :", 720);
dsplPos.x=642;
dsplPos.y=705;
displayTxtData(hwnd, hdc, dsplPos, fntClr, " km", 705);
dsplPos.y=735;
displayTxtData(hwnd, hdc, dsplPos, fntClr, " nm", 735);
printText(hwnd, rng, initRecArea(505,565,0,0), hdc, //header
fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[3].txtColor, fntClr[0].italicStyle);
printText(hwnd, rdrRng, initRecArea(395,605,0,0), hdc,
fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[0].italicStyle);
printText(hwnd, itlcText[FS], initRecArea(488,605,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[2].italicStyle);
printText(hwnd, prfRng, initRecArea(498,635,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[0].italicStyle);
printText(hwnd, rdrHrzn, initRecArea(480,665,0,0), hdc,
fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[0].italicStyle);
printText(hwnd, strcat(max, rdrRng), initRecArea(410,720,0,0), hdc,
fntClr[0].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[2].italicStyle);
strcpy(max,"Maximum ");
}
// Display Extra labes or data
void displayTxtData(HWND hwnd, HDC hdc, POINT pos, TXTFONT fntClr[], TCHAR data[], int last)
{
int next;
for (next=pos.y;next<=last;next+=30){
printText(hwnd, data, initRecArea(pos.x,next,0,0),
hdc, fntClr[1].boldStyle, fntClr[0].bkgrngColor, fntClr[0].txtColor, fntClr[1].italicStyle);
}
}