I’m wanting to redefine some of the behaviour of GoOverview when the observed GoView’s DocScale and DocPosition are changed.Basically, when the observed GoView's DocScale and DocPosition are changed, the GoOverview's DocScale and DocPosition should not change. But the user can change the GoOverview's DocScale and DocPosition using Ctrl+Mouse operation, and even right mouse buttong drag. Because GoOverview's ViewChanged method is not virtual, how can I disable its default behaviour?
If I understand it correctly, when the observed view’s DocScale or DocPosition property changes, the GoOverview.DocScale does not change. Only the GoOverview.DocPosition may change, due to trying to keep the GoOverviewRectangle scrolled so that it is visible.
Many thanks. I’m sorry I did not explain my problem clearly.
After playing around with GoOverview for a while, I know what I exactly want.
By default, the OverviewRect always contains exaclty the same area shown in the observed GoView. Because I redesigned GoView and GoDocument, this default behaviour is not I want.
In my program, the OverviewRect will not always contain the same area shown in the observed GoView; some time it will, but not always. In my GoView, there is a page layout with gray margins which are included in GoDocument. I want the OverviewRect only contains the area in the page what is shown in the observed GoView, excluding the margins (even though the are also shown in the observed GoView).
This may seem strange since sometimes, GoOverview’s OverviewRect does not contain the same area shown in the observed GoView, but I do need this.
Bascially, I want to define my own OverviewRect when the DocScale and DocPosition of the observed view is changed. It will only contains the same area inside the page which is shown in the observed GoView.
But the OverviewRect property is readonly and not virtual, the problem becomes how I can override the default calculation of OverviewRect of GoOverview?
It sounds to me like you would really prefer being able to override the GoOverviewRectangle.UpdateRectFromView method, since that is what actually sets the Bounds of the rectangle.
I subclassed GoOverviewRectangle and overrided OnBoundsChanged method to ajust its Bounds according to the ObservedView. It all works as we expect now.