Floating Layers

Hi Guys,
Is it possible to make a layer or at least a GoObject to float (i.e its relative position on screen will be the same no matter what is the document position)?

If not i think its a good candidate for the wish list thread


Would you expect the user to be able to select objects in such layers?

There might be a problem with selection, since the selection handles are separate GoObjects (actually GoHandles) that are added to a different layer in the view. But that layer normally holds selection handles for objects that are in regular layers too. So the selection handles for an object in a layer that is not scaled (zoomed) or translated (scrolled) would actually be scaled and translated, causing the selection handles to be far away from the selected object.

So this might be a reasonable idea for us to implement, but there are problems in designing the feature.

In the meantime, you can just implement a GoView.PropertyChanged event handler that looks for the DocScale and DocPosition property changes, and updates the Position of the desired object(s) appropriately.

Hi Walter,
Recently i saw one of your posts here regarding gantt chart and i wonder how is the time line of this gantt chart remains docked to the top of the view while the user scrolls down? or its not docked at all? in that case its problematic for the user because he wants to see the timeline all the time even when dealing with tasks way down the page - the timeline must be floating or docked to the top. one more thing: users might want to have a floating toolbar with nice functions ready to be used.
I don’t really understand the architecture of the handlers but what about giving a layer some kind of offset in the X and Y axis which will be adjusted according to the scollbars values so the objects in the layer will always look like they’re in the same place but actually its because of the offset that changes? this should not harm the handlers,zooming etc mechanism.

actually this is what im going to do in my “floating” implementation.

Well, you can always use another Control that is positioned next to your GoView. You can do that either directly, where both controls are part of a Form, or you can do that by setting one of the “Bar” properties of GoView. The latter choice causes GoView to automatically size and position that control, just as it does for the horizontal and vertical scroll bars.

You can see the effect in a GoDrawView, which creates two GoRuler controls and assigns them to the GoView.LeftBar and GoView.TopBar properties. (GoDrawView also sets GoView.BackgroundHasSheet and GoView.SheetStyle, and does some other initialization, but that isn’t relevant to this discussion.)

I’m aware of the bars in the GoView but are they printable? in the gantt chart example the time line must be printed with the tasks otherwise its useless.

one more thing - the Graphic capabilities of a GoObject/Layers etc are far more stronger that those of a regular winforms control - shading, transparency, zooming highliting etc if we want all those things we must use the goObjects and not regular controls in the bars.

don’t you agree?

Quite right – one cannot print controls.

But printing is another one of those sticky issues with trying to design a feature such as what you suggest.

Surely you would not want to print the timeline exactly where it seems to appear in a GoView, since if the user has scrolled down some, the timeline object could be overlapping with some of the document objects. Presumably you would want to have the timeline be printed at the top of the page. But it would be hard for GoView to know where, without making some big assumptions.

Which is why, for now, I suggest that before you Print, you reposition the timeline to where you want it to be, and then reposition it back to where it should be so that it appears at the top of your GoView.

Are you basing your timeline implementation on the one in InstrumentDemo?

No Walter,
I’m building one myself and it works perfectly (much better than all the commercials i’ve evaluated so far) i like your object model - it gives me all the flexibility i need and the performance are great for GDI+ (i’m programming alot with direct3d and c++ (google for scenemax ) so i can appreciate good performance with GDI+). i bought go-express so i cant use the go instruments. maybe if my product will be a hit i’ll upgrade myself to the full library and use it. i always tell my wife that i want to be like nwoods - building a very good product and grow with it!