added wxTextEntry common base class for both wxTextCtrl and wxComboBox; refactor wxGTK code to put common parts of these classes in the base class; fixed some inconsistencies in the text control behaviour between platforms

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-26 00:30:22 +00:00
parent c0d9b217a7
commit 0ec1179b86
33 changed files with 1224 additions and 862 deletions

View File

@@ -790,21 +790,23 @@ wxTextCtrl::~wxTextCtrl()
void wxTextCtrl::DoSetValue(const wxString& value, int flags)
{
if ( IsSingleLine() && (value == GetValue()) )
if ( value != GetValue() )
{
// nothing changed
return;
EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent));
Replace(0, GetLastPosition(), value);
if ( IsSingleLine() )
{
SetInsertionPoint(0);
}
}
Replace(0, GetLastPosition(), value);
if ( IsSingleLine() )
else // nothing changed
{
SetInsertionPoint(0);
// still send event for consistency
if ( flags & SetValue_SendEvent )
SendTextUpdatedEvent();
}
if ( flags & SetValue_SendEvent )
SendTextUpdatedEvent();
}
const wxArrayString& wxTextCtrl::GetLines() const
@@ -1264,6 +1266,9 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
// now call it to do the rest (not related to refreshing)
ClearSelection();
if ( EventsAllowed() )
SendTextUpdatedEvent();
}
void wxTextCtrl::Remove(wxTextPos from, wxTextPos to)