How can I get a derived instance of GoOverview to automatically rescale to fit as the underlying document changes? It seems strange to me that an overview window does not do this by default? An overview window is not really much benefit to the user if it has to be scrolled around in the same manner as a larger view…?
I haven’t tried this, but I would think you can just define a GoDocument.Changed event handler that detects the GoDocument.ChangedSize hint (and maybe the GoDocument.ChangedTopLeft hint) and calls RescaleToFit on the overview.
You say you already have a subclass of GoOverview? Then you can just override OnDocumentChanged to do this, instead of adding a delegate to the overview’s document’s Changed event.
Here’s all the events I’m handling, NONE of which seem to pick up any doc size changed event. This is incredibly frustrating, what am i doing wrong?
o.Observed.ObjectResized+=new Northwoods.Go.GoSelectionEventHandler(Observed_ObjectResized );
Thanks for the info Walter, I implemented this but I am still having an
issue with the overview. The user can still resize it by clicking
on it, holding Ctrl and turning the mouse wheel. I’ve tried the
goOverview1.AllowResize = false;
goOverview1.Document.AllowResize = false;
goOverview1.Observed.AllowResize = false;
goOverview1.Observed.Document.AllowResize = false;
None seem to work. Any suggestions?
AllowResize controls whether the user can resize any object. It doesn’t have anything to do with scaling/zooming a GoView.
You can disable mouse actions of all kinds by setting goOverview1.AllowMouse = false.
If you just want to disable scroll wheel events, then it’s probably easiest to install as the GoView.DefaultTool an instance of a subclass of GoToolManager that overrides GoTool.DoMouseWheel() to be a no-op.