X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e894be201b9866e2f5dbf29050bd1aaa58d95cc4..402dfce7b324c977a5b396b07cd36835d5514e52:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 5e852cc3a6..112af870c3 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: textctrl.cpp +// Name: src/gtk/textctrl.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -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()) @@ -941,7 +954,7 @@ int wxTextCtrl::GetLineLength(long lineNo) const else { wxString str = GetLineText (lineNo); - return (int) str.Length(); + return (int) str.length(); } } @@ -962,7 +975,7 @@ int wxTextCtrl::GetNumberOfLines() const // If the last character in the text buffer is a newline, // gtk_text_view_forward_display_line() will return false without that // line being counted. Must add one manually in that case. - GtkTextIter lastCharIter; + GtkTextIter lastCharIter; gtk_text_buffer_get_iter_at_offset ( m_buffer, @@ -1139,7 +1152,7 @@ void wxTextCtrl::SetSelection( long from, long to ) if (from == -1 && to == -1) { from = 0; - to = GetValue().Length(); + to = GetValue().length(); } if (m_windowStyle & wxTE_MULTILINE) @@ -1399,7 +1412,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) { wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") ); - if ((key_event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) + if ((key_event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxTE_PROCESS_ENTER)) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject(this);