Hi,
is it possible to enlarge the default area of a group before a node is added? (just to make the area easy reachable when dragging an object inside) … And is it also possible have a background image (fixed in place, not movable) on a group node? The background image can be covered by other elements added in the group, like a background color.
thx in advance
F
Have you tried setting the minSize on the Placeholder?
If you design your Group’s panel(s) appropriately, you can certainly have a Picture or any other objects in the background. That really is quite independent of it being a Group.
minsize on placeholder works perfectly, thx.
My doubt on the background picture is where to put the picture, here’s the group structure:
$gj(go.Group, "Spot",
$gj(go.Panel, "Auto",
$gj(go.Shape, "Rectangle",
$gj(go.Panel, "Vertical", // title above Placeholder
$gj(go.Panel, "Horizontal", // button next to TextBlock
$gj("SubGraphExpanderButton",{ alignment: go.Spot.Right, margin: 5 }),
$gj(go.TextBlock,
), // end Horizontal Panel
$gj(go.Placeholder,
) // end Vertical Panel
), // end of Panel Auto
$gj(go.Panel, "Vertical",
new go.Binding("itemArray", "rightArray"),
{
itemTemplate:
$gj(go.Panel,
$gj(go.Shape, "Rectangle",
$gj(go.TextBlock,
$gj("CheckBox", "checked",
) // end itemTemplate
) // end Vertical Panel
);
I guess that a picture (I did some tries) may make a mess everywhere…
What I just need is to put a ‘+’ image (or ‘x’ or ‘-’) in the top left of the group, just below the placeholder title bar, not above
It would help if the code were indented properly. It also took me a moment to realize that you had just excerpted the starting line from each of the objects in your actual template. That’s a good idea, but that makes indenting correctly even more important.
If I understand what you want correctly, I think you want to replace the Placeholder with a Panel holding that Placeholder plus your Picture, where the Picture has a TopLeft alignment. That new Panel could be a “Table” Panel, or it could be a “Spot” Panel if you also set alignmentFocus on the Picture to go.Spot.TopLeft
.
sorry walter, you’re right, but I didn’t want to put all the code (very large) so I just put only headers.
What I need is this:
I can put all the template but I think it’s unreadable…
That’s what I was guessing what you wanted. Follow my instructions in the second paragraph of my previous reply.
ehm but where can I put that panel? before or after the placeholder? before or after the vertical panel, or horizontal panel? There are too many variables in placing an object… i can make dozen of tries before reaching my goal…
No, I said to replace the placeholder with a panel holding the placeholder.
What was:
Panel, "Vertical"
. . .
Placeholder
would become:
Panel, "Vertical"
. . .
Panel, "Table"
Placeholder
Picture, { alignment: go.Spot.TopLeft }
Hmmm, you might want to specify an alignment like:
{ alignment: new go.Spot(0, 0, 10, 10) }
in order to offset the Picture from the very corner of the panel.
thank you!
Ciao
F