From 2c1e8f2ec2400f618468e72f2faf32373f53a4c9 Mon Sep 17 00:00:00 2001 From: David Webster Date: Fri, 25 Jan 2002 04:48:36 +0000 Subject: [PATCH] Child positioning fixes and font adjustments git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/button.cpp | 9 ++++++++- src/os2/font.cpp | 17 ++++++++++++++--- src/os2/textctrl.cpp | 7 ++++++- src/os2/utils.cpp | 4 ++-- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/os2/button.cpp b/src/os2/button.cpp index ab27b61602..33634d0a7a 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -100,7 +100,14 @@ bool wxButton::Create( // Subclass again for purposes of dialog editing mode // SubclassWin(m_hWnd); - SetFont(*wxSMALL_FONT); + wxFont* pButtonFont = new wxFont( 8 + ,wxSWISS + ,wxNORMAL + ,wxNORMAL + ); + SetFont(*pButtonFont); + SetXComp(0); + SetYComp(0); SetSize( rPos.x ,rPos.y ,rSize.x diff --git a/src/os2/font.cpp b/src/os2/font.cpp index 8023ca58c8..c1839db1ca 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -108,8 +108,13 @@ public: // inline int GetPointSize(void) const { - return m_bNativeFontInfoOk ? m_vNativeFontInfo.GetPointSize() - : m_nPointSize; + // + // We don't use the actual native font point size since it is + // the chosen physical font, which is usually only and approximation + // of the desired outline font. The actual displayable point size + // is the one stored in the refData + // + return m_nPointSize; } inline int GetFamily(void) const @@ -402,7 +407,13 @@ bool wxFontRefData::Alloc( // memcpy(&m_vFattrs, &m_vNativeFontInfo.fa, sizeof(m_vFattrs)); memcpy(&m_vFname, &m_vNativeFontInfo.fn, sizeof(m_vFname)); - m_nPointSize = m_vNativeFontInfo.fm.lEmHeight; + // + // Going to leave the point size alone. Mostly we use outline fonts + // that can be set to any point size inside of Presentation Parameters, + // regardless of whether or not the actual font is registered in the system. + // The GpiCreateLogFont will do enough by selecting the right family, + // and face name. + // if (strcmp(m_vNativeFontInfo.fa.szFacename, "Times New Roman") == 0) m_nFamily = wxROMAN; else if (strcmp(m_vNativeFontInfo.fa.szFacename, "Tms Rmn") == 0) diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index 66b4819ebb..61e2be6e40 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -208,7 +208,12 @@ bool wxTextCtrl::Create( // // Set font, position, size and initial value // - SetFont(*wxSMALL_FONT); + wxFont* pTextFont = new wxFont( 10 + ,wxMODERN + ,wxNORMAL + ,wxNORMAL + ); + SetFont(*pTextFont); if (!rsValue.IsEmpty()) { SetValue(rsValue); diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index 6cc381d718..c42628a26d 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -1241,7 +1241,7 @@ void wxOS2SetFont( break; case wxMODERN: - strcpy(zFacename, "System Vio"); + strcpy(zFacename, "System VIO"); break; case wxSWISS: @@ -1250,7 +1250,7 @@ void wxOS2SetFont( case wxDEFAULT: default: - strcpy(zFacename, "System Vio"); + strcpy(zFacename, "System VIO"); break; }