** Programmer: Kevin Rosenberg
**
** This is part of the CTSim program
-** Copyright (c) 1983-2001 Kevin Rosenberg
-**
-** $Id$
+** Copyright (c) 1983-2009 Kevin Rosenberg
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
stylusNDC (0., 0., false);
setTextAngle (0.);
- setTextPointSize (12);
+ setTextPointSize (8);
setColor (C_BLACK);
setLineStyle (LS_SOLID);
setMarker (MARKER_POINT);
static const double dPointsPerInch = 72.;
m_dPointsPerPixel = dPointsPerInch / dScreenDPI;
const int iTestPointSize = 12;
- m_pFont = new wxFont (wxROMAN, wxNORMAL, wxNORMAL, wxNORMAL);
- m_pFont->SetPointSize (iTestPointSize);
- m_pFont->SetWeight (wxNORMAL);
- m_pFont->SetStyle (wxNORMAL);
- m_pFont->SetFamily (wxROMAN);
+ m_pFont = new wxFont (iTestPointSize, wxFONTFAMILY_ROMAN,
+ wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
#ifdef MSVC
m_pFont->SetFaceName(wxString("times new roman"));
#endif
{
#if HAVE_WXWINDOWS
if (m_driver.isWX()) {
- int wxFxn = -1;
+ wxRasterOperationMode wxFxn;
switch (ro) {
case RO_AND:
wxFxn = wxAND;
case RO_XOR:
wxFxn = wxXOR;
break;
+ default:
+ return;
}
- if (wxFxn >= 0)
- m_driver.idWX()->SetLogicalFunction (wxFxn);
+ m_driver.idWX()->SetLogicalFunction (wxFxn);
}
#endif
}
double dHeightPixels = height * m_iPhysicalYSize;
double dHeightPoints = dHeightPixels * m_dPointsPerPixel;
m_pFont->SetPointSize (nearest<int>(dHeightPoints));
+#if DEBUG
+ sys_error (ERR_TRACE, "Setting text size to %d points",
+ nearest<int>(dHeightPoints));
+#endif
+
m_driver.idWX()->SetFont (*m_pFont);
}
#endif
#if HAVE_WXWINDOWS
if (m_driver.isWX()) {
m_iTextPointSize = static_cast<int>(height+0.5);
- m_pFont->SetPointSize (m_iTextPointSize);
- m_driver.idWX()->SetFont (*m_pFont);
+ m_pFont->SetPointSize (m_iTextPointSize);
+#if DEBUG
+ sys_error (ERR_TRACE, "Setting point size to %d", m_iTextPointSize);
+#endif
+ m_driver.idWX()->SetFont (*m_pFont);
}
#endif
}
{
#if HAVE_WXWINDOWS
if (m_driver.isWX()) {
- wxString sText (szText);
wxCoord deviceW, deviceH;
- m_driver.idWX()->GetTextExtent (sText, &deviceW, &deviceH);
+ wxString str (wxConvCurrent->cMB2WC(szText));
+ m_driver.idWX()->GetTextExtent (str, &deviceW, &deviceH);
if (m_dTextAngle == 90 || m_dTextAngle == -90) {
wxCoord temp = deviceW;
deviceW = deviceH;
double
SGP::getCharHeight ()
{
- double dHeight = (1. / 25.);
+ double dHeight = (1. / 50.);
#if HAVE_WXWINDOWS
if (m_driver.isWX()) {
dHeight = m_driver.idWX()->GetCharHeight();
dHeight /= static_cast<double>(m_iPhysicalYSize);
- dHeight /= (yv_max - yv_min); // scale to viewport;
+ dHeight /= (yv_max - yv_min); // scale to viewport;
}
#endif
dHeight *= (yw_max - yw_min); // scale to world coordinates
if (m_driver.isWX()) {
dWidth = m_driver.idWX()->GetCharWidth();
dWidth /= static_cast<double>(m_iPhysicalXSize);
- dWidth /= (xv_max - xv_min); // scale to viewport
+ dWidth /= (xv_max - xv_min); // scale to viewport
}
#endif
dWidth *= (xw_max - xw_min); //scale to world coordinates
#endif
#if HAVE_WXWINDOWS
if (m_driver.isWX()) {
- wxString str (pszMessage);
+ wxString str(wxConvCurrent->cMB2WC(pszMessage));
m_driver.idWX()->DrawRotatedText (str, m_iCurrentPhysicalX, m_iCurrentPhysicalY, m_dTextAngle);
}
#endif