X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/903f689bf7c3c379cba45881373aa9bdd15d6e70..12e7bc479e855bb0336a8943ab18c0de47f4b39d:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 12a31edeaa..81628667f9 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -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 );