Forum > Designer
How to reference Designer unit?
(1/1)
Alex.Machado:
I'm creating a new Lazarus package (design & runtime) and I need to reference the TDesigner class (in unit Designer.pas).
However, adding Designer to the uses clause doesn't seem to be enough because I get a compilation error
"Cannot find Designer used by ..."
What I'm missing?
This is a fresh install of Lazarus 3.4 + FPC 3.2.2 using FpcDeluxe
Thanks in advance
wp:
You should not "use" the internal Lazarus units. There is a package IDEIntf which contains property and component editors and other interfacing units which give you access to the designer and IDE internals.
What do you want to achieve?
Alex.Machado:
Hi wp, thanks for your response.
My specific issue is that I have created a TDesignMediator which takes care of drawing the controls and components owned by my "form" (not exactly a TForm descendant, though).
All controls are painted correcly by my own code. However I'd like it to paint the other components (e.g. a TDataSource) exactly as TDesigner does. TDesigner contains a method to draw non visible components, but I can't call it directly.
Unfortunately the TDesignMediator doesn't seem to have means to let the designer know that it should paint the component as usual, or I missed something?
Alex.Machado:
Never mind... I think I found the problem with my original code.
Overriden method ParentAcceptsChildComponent() (in my TDesignMediator descendant) was returning False for TComponent classes which was causing the designer to fail to paint them (although they were being created by the designer, which is somehow unexpected).
Anyway, this solves my need to call TDesigner methods directly.
Thanks for the info.
Cheers!
Navigation
[0] Message Index