View previous topic :: View next topic |
Author |
Message |
michael.hoette
Joined: 15 Oct 2006 Posts: 2
|
Posted: Wed Feb 06, 2008 7:14 pm Post subject: Incorrect state off modified flag in OnChange event |
|
|
Hello Michael,
on first call off smUpperCase or smLowerCase command in an unmodified text, the OnChange event don't reflect the right modified state (Modified is false).
The reason for this is, that modified true state is set with AddUndo(toInsert, RepStr, S, Pos); in TCustomSyntaxMemo.ReplaceText and this routine is called after OnChange call.
Modify state will be determine with
function TSyntMemoStrings.GetModified: Boolean;
begin
Result := FModified or (UndoList.Count - RedoCount <> FUndoCountAfterSave);
end;
and UndoList.Count is even zero when OnChange is called. |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Thu Feb 07, 2008 4:01 pm Post subject: |
|
|
Hello,
It is correct situation. OnChange event is called immediatly after text was changed. Undo record is saved after OnChange event was triggered.
To resolve this problem I've added new event OnModifiedChaged. This event is triggered only when value of Modified properrty is changed.
This event is more better, because it also triggered when clearing Undo or Remo chains and it is not triggered when Modified property is not changed.
P.S. If you need current version with this change request it by e-mail.
Michael. |
|
Back to top |
|
|
|