projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sometimes unused parameter warnings are really worth paying attention to
[wxWidgets.git]
/
src
/
univ
/
textctrl.cpp
diff --git
a/src/univ/textctrl.cpp
b/src/univ/textctrl.cpp
index d8816f8974c3566a829f92a84aed9a5e5f857336..ee60b694c5edb7be872c94aba50f054df3a23808 100644
(file)
--- a/
src/univ/textctrl.cpp
+++ b/
src/univ/textctrl.cpp
@@
-790,21
+790,23
@@
wxTextCtrl::~wxTextCtrl()
void wxTextCtrl::DoSetValue(const wxString& value, int flags)
{
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);
+
Replace(0, GetLastPosition(), value);
- if ( IsSingleLine() )
+ if ( IsSingleLine() )
+ {
+ SetInsertionPoint(0);
+ }
+ }
+ 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
}
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();
// now call it to do the rest (not related to refreshing)
ClearSelection();
+
+ if ( EventsAllowed() )
+ SendTextUpdatedEvent();
}
void wxTextCtrl::Remove(wxTextPos from, wxTextPos to)
}
void wxTextCtrl::Remove(wxTextPos from, wxTextPos to)
@@
-3615,8
+3620,12
@@
void wxTextCtrl::UpdateScrollbars()
if ( scrollRangeXOld )
{
if ( scrollRangeXOld )
{
- x *= scrollRangeX - m_rectText.width / charWidth;
- x /= scrollRangeXOld - m_rectText.width / charWidth;
+ const int w = m_rectText.width / charWidth;
+ if ( w != scrollRangeXOld )
+ {
+ x *= scrollRangeX - w;
+ x /= scrollRangeXOld - w;
+ }
Scroll(x, y);
}
Scroll(x, y);
}