Is ButtonDocument class allready fully implemented?


#1

Hi,

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
jan


#2

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


#3

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

[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();
return;
}

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

#4

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


#5