R
Robert Ludig
I am about to implement an editor that has the following features:
A scrollable and zoomable panel (drawing pane , "stage") holds a large
number of items that are arranged on a timeline from left to right.
These items must repsond to use interaction (click, doubleclick, drag,
keystrokes) and must be rearangable on the timeline via drag&drop. In
their client area they can contain text, an icon, text and simple
controls (textbox, dropdown, button).
The stage can contain up to 400 of those items. When the user zooms
the stage the timeline tightens or widens an all of the items on the
timeline get scaled respectively. The more real estate an item
currently has the more information is displayed inside (and the more
controls become visible).
The whole thing behaved sort of like in a video editing software such
as Adobe Premiere or MS Moviemaker (with timeline activated).
-------------------
How would this ideally be implemented. Are there best practises how to
go about this?
How would I implement the stage? I was thinking about a usercontrol
that holds a panel on wich the items get drawn. I would add a Custom
Control the Panel.Controls collection for each item that gets added to
the stage. The position and size of each custom control depends on
Item.StartTime, Item.EndTime and the current scale of the timeline.
The Item Custom Control handles its OnPaint to draw its content. When
the timeline gets zoomed Panel.With and Panel.Height change an all
Item Controls inside the panel get repostioned and repainted. Since we
are in a composite usercontrol the scrollbars would update
automatically.
Are there any downsides with this approach performancewise? Would the
Panel be able to handle up to 400 custom controls ? When I zoom in a
lot the panel would become very large ... Do I need some sort of
virtualization technique?
Any tips on how to approach this are welcome. Thanks !
A scrollable and zoomable panel (drawing pane , "stage") holds a large
number of items that are arranged on a timeline from left to right.
These items must repsond to use interaction (click, doubleclick, drag,
keystrokes) and must be rearangable on the timeline via drag&drop. In
their client area they can contain text, an icon, text and simple
controls (textbox, dropdown, button).
The stage can contain up to 400 of those items. When the user zooms
the stage the timeline tightens or widens an all of the items on the
timeline get scaled respectively. The more real estate an item
currently has the more information is displayed inside (and the more
controls become visible).
The whole thing behaved sort of like in a video editing software such
as Adobe Premiere or MS Moviemaker (with timeline activated).
-------------------
How would this ideally be implemented. Are there best practises how to
go about this?
How would I implement the stage? I was thinking about a usercontrol
that holds a panel on wich the items get drawn. I would add a Custom
Control the Panel.Controls collection for each item that gets added to
the stage. The position and size of each custom control depends on
Item.StartTime, Item.EndTime and the current scale of the timeline.
The Item Custom Control handles its OnPaint to draw its content. When
the timeline gets zoomed Panel.With and Panel.Height change an all
Item Controls inside the panel get repostioned and repainted. Since we
are in a composite usercontrol the scrollbars would update
automatically.
Are there any downsides with this approach performancewise? Would the
Panel be able to handle up to 400 custom controls ? When I zoom in a
lot the panel would become very large ... Do I need some sort of
virtualization technique?
Any tips on how to approach this are welcome. Thanks !