Applied patch [ 735588 ] Gtk2 textctrl selection fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1187,7 +1187,9 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
|||||||
|
|
||||||
gint from, to;
|
gint from, to;
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
if ( !gtk_editable_get_selection_bounds(GTK_EDITABLE(m_text), &from, &to) )
|
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (m_text));
|
||||||
|
GtkTextIter ifrom, ito;
|
||||||
|
if (!gtk_text_buffer_get_selection_bounds(buffer, &ifrom, &ito))
|
||||||
#else
|
#else
|
||||||
if ( !(GTK_EDITABLE(m_text)->has_selection) )
|
if ( !(GTK_EDITABLE(m_text)->has_selection) )
|
||||||
#endif
|
#endif
|
||||||
@@ -1197,7 +1199,10 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
|||||||
}
|
}
|
||||||
else // got selection
|
else // got selection
|
||||||
{
|
{
|
||||||
#ifndef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
from = gtk_text_iter_get_offset(&ifrom);
|
||||||
|
to = gtk_text_iter_get_offset(&ito);
|
||||||
|
#else
|
||||||
from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
|
from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
|
||||||
to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
|
to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1187,7 +1187,9 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
|||||||
|
|
||||||
gint from, to;
|
gint from, to;
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
if ( !gtk_editable_get_selection_bounds(GTK_EDITABLE(m_text), &from, &to) )
|
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (m_text));
|
||||||
|
GtkTextIter ifrom, ito;
|
||||||
|
if (!gtk_text_buffer_get_selection_bounds(buffer, &ifrom, &ito))
|
||||||
#else
|
#else
|
||||||
if ( !(GTK_EDITABLE(m_text)->has_selection) )
|
if ( !(GTK_EDITABLE(m_text)->has_selection) )
|
||||||
#endif
|
#endif
|
||||||
@@ -1197,7 +1199,10 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
|||||||
}
|
}
|
||||||
else // got selection
|
else // got selection
|
||||||
{
|
{
|
||||||
#ifndef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
from = gtk_text_iter_get_offset(&ifrom);
|
||||||
|
to = gtk_text_iter_get_offset(&ito);
|
||||||
|
#else
|
||||||
from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
|
from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
|
||||||
to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
|
to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user