This commit was manufactured by cvs2svn to create tag 'wxPy_2_3_3_1'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/wxPy_2_3_3_1@17271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2002-09-19 06:10:53 +00:00
parent bf4a027ddb
commit fe0c95d0ba
103 changed files with 6418 additions and 11559 deletions

View File

@@ -552,6 +552,7 @@ void wxTextCtrl::WriteText( const wxString &text )
wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
#endif
GtkTextBuffer *text_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_text) );
// TODO: call wahtever is needed to delete the selection
gtk_text_buffer_insert_at_cursor( text_buffer, buffer, strlen(buffer) );
#else // GTK 1.x
@@ -561,6 +562,7 @@ void wxTextCtrl::WriteText( const wxString &text )
// always use m_defaultStyle, even if it is empty as otherwise
// resetting the style and appending some more text wouldn't work: if
// we don't specify the style explicitly, the old style would be used
gtk_editable_delete_selection( GTK_EDITABLE(m_text) );
wxGtkTextInsert(m_text, m_defaultStyle, text.c_str(), text.Len());
// Bring editable's cursor back uptodate.
@@ -569,6 +571,9 @@ void wxTextCtrl::WriteText( const wxString &text )
}
else // single line
{
// First remove the selection if there is one
gtk_editable_delete_selection( GTK_EDITABLE(m_text) );
// This moves the cursor pos to behind the inserted text.
gint len = GET_EDITABLE_POS(m_text);
@@ -585,9 +590,6 @@ void wxTextCtrl::WriteText( const wxString &text )
gtk_editable_insert_text( GTK_EDITABLE(m_text), text.c_str(), text.Len(), &len );
#endif
// Bring editable's cursor uptodate.
len += text.Len();
// Bring entry's cursor uptodate.
gtk_entry_set_position( GTK_ENTRY(m_text), len );
}
@@ -928,6 +930,12 @@ void wxTextCtrl::SetSelection( long from, long to )
{
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
if (from == -1 && to == -1)
{
from = 0;
to = GetValue().Length();
}
#ifndef __WXGTK20__
if ( (m_windowStyle & wxTE_MULTILINE) &&
!GTK_TEXT(m_text)->line_start_cache )