[Pas2js] Event onFormChange

warleyalex warleyalex at yahoo.com.br
Mon Aug 13 16:45:07 CEST 2018


Almost there.

You get notified when a designer form is modified with this piece of code,
but there is an issue here.
e.g. When we use the Object Inspector, and resize the panel, for instance,
the designer is notified, but
Important note:
when you resize a component at design-time, you resize with the mouse,
dragging the component, the designer is not notified!

Any idea?

---// BEGIN CODE //------------
procedure TAddOn.OnDesignerModified(Sender: TObject);
var
  aDesigner: TIDesigner;
  cmd: TIDECommand;
begin
  cmd := IDECommandList.FindCommandByName('LFMTOPAS');
  aDesigner:=FormEditingHook.GetCurrentDesigner;
  if ADesigner is TComponentEditorDesigner then begin
    if Assigned(cmd) then
    begin
      ExecuteIDECommand(Sender, cmd.Command);
    end;
  end;

  if aDesigner=nil then
  begin
    IDEMessageDialog('Missing Designer','Copy form as Pascal needs a
designer form.',
      mtError,[mbOK]);
  end;
end; 
---// END CODE //------------



--
Sent from: http://pas2js.38893.n8.nabble.com/


More information about the Pas2js mailing list