Viewport - more than 1 viewed component


#1

I’m trying to use a Viewport to view a bunch of table components, sometimes at the same time. These tables contain amp values for envelopes, sound files etc…and are superimposed on top of one another, with different alpha levels for transparency. Using the mouse the user can zoom in/out and the Viewport adds a horizontal scoll bar etc, and the table gets repainted.
However only the top table changes, and I obviously need them all to zoom at the same rate. Is this because the ones underneath are not receiving the mouse events or can the Viewport only really show one component at one time?
As each table gets added I use the following in the Viewport component, this->setViewedComponent (table, false);
Even though I can see through the top table (because of the alpha level), I’m not sure if the viewport “knows” about the tables underneath the top one?

Thanks…


#2

i’m not knowing exactly what you trying to achieve, but i’m very sure the viewport was not designed for that what you are trying to do.

Stacking viewports is not a good idea, and a one can only handle one component, so if you want more components, just put them together in one parent component and add that to your viewport.


#3

[quote=“chkn”]
…and a one can only handle one component, so if you want more components, just put them together in one parent component and add that to your viewport.[/quote]

This is what I was thinking before but I am able to see the components underneath the top one without adding them to a parent component first. This led me to presume that viewports could handle more than one component? But I guess not…


#4

Put your components on one big component and pass that parent one to the viewport, resize the parent component when you need it and the viewport will react accordingly (this is how i made a chat component with those ugly chat bubble like on the iphone)