compilation fixes for wxGTK1 after wxTextEntry changes (unit test still fails, Replace() generates 2 events instead of 1...)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-26 12:18:00 +00:00
parent 5abbb704ba
commit c282ec4402
2 changed files with 15 additions and 3 deletions

View File

@@ -94,6 +94,7 @@ public:
wxString GetValue() const; wxString GetValue() const;
void SetValue(const wxString& value); void SetValue(const wxString& value);
void WriteText(const wxString& value);
void Copy(); void Copy();
void Cut(); void Cut();

View File

@@ -618,13 +618,24 @@ void wxComboBox::SetValue( const wxString& value )
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
wxString tmp; gtk_entry_set_text( GTK_ENTRY(entry), wxGTK_CONV( value ) );
if (!value.IsNull()) tmp = value;
gtk_entry_set_text( GTK_ENTRY(entry), wxGTK_CONV( tmp ) );
InvalidateBestSize(); InvalidateBestSize();
} }
void wxComboBox::WriteText(const wxString& value)
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
GtkEditable * const edit = GTK_EDITABLE(entry);
gtk_editable_delete_selection(edit);
gint len = gtk_editable_get_position(edit);
gtk_editable_insert_text(edit, wxGTK_CONV(value), -1, &len);
gtk_editable_set_position(edit, len);
}
void wxComboBox::Copy() void wxComboBox::Copy()
{ {
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );