On Sat, Jan 31, 2009 at 1:47 PM, Chris Fryer <[email protected]> wrote:
> I think I've got the general idea - it's a ScrollView containing a
> viewport whose size is defined on modification and onto which widgets
> are drawn.

Sort of... although there is only one actual widget.  I think you
could describe it as a scroll view with no child widgets at all, but
whose viewportPaintEvent() is overridden so as to draw the visible
area of the composition directly on to the scroll viewport, "faking"
the suggestion of a larger widget behind it.

> One thing I'm struggling to find at the moment is how the horizontal
> lines between the tracks are constructed.

CompositionView::drawArea(), at CompositionView.cpp lines 725 to 753.
The CompositionModelImpl manages the records of how tall the
individual tracks are (since tracks with overlapping segments in them
are made taller), through a SnapGrid record whose "bin height
multiple" records are adjusted appropriately in setTrackHeights() when
a segment's position changes.

(Although I didn't write CompositionView, I did write the bit that
manages variable track heights and draws the dividing lines.  It isn't
very nice code, though.)


Chris

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to