How to manage multiple windows with a single Scrollbar?

Here's the problem I think I have:

I want to display a graph with X- and Y-axis captions, and allow zooming to show a sub-rectangle of the graph. Right now I have the graph canvas and the captions as separate windows managed by a FlexGridSizer, all within a ScrolledWindow. What I'd like is to have the ScrolledWindow's horizontal ScrollBar affect the graph canvas and X-legends and the vertical ScrollBar affect the graph canvas and Y-legends.

Is there a recipe for this? Either handing the appropriate events around, or setting up methods in each object to keep everything in sync?

  Mel.

It sounds like you are wanting to do something similar to how wx.grid.Grid works. It is derived from wx.ScrolledWindow but what you see are actually several child windows, one for the grid area, one each for the row labels and column labels, and one for the little corner piece next to the row and col labels. The grid window is set as the ScrolledWindow's scroll target, so when scroll events happen that window is where the scrolling actually happens. Then an update is triggered for the label windows and they will look at the current scroll position to figure out what portion of themselves to draw.

···

On 1/28/11 7:18 AM, Mel Wilson wrote:

Here's the problem I think I have:

I want to display a graph with X- and Y-axis captions, and allow zooming
to show a sub-rectangle of the graph. Right now I have the graph canvas
and the captions as separate windows managed by a FlexGridSizer, all
within a ScrolledWindow. What I'd like is to have the ScrolledWindow's
horizontal ScrollBar affect the graph canvas and X-legends and the
vertical ScrollBar affect the graph canvas and Y-legends.

Is there a recipe for this? Either handing the appropriate events
around, or setting up methods in each object to keep everything in sync?

--
Robin Dunn
Software Craftsman

Many thanks. I'll have a look. I'd tried to copy plot, but it's daunting.

  Mel.

···

On 11-01-28 02:17 PM, Robin Dunn wrote:

On 1/28/11 7:18 AM, Mel Wilson wrote:

I want to display a graph with X- and Y-axis captions, and allow
zooming

It sounds like you are wanting to do something similar to how
wx.grid.Grid works.