EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Incorrect state off modified flag in OnChange event

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
michael.hoette



Joined: 15 Oct 2006
Posts: 2

PostPosted: Wed Feb 06, 2008 7:14 pm    Post subject: Incorrect state off modified flag in OnChange event Reply with quote

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
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Thu Feb 07, 2008 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group