From 186344760df70193277af236c5faaba33c79d9f9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Mar 2006 14:14:59 +0000 Subject: [PATCH] support underlined fonts (patch 1448089) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/gtk/textctrl.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index d071bab7c1..a89fa51c00 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -157,6 +157,7 @@ wxGTK: - Polygon and line drawing speeded up if there is no scaling. - Fixed problems with CJK input method. - Implemented ScrollLines/Pages() for all windows (Paul Cornett) +- Support underlined fonts in wxTextCtrl wxMac: diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 5e852cc3a6..373b2536b7 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -85,6 +85,19 @@ static void wxGtkTextApplyTagsFromAttr(GtkTextBuffer *text_buffer, NULL ); gtk_text_buffer_apply_tag (text_buffer, tag, start, end); g_free (font_string); + + if (attr.GetFont().GetUnderlined()) + { + g_snprintf(buf, sizeof(buf), "WXFONTUNDERLINE"); + tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table( text_buffer ), + buf ); + if (!tag) + tag = gtk_text_buffer_create_tag( text_buffer, buf, + "underline-set", TRUE, + "underline", PANGO_UNDERLINE_SINGLE, + NULL ); + gtk_text_buffer_apply_tag (text_buffer, tag, start, end); + } } if (attr.HasTextColour())