Memo editor fix: Changing the scrollbars invoke the OnChange event. Avoid thinking the text was really modified in that case.

This commit is contained in:
Ansgar Becker
2008-08-27 14:20:58 +00:00
parent 06a7242891
commit 369450d14f

View File

@ -82,13 +82,18 @@ begin
end; end;
procedure TfrmMemoEditor.btnWrapClick(Sender: TObject); procedure TfrmMemoEditor.btnWrapClick(Sender: TObject);
var
WasModified: Boolean;
begin begin
Screen.Cursor := crHourglass; Screen.Cursor := crHourglass;
// Changing the scrollbars invoke the OnChange event. We avoid thinking the text was really modified.
WasModified := FModified;
if memoText.ScrollBars = ssBoth then if memoText.ScrollBars = ssBoth then
memoText.ScrollBars := ssVertical memoText.ScrollBars := ssVertical
else else
memoText.ScrollBars := ssBoth; memoText.ScrollBars := ssBoth;
TToolbutton(Sender).Down := memoText.ScrollBars = ssVertical; TToolbutton(Sender).Down := memoText.ScrollBars = ssVertical;
FModified := WasModified;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;