@st wrote:
var mynodeResizeW =
$(go.Adornment, "Spot",
// { locationSpot: go.Spot.Right },
$(go.Placeholder),
$(go.Shape, { alignment: go.Spot.Top, cursor: "n-resize", desiredSize: new go.Size(6, 6), fill:null, stroke: null }),
$(go.Shape, { alignment: go.Spot.Left, cursor: "w-resize", desiredSize: new go.Size(6, 6), fill: "lightblue", stroke: "deepskyblue" }),
$(go.Shape, { alignment: go.Spot.Right, cursor: "e-resize", desiredSize: new go.Size(6, 6), fill: "lightblue", stroke: "deepskyblue" }),
$(go.Shape, { alignment: go.Spot.Bottom, cursor: "s-resize", desiredSize: new go.Size(6, 6), fill:null, stroke: null }),
$(go.TextBlock, // show the width as text
{ alignment: go.Spot.Top, alignmentFocus: new go.Spot(0.5, 1, 0, -2),
stroke: "whitesmoke" },
new go.Binding("text", "adornedObject",
function(shp) { return shp.naturalBounds.width.toFixed(0) + "px";}).ofObject())
);myDiagram.nodeTemplateMap.add("mymeasure",
$(go.Node, "Spot",
{//
selectionAdornmentTemplate:
$(go.Adornment, "Auto",
$(go.Shape, "RoundedRectangle",
{ fill: null }),
$(go.Placeholder)
) // end Adornment
},
{ resizable: true,
resizeObjectName: "SHAPE",
resizeAdornmentTemplate: mynodeResizeW,selectionAdorned: false
},
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify),
$(go.Panel, "Auto",
{ name: "PANEL" },
$(go.Shape, "Capacitor",
{ fill: null, stroke: "pink", strokeWidth: 1}),
$(go.TextBlock,
{ name:"mmmmm",text: "w",font: "bold 13pt Helvetica, Arial, sans-serif", stroke:"whitesmoke", editable: true,alignment: go.Spot.TopCenter},
new go.Binding("text", "Cname").makeTwoWay())
)//end panel "auto"
)// end go.Node, "Spot"
);
Posts: 2
Participants: 2