SetInsertionPointEnd() bug corrected (was off by 1)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-01-26 12:56:58 +00:00
parent 1eddcfafba
commit 805dd538bb
4 changed files with 258 additions and 276 deletions

View File

@@ -460,17 +460,14 @@ void wxComboBox::SetInsertionPoint( long pos )
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int tmp = (int) pos;
gtk_entry_set_position( GTK_ENTRY(entry), tmp );
gtk_entry_set_position( GTK_ENTRY(entry), (int)tmp );
}
void wxComboBox::SetInsertionPointEnd()
{
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int pos = GTK_ENTRY(entry)->text_length;
SetInsertionPoint( pos-1 );
SetInsertionPoint( -1 );
}
long wxComboBox::GetInsertionPoint() const

View File

@@ -518,13 +518,7 @@ void wxTextCtrl::SetInsertionPointEnd()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
int pos = 0;
if (m_windowStyle & wxTE_MULTILINE)
pos = gtk_text_get_length( GTK_TEXT(m_text) );
else
pos = GTK_ENTRY(m_text)->text_length;
SetInsertionPoint((pos-1)>0 ? (pos-1):0);
SetInsertionPoint(-1);
}
void wxTextCtrl::SetEditable( bool editable )

View File

@@ -460,17 +460,14 @@ void wxComboBox::SetInsertionPoint( long pos )
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int tmp = (int) pos;
gtk_entry_set_position( GTK_ENTRY(entry), tmp );
gtk_entry_set_position( GTK_ENTRY(entry), (int)tmp );
}
void wxComboBox::SetInsertionPointEnd()
{
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
int pos = GTK_ENTRY(entry)->text_length;
SetInsertionPoint( pos-1 );
SetInsertionPoint( -1 );
}
long wxComboBox::GetInsertionPoint() const

View File

@@ -518,13 +518,7 @@ void wxTextCtrl::SetInsertionPointEnd()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
int pos = 0;
if (m_windowStyle & wxTE_MULTILINE)
pos = gtk_text_get_length( GTK_TEXT(m_text) );
else
pos = GTK_ENTRY(m_text)->text_length;
SetInsertionPoint((pos-1)>0 ? (pos-1):0);
SetInsertionPoint(-1);
}
void wxTextCtrl::SetEditable( bool editable )