]> git.saurik.com Git - wxWidgets.git/commitdiff
Updates to Timer class and a couple of wxDC methods.
authorDavid Webster <Dave.Webster@bhmi.com>
Tue, 28 Nov 2000 22:13:33 +0000 (22:13 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Tue, 28 Nov 2000 22:13:33 +0000 (22:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/app.cpp
src/os2/dc.cpp
src/os2/timer.cpp

index a8ccb45bae423137e9558e64e333ba76c72f9d06..cf75302c7832d741c13623afa382663aef7f4d15 100644 (file)
@@ -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
index 3f0fae3eb12d494423d4b60543b7ccc33e274750..2de4ebe67253fd915852dcf918445633458620b2 100644 (file)
@@ -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(
index 05784150e481451763e88a241148bf5c503bfd97..bd07b4ead059a41d6376bdc741e56fc4b54cf0f9 100644 (file)
@@ -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);
 }