I cant do activity node be resizable.
I set the resizable property true in activitynode, goview, goview.document.
How can I do this?
Thanks in advance,
Pablo Becker.
Jake
April 17, 2008, 11:56am
2
It’s the icon that needs to be resizable.
protected override GoObject CreateIcon(System.Resources.ResourceManager res, string iconname) { GoObject obj = base.CreateIcon (res, iconname); obj.Resizable = true; return obj; }
Note, however, that you're probably not going to be happy with the result, as the LayoutChildren doesn't do anything for positioning ports on a resized ActivityNode.
(ActivityNode is defined by the Processor sample)
Great! its work!
Im gonna try to move the ports on ObjectResized.
How can I add nodes to resize only the height or the width?
Thanks in advance,
Pablo Becker.
walter
April 17, 2008, 5:04pm
4
By the way, you don’t need to override that CreateIcon method just to set a property on it. Adding the following line in the constructor should be sufficient:
this.Icon.Resizable = true;
However, the additional work in LayoutChildren to reposition the ports is still needed.
Thank you!
How can I add nodes to resize only the height and the width because now I can resize from the corners.
Thanks in advance,
Pablo.
Jake
April 18, 2008, 2:50pm
6
I think this will do what you want.
[code]
public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj) { RemoveSelectionHandles(sel); if (!CanResize()) { sel.CreateBoundingHandle(this, selectedObj); } else { RectangleF rect = this.Bounds; float x1 = rect.X; float x2 = rect.X + (rect.Width/2); float x3 = rect.X + rect.Width;
float y1 = rect.Y; float y2 = rect.Y + (rect.Height/2); float y3 = rect.Y + rect.Height;
sel.CreateResizeHandle(this, selectedObj, new PointF(x2, y1), MiddleTop, true); sel.CreateResizeHandle(this, selectedObj, new PointF(x3, y2), MiddleRight, true); sel.CreateResizeHandle(this, selectedObj, new PointF(x2, y3), MiddleBottom, true); sel.CreateResizeHandle(this, selectedObj, new PointF(x1, y2), MiddleLeft, true); } }
[/code]