Page 1 of 1

Question about 2 or more controls linked to one control.

PostPosted: November 16th, 2007, 11:49 pm
by Stewart81
Ok this may be somewhere online but I haven't found it my guess is it is and I'm just not sure how to phrase it. Basically I am messing around with the DelphiSCI component. The problem I have with it is in and MDI format it's a very poor setup. It's great for SDI but bad for MDI. What I did was create a
new control which loads the highlighters into it. Then the plan was to have it call an event whenever a modification was made to a highlighter. Instead of having it linked to the scintilla control as the default setup is I made it so the scintilla control links to this control.

Basicly what I want to know. I tried having Style Control call an event when it updated itself. How can I detect that event occurring in each scintilla control to update themselves. I figure there must be a way.

I tried this:

Code: Select all
procedure TScintillaMemo.SetPropFile(const Value: TSciPropFile);
begin
  FPropFile := (Value);
  SetStyles;
  FPropFile.OnUpdateStyles := UpdateStyles;
end;

procedure TScintillaMemo.UpdateStyles(Sender: TObject);
begin
  if FPropFile <> nil then begin
    SetStyles;
  end;
end;


This works for the last scintilla control created but none of the others. Thanks for any help you can provide.

PostPosted: November 17th, 2007, 11:55 am
by Kambiz
Your comments don't describe the problem. Anyway, your code doesn't look correct.

My question is, what are you going to do?