float heading = fgGetDouble("/orientation/heading-deg");
int len = 260/2 -
- (puGetStringWidth( puGetDefaultLabelFont(), NewHeadingLabel ) /2 );
+ (puGetDefaultLabelFont().getStringWidth( NewHeadingLabel ) / 2 );
ApHeadingDialog = new puDialogBox (150, 50);
{
}
int len = 260/2 -
- (puGetStringWidth( puGetDefaultLabelFont(), NewAltitudeLabel )/2);
+ (puGetDefaultLabelFont().getStringWidth( NewAltitudeLabel ) / 2);
// ApAltitudeDialog = new puDialogBox (150, 50);
ApAltitudeDialog = new puDialogBox (150, 200);
char *s;
int labelX = (DialogWidth / 2) -
- (puGetStringWidth( puGetDefaultLabelFont(), Label ) / 2);
+ (puGetDefaultLabelFont().getStringWidth( Label ) / 2);
labelX -= 30; // KLUDGEY
int nSliders = 4;
puGetDefaultFonts ( &APAdjustLegendFont, &APAdjustLabelFont );
APAdjustDialog = new puDialogBox ( DialogX, DialogY ); {
- int horiz_slider_height = puGetStringHeight (APAdjustLabelFont) +
- puGetStringDescender (APAdjustLabelFont) +
+ int horiz_slider_height = APAdjustLabelFont.getStringHeight() +
+ APAdjustLabelFont.getStringDescender() +
PUSTR_TGAP + PUSTR_BGAP + 5;
APAdjustFrame = new puFrame ( 0, 0,
sprintf( NewTgtAirportId, "%s",
fgGetString("/sim/startup/airport-id").c_str() );
SG_LOG( SG_AUTOPILOT, SG_INFO, " NewTgtAirportId " << NewTgtAirportId );
- int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
- NewTgtAirportLabel ) / 2;
+ int len = 150
+ - puGetDefaultLabelFont().getStringWidth( NewTgtAirportLabel ) / 2;
TgtAptDialog = new puDialogBox (150, 50);
{
char *s;
int labelX = (DialogWidth / 2) -
- (puGetStringWidth( puGetDefaultLabelFont(), Label ) / 2);
+ ( puGetDefaultLabelFont().getStringWidth( Label ) / 2);
int nSliders = 1;
int slider_x = 10;
puGetDefaultFonts ( &HUDalphaLegendFont, &HUDalphaLabelFont );
HUDalphaDialog = new puDialogBox ( DialogX, DialogY ); {
- int horiz_slider_height = puGetStringHeight (HUDalphaLabelFont) +
- puGetStringDescender (HUDalphaLabelFont) +
+ int horiz_slider_height = HUDalphaLabelFont.getStringHeight() +
+ HUDalphaLabelFont.getStringDescender() +
PUSTR_TGAP + PUSTR_BGAP + 5;
/* puFrame *
fnt->puts(tmp1);
fnt->setPointSize(12);
- char tmp2[p1+1];
+ char tmp2[64];
strncpy(tmp2,msg,p1);
tmp2[p1]='\0';
void Draw()
{
- puDrawString ( guiFnt, msg, FloatToInt(x), FloatToInt(y) );
+ guiFnt.drawString( msg, FloatToInt(x), FloatToInt(y) );
}
};
{
glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle
for(int count=0; count<25; count++) {
- float cosine = r * cos(count * 2 * M_PI/10.0);
- float sine = r * sin(count * 2 * M_PI/10.0);
+ float cosine = r * cos(count * 2 * SG_PI/10.0);
+ float sine = r * sin(count * 2 * SG_PI/10.0);
glVertex2f(cosine+x1, sine+y1);
}
glEnd();
void NewAirportInit(void)
{
sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
- int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
- NewAirportLabel ) / 2;
+ int len = 150
+ - puGetDefaultLabelFont().getStringWidth( NewAirportLabel ) / 2;
AptDialog = new puDialogBox (150, 50);
{
SaveDialog = new puDialogBox (150, 50);
{
SaveDialogFrame = new puFrame (0,0,350, 150);
- SaveDialogMessage = new puText (
- (150 - puGetStringWidth( puGetDefaultLabelFont(), "File Name:" ) / 2), 110);
+ SaveDialogMessage
+ = new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
SaveDialogMessage -> setLabel ("File Name:");
SaveDialogInput = new puInput (50, 70, 300, 100);
LoadDialog = new puDialogBox (150, 50);
{
LoadDialogFrame = new puFrame (0,0,350, 150);
- LoadDialogMessage = new puText (
- (150 - puGetStringWidth( puGetDefaultLabelFont(), "File Name:" ) / 2), 110);
+ LoadDialogMessage
+ = new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
LoadDialogMessage -> setLabel ("File Name:");
LoadDialogInput = new puInput (50, 70, 300, 100);
char *s;
// printf("ConfirmExitDialogInit\n");
- int len = 200 - puGetStringWidth( puGetDefaultLabelFont(), msg )/2;
+ int len = 200 - puGetDefaultLabelFont().getStringWidth ( msg ) / 2;
int x = (fgGetInt("/sim/startup/xsize")/2 - 400/2);
int y = (fgGetInt("/sim/startup/ysize")/2 - 100/2);
int slider_y = 55;
int slider_width = 240;
- int horiz_slider_height = puGetStringHeight (&LabelFont) +
- puGetStringDescender (&LabelFont) +
- PUSTR_TGAP + PUSTR_BGAP + 5;
+ int horiz_slider_height = LabelFont.getStringHeight()
+ + LabelFont.getStringDescender()
+ + PUSTR_TGAP + PUSTR_BGAP + 5;
// HACKS
setUserData( this );