by design4use on Fri Jul 12, 2002 5:54 pm
I really do think it's a bug.
If I understand you correctly you say that I need to to attach the draw object I draw into to the gadget, not the buffer Draw object. If you look at the full source below, I already do that in the code. The gadget I have is positioned on the form at about 50,50, yet I still see the drawing from the buffer appear at 0,0 on the form. So if I am not mistaken this is a bug in OrbForms drawing code.
// gadget declaration
object myGadget {
// A UIGadget must always be the first member of a gadget
UIGadget gadget;
Draw draw, dBuffer;
// default event handlers
void onopen();
void ondraw();
void testDraw();
};
void myGadget.onopen() {
// todo: provide customized code for initialization
draw.attachGadget(gadget);
dBuffer.copyGadget(gadget);
}
void myGadget.ondraw() {
// todo: provide customized drawing code
testDraw();
}
void myGadget.testDraw() {
int prev;
prev = dBuffer.fg(255);
dBuffer.line(clrFG, 10, 10, 50, 50);
dBuffer.frame(clrFG,1,1,98, 98, 2, 2);
dBuffer.draw(dBuffer, 30, 60);
draw.begin();
draw.draw(dBuffer, 10,10);
draw.end();
dBuffer.release();
}