Is ButtonDocument class allready fully implemented?


I cannot use button documents because of the crash which happens after
the following user input:

  • Create a new button document (menu: file / new button)
  • switch e.g. to the tab on the right hand side called “normal”
  • right click in the graphic plane and choose e.g. “New Rectangle”

Then the application crashes while calling:

const Rectangle PaintElement::getCurrentBounds (const Rectangle& parentArea) const
return position.getRectangle (parentArea, *getDocument()->getComponentLayout());

because the ButtonDocument::getComponentLayout() returns zero!

thanx for any answer

Yeah, sorry - I’ve got a fix for that, which will be in the next release… Hopefully out very soon!

I was able to fix it with a frightening hack :slight_smile: in

[code]void RelativePositionedRectangle::getRelativeTargetBounds (const Rectangle& parentArea,
const ComponentLayout& layout,
int& x, int& xw, int& y, int& yh,
int& w, int& h) const
// New code inserted:
if (&layout == 0) // HACK, UNSURE CODE !!!
x = parentArea.getX();
y = parentArea.getY();
xw = w = parentArea.getWidth();
yh = h = parentArea.getHeight();

    // Original Body remains the same...[/code]

yeesh! Well if it gets it working until the next release, that’s great!