]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcclient.cpp
Corrected the signature for wxFrame::Maximize
[wxWidgets.git] / src / gtk / dcclient.cpp
index e75db15ce07048088a3dc44bb14d097890f103fe..2b2cc3d3a3cdc085b0925fe4b94b16f72cf2669c 100644 (file)
@@ -115,11 +115,6 @@ wxPaintDC::wxPaintDC( wxWindow *window )
   m_isDrawable = TRUE;
         
   SetUpDC();
-  
-  long x = 0;
-  long y = 0;
-  window->GetDrawingOffset( &x, &y );
-  SetInternalDeviceOrigin( -x, -y );
 }
 
 wxPaintDC::~wxPaintDC(void)
@@ -552,22 +547,25 @@ void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(us
   }
 }
 
-
-
 bool wxPaintDC::CanGetTextExtent(void) const
 {
   return TRUE;
 }
 
 void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height,
-                     long *WXUNUSED(descent), long *WXUNUSED(externalLeading),
-                     wxFont *WXUNUSED(theFont), bool WXUNUSED(use16) )
+                     long *descent, long *externalLeading,
+                     wxFont *theFont, bool WXUNUSED(use16) )
 {
   if (!Ok()) return;
   
-  GdkFont *font = m_font.GetInternalFont( m_scaleY );
+  wxFont fontToUse = m_font;
+  if (theFont) fontToUse = *theFont;
+  
+  GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
   if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX);
   if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
+  if (descent) (*descent) = long(font->descent / m_scaleY);
+  if (externalLeading) (*externalLeading) = 0;  // ??
 }
 
 long wxPaintDC::GetCharWidth(void)
@@ -575,7 +573,7 @@ long wxPaintDC::GetCharWidth(void)
   if (!Ok()) return 0;
   
   GdkFont *font = m_font.GetInternalFont( m_scaleY );
-  return gdk_string_width( font, "H" );
+  return long(gdk_string_width( font, "H" ) / m_scaleX);
 }
 
 long wxPaintDC::GetCharHeight(void)
@@ -583,7 +581,7 @@ long wxPaintDC::GetCharHeight(void)
   if (!Ok()) return 0;
   
   GdkFont *font = m_font.GetInternalFont( m_scaleY );
-  return font->ascent + font->descent;
+  return long((font->ascent + font->descent) / m_scaleY);
 }
 
 void wxPaintDC::Clear(void)