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:
@@ -460,17 +460,14 @@ void wxComboBox::SetInsertionPoint( long pos )
|
|||||||
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
int tmp = (int) pos;
|
gtk_entry_set_position( GTK_ENTRY(entry), (int)tmp );
|
||||||
gtk_entry_set_position( GTK_ENTRY(entry), tmp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboBox::SetInsertionPointEnd()
|
void wxComboBox::SetInsertionPointEnd()
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
SetInsertionPoint( -1 );
|
||||||
int pos = GTK_ENTRY(entry)->text_length;
|
|
||||||
SetInsertionPoint( pos-1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxComboBox::GetInsertionPoint() const
|
long wxComboBox::GetInsertionPoint() const
|
||||||
|
@@ -518,13 +518,7 @@ void wxTextCtrl::SetInsertionPointEnd()
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
|
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
|
||||||
|
|
||||||
int pos = 0;
|
SetInsertionPoint(-1);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::SetEditable( bool editable )
|
void wxTextCtrl::SetEditable( bool editable )
|
||||||
|
@@ -460,17 +460,14 @@ void wxComboBox::SetInsertionPoint( long pos )
|
|||||||
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
int tmp = (int) pos;
|
gtk_entry_set_position( GTK_ENTRY(entry), (int)tmp );
|
||||||
gtk_entry_set_position( GTK_ENTRY(entry), tmp );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboBox::SetInsertionPointEnd()
|
void wxComboBox::SetInsertionPointEnd()
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
SetInsertionPoint( -1 );
|
||||||
int pos = GTK_ENTRY(entry)->text_length;
|
|
||||||
SetInsertionPoint( pos-1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long wxComboBox::GetInsertionPoint() const
|
long wxComboBox::GetInsertionPoint() const
|
||||||
|
@@ -518,13 +518,7 @@ void wxTextCtrl::SetInsertionPointEnd()
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
|
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
|
||||||
|
|
||||||
int pos = 0;
|
SetInsertionPoint(-1);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::SetEditable( bool editable )
|
void wxTextCtrl::SetEditable( bool editable )
|
||||||
|
Reference in New Issue
Block a user