by
allistar >> Thu, 9 Oct 2003 3:43:20 GMT
That code goes in the create method for the subclass of Picture?
When i go to create the control in the painter it says "Attempted access via null object reference" on "form.addControl(frame);".
How can i fix this?
Actually, the code should be in the "windowCreated" method, not the "crate" method. Sorry about that. You should also wrap you code in a condition so the windowCreated method of the subclassed control looks like this:
if (not isInPainter()) then
createFrame();
endif;
inheritMethod();
In fact, here is the exact code I have for that method:
if (not isInPainter()) then
create myFrame transient;
myFrame.parent := self.parent;
myFrame.left := self.left - FrameGap;
myFrame.top := self.top - FrameGap;
myFrame.width := self.width + (FrameGap * 2);
myFrame.height := self.height + (FrameGap * 2);
myFrame.bevelOuter := myFrame.Bevel_None;
myFrame.bevelOuterWidth := 1;
myFrame.bevelInner := myFrame.Bevel_None;
myFrame.bevelInnerWidth := 0;
myFrame.boundaryWidth := 0;
myFrame.borderStyle := 0;
myFrame.caption := null;
myFrame.transparent := false;
myFrame.visible := true;
self.form.addControl(myFrame);
myFrame.zOrder(0);
endif;
You will also need to put code in: mouseMove and mouseLeave to simulate the frame appearing and disappearing.
Regards,
Allistar.
------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst
allistar@silvermoon.co.nz
Auckland, NEW ZEALAND
Silvermoon Software
Specialising in JADE development and consulting
Visit us at:
http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at:
www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------