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 

SyntaxMemo updating on ChildForm

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



Joined: 06 May 2007
Posts: 13

PostPosted: Tue May 22, 2007 4:50 pm    Post subject: SyntaxMemo updating on ChildForm Reply with quote

Hi.
I have a form, which load a plugin dll as child form. This plugin form is created like this
Code:

procedure TfmMain.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.Style := (WS_CHILD or WS_MAXIMIZE) and not WS_CAPTION and not WS_BORDER;
  Params.WindowClass.cbWndExtra := SizeOf(Pointer); //4 bytes for address of form
end;

When i place SyntaxMemo on this child form, it works ok, but no refresh of CodeFolding and SyntaxTree. To make some refresh i have to call SyntaxAnalizer.CustomizeLexer and press "Cancel" each time. What i need to do, to make SyntaxMemo fully working on ChildForm?
PS There no sources of main form. I need to write plugin, and i can hook WinProc of main window. May be there is some message which main form doesn't pass to child form?
I can send you simple test project in D7 to test this.
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Tue May 22, 2007 5:29 pm    Post subject: Reply with quote

Yes, please send test project.

Michael.
Back to top
View user's profile Send private message Send e-mail
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Tue May 22, 2007 8:56 pm    Post subject: Reply with quote

Solution:

If Syntax Memo or Syntax Analyser are used in DLL you need periodically call CheckSynchronize method from Classes.pas to enable threads synchronization.

For example, drop on the form timer and in OnTimer call CheckSynchronize.

Code:
procedure TfmMain.Timer1Timer(Sender: TObject); begin
  CheckSynchronize;
end;


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