From 60d85ccb3d3ebda7af4dcc9833867d18a5652418 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 5 Jan 2003 22:57:45 +0000 Subject: [PATCH] Removed usage of GetInternalFont. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/choice.cpp | 7 ++----- src/gtk/combobox.cpp | 8 +++----- src/gtk1/choice.cpp | 7 ++----- src/gtk1/combobox.cpp | 8 +++----- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index c9e3cceac2..485f3fbdfb 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -448,14 +448,11 @@ wxSize wxChoice::DoGetBestSize() const ret.x = 0; if ( m_widget ) { - GdkFont *font = m_font.GetInternalFont(); - - wxCoord width; + int width; size_t count = GetCount(); for ( size_t n = 0; n < count; n++ ) { - // FIXME GTK 2.0 - width = (wxCoord)gdk_string_width(font, wxGTK_CONV( GetString(n) ) ); + GetTextExtent( GetString(n), &width, NULL, NULL, NULL, &m_font ); if ( width > ret.x ) ret.x = width; } diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index ee0cc2e8d5..8ed30aed10 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -750,13 +750,11 @@ wxSize wxComboBox::DoGetBestSize() const ret.x = 0; if ( m_widget ) { - GdkFont *font = m_font.GetInternalFont(); - - wxCoord width; - size_t count = Number(); + int width; + size_t count = GetCount(); for ( size_t n = 0; n < count; n++ ) { - width = (wxCoord)gdk_string_width(font, wxGTK_CONV( GetString(n) ) ); + GetTextExtent( GetString(n), &width, NULL, NULL, NULL, &m_font ); if ( width > ret.x ) ret.x = width; } diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index c9e3cceac2..485f3fbdfb 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -448,14 +448,11 @@ wxSize wxChoice::DoGetBestSize() const ret.x = 0; if ( m_widget ) { - GdkFont *font = m_font.GetInternalFont(); - - wxCoord width; + int width; size_t count = GetCount(); for ( size_t n = 0; n < count; n++ ) { - // FIXME GTK 2.0 - width = (wxCoord)gdk_string_width(font, wxGTK_CONV( GetString(n) ) ); + GetTextExtent( GetString(n), &width, NULL, NULL, NULL, &m_font ); if ( width > ret.x ) ret.x = width; } diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index ee0cc2e8d5..8ed30aed10 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -750,13 +750,11 @@ wxSize wxComboBox::DoGetBestSize() const ret.x = 0; if ( m_widget ) { - GdkFont *font = m_font.GetInternalFont(); - - wxCoord width; - size_t count = Number(); + int width; + size_t count = GetCount(); for ( size_t n = 0; n < count; n++ ) { - width = (wxCoord)gdk_string_width(font, wxGTK_CONV( GetString(n) ) ); + GetTextExtent( GetString(n), &width, NULL, NULL, NULL, &m_font ); if ( width > ret.x ) ret.x = width; } -- 2.45.2