From 05a8bfed08a74e8eeb4f9df97eee818060a9085a Mon Sep 17 00:00:00 2001 From: David Webster Date: Tue, 28 Nov 2000 22:13:33 +0000 Subject: [PATCH] Updates to Timer class and a couple of wxDC methods. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/app.cpp | 6 ++++++ src/os2/dc.cpp | 18 ++++++++++++++---- src/os2/timer.cpp | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/os2/app.cpp b/src/os2/app.cpp index a8ccb45bae..cf75302c78 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -760,6 +760,12 @@ bool wxApp::ProcessMessage( } #endif // wxUSE_TOOLTIPS + // + // We must relay Timer events to wxTimer's processing function + // + if (pMsg->msg == WM_TIMER) + wxTimerProc(NULL, 0, pMsg->mp1, 0); + // // For some composite controls (like a combobox), wndThis might be NULL // because the subcontrol is not a wxWindow, but only the control itself diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index 3f0fae3eb1..2de4ebe672 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -1104,14 +1104,24 @@ void wxDC::EndPage() wxCoord wxDC::GetCharHeight() const { - // TODO - return(8); + FONTMETRICS vFM; // metrics structure + + ::GpiQueryFontMetrics( m_hPS + ,sizeof(FONTMETRICS) + ,&vFM + ); + return YDEV2LOGREL(vFM.lXHeight); } wxCoord wxDC::GetCharWidth() const { - // TODO - return(8); + FONTMETRICS vFM; // metrics structure + + ::GpiQueryFontMetrics( m_hPS + ,sizeof(FONTMETRICS) + ,&vFM + ); + return XDEV2LOGREL(vFM.lAveCharWidth); } void wxDC::DoGetTextExtent( diff --git a/src/os2/timer.cpp b/src/os2/timer.cpp index 05784150e4..bd07b4ead0 100644 --- a/src/os2/timer.cpp +++ b/src/os2/timer.cpp @@ -44,7 +44,7 @@ ULONG wxTimerProc(HWND hwnd, ULONG, int nIdTimer, ULONG); IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) -wxTimer::wxTimer() +wxTimer::Init() { m_ulId = 0; } @@ -52,7 +52,7 @@ wxTimer::wxTimer() wxTimer::~wxTimer() { Stop(); - + wxTimer::Stop(); wxTimerList.DeleteObject(this); } -- 2.47.2