Thoughts on some of these features needed

I’m writing these problems caused by the features our software needs which are not straight in GoDiagram, but I think with the powerful and flexible design of GoDiagram, they can all be solved.

  1. Dividing GoView(or GoDocument) into several vertical regions

There should be a horizontal line drawn at the bottom edge of each region. And the region height can be changed by the user by dragging this line.

More importantly, GoObject objects in one region cannot be moved into another region.

So how to add the line : A kind of GoNode? or GoLink? or just draw it in GoView? How to make it draggable vertically? By adding GoHandles on it if it’s a GoObject object?

And how to constrain the objects in its own region: overriding DoInternalDrop? Any better solutions?

  1. Page and template
    Page should follow a template in my software. The template should have margins, and a table at the right bottom corner of the page. GoObject objects cannot be moved to or dropped on margin areas or any other place outside of the page.

The table has a standard layout, such as title, date, etc. The table has no need to be editable, but it should be on the paper when the page is printed.

How to make the table: Drawing it in OnPaint of GoView? Making a GoObject for it?

How to constrain objects: GoSheet may be helpful, but margins of GoSheet belong to the GoDocument
object, which makes it a little difficult to constrain GoObjet
objects. I thinking overriding both DoExternalDrop and DoInternalDrop methods will solve this problem, at the same time overriding some other properties of GoView and GoDocument.

  1. Multiple pages
    Because the page (template) size is fixed, when too many objects in a document (not GoDocument object), multiple pages will be used to display this document.

So how to realise multiple page feature?
Using multiple GoSheet objects in a single GoView object?
I’m not sure it’s possible to use multiple GoSheet objects in a single GoView.

Or using multiple GoDocument objects, with each for one page?

  1. Can a GoObject be dragged out of a region but not into a different one? What happens when the user drags that line up, causing one or more GoObjects in that region to no longer be in that region?
    Overriding GoView.DoInternalDrop is a bit too general, and doesn’t provide feedback to the user during the drag showing how the object can’t move out of the region. Well, the cursor might change, but the object would follow the pointer instead of staying within the region.
    You might find the LimitingSubGraph class in Demo1 instructive. Try the behavior and see if it implements the concept of keeping objects inside in the way you would like. Caution: the LimitedNode that the example holds is limited in motion not only by the LimitingSubGraph container, but also by its own override of ComputeMove.
    You probably don’t need to use LimitingSubGraphMarkers. I don’t know if you want users to be able to resize horizontally.
    If you don’t want it to inherit from GoSubGraph, it’s a trivial change to inherit from GoGroup, for example, just by changing the inheritance class and deleting any references to GoSubGraph properties. Or if you only don’t want a GoSubGraph.Handle, you can override CreateHandle to return null.
    You could override AddSelectionHandles to add a single wide handle that shows an up-arrow-and-down-arrow cursor. Override DoResize to implement that resizing behavior.

  2. I suggest you define a class from GoSheet, and replace the standard GoView.Sheet, either by overriding GoView.CreateSheet or by just setting GoView.Sheet when you initialize the view. You can implement IGoDragSnapper just like LimitingSubGraph does. That will keep objects between the margins.
    You can create a GoGroup containing some GoTexts and GoRectangles as your table. Perhaps you’ll want to use GoListGroup to automatically keep things organized vertically or horizontally. Just add the table to your document, perhaps in its own read-only layer.