]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
Karsten's correction undone - this code is (was) correct!
[wxWidgets.git] / src / gtk / window.cpp
index 12a31edeaa2ba3034d377f8ccbfbd27e123200b2..81628667f9ec0fe5ce41aa9fdd112b482247d0a8 100644 (file)
@@ -1393,6 +1393,31 @@ void wxWindow::Enable( bool enable )
   if (m_wxwindow) gtk_widget_set_sensitive( m_wxwindow, enable );
 }
 
+int wxWindow::GetCharHeight(void) const
+{
+  GdkFont *font = m_font.GetInternalFont( 1.0 );
+  return font->ascent + font->descent;
+}
+
+int wxWindow::GetCharWidth(void) const
+{
+  GdkFont *font = m_font.GetInternalFont( 1.0 );
+  return gdk_string_width( font, "H" );
+}
+
+void wxWindow::GetTextExtent( const wxString& string, int *x, int *y,
+  int *descent, int *externalLeading, const wxFont *theFont, bool WXUNUSED(use16) ) const
+{
+  wxFont fontToUse = m_font;
+  if (theFont) fontToUse = *theFont;
+  
+  GdkFont *font = fontToUse.GetInternalFont( 1.0 );
+  if (x) (*y) = gdk_string_width( font, string );
+  if (y) (*y) = font->ascent + font->descent;
+  if (descent) (*descent) = font->descent;
+  if (externalLeading) (*externalLeading) = 0;  // ??
+}
+
 void wxWindow::MakeModal( bool modal )
 {
   return;
@@ -1516,11 +1541,6 @@ int wxWindow::GetReturnCode(void)
   return m_retCode;
 }
 
-wxWindow *wxWindow::GetParent(void)
-{
-  return m_parent;
-}
-
 void wxWindow::Raise(void)
 {
   if (m_widget) gdk_window_raise( m_widget->window );