ViewportNavigator class


It’s basically a special component that monitors a Viewport and let you have a thumbnail of the whole contained area, adding the ability to navigate in the whole Viewport area by using the mouse.

I post this here so it can be searched as a useful component:

an useful addition would be to move the paint inside the look and feel so one can choose the overall styles of the viewports.


i’ve updated a bit the class, fixing a couple of annoyances and bugs here and there. i also improved the overall speed of the class by updating everything in a timer instead of doing it directly. this way more updates and changes in size are stabilized after half a second.

i’ve added a notifyComponentChanged to the Viewport in order to update the navigator component from any inner component of the Viewport by using findParentComponentOfClass !

next step is to add some virtual functions to let the user subclass the way the image of the component is generated (is you want to draw filled rectangles instead of the image of the components), add the color for the indicator overlay rectangle and maybe move its draw function inside the look and feel.

cheers !


Many thanks for this component.

However, it seems to have a “legal” error in it.

In the “jucetice_ViewportNavigator.h” file, one can read :

JUCE and JUCETICE can be redistributed and/or modified under the terms of
the GNU Lesser General Public License…[/quote]

AFAIK Juce is not covered by LGPL, but GPL or commercial licence.


ops sure. i’ll modify it as soon as i get the chance… i just discovered i have a couple of files in my trunk that have this error. Probably i copied and pasted the wrong header… cheers !