public TimelineEditorComponent(MyGUIViewHost viewHost, TimelineEditorView view, SaveableClipboard clipboard)
            : base("Medical.GUI.Editor.TimelineEditor.TimelineEditorComponent.layout", viewHost)
        {
            Widget window = this.widget;

            window.RootKeyChangeFocus += new MyGUIEvent(window_RootKeyChangeFocus);

            this.clipboard          = clipboard;
            this.editorController   = view.EditorController;
            this.propEditController = view.PropEditController;

            this.timelineController = view.TimelineController;
            timelineController.TimelinePlaybackStarted += timelineController_TimelinePlaybackStarted;
            timelineController.TimelinePlaybackStopped += timelineController_TimelinePlaybackStopped;
            timelineController.TimeTicked += timelineController_TimeTicked;

            window.KeyButtonReleased += new MyGUIEvent(window_KeyButtonReleased);

            //Play Button
            playButton = window.findWidget("PlayButton") as Button;
            playButton.MouseButtonClick += new MyGUIEvent(playButton_MouseButtonClick);

            fastForwardButton = window.findWidget("FastForward") as Button;
            fastForwardButton.MouseButtonClick += new MyGUIEvent(fastForwardButton_MouseButtonClick);

            rewindButton = window.findWidget("Rewind") as Button;
            rewindButton.MouseButtonClick += new MyGUIEvent(rewindButton_MouseButtonClick);

            //Timeline view
            ScrollView timelineViewScrollView = window.findWidget("ActionView") as ScrollView;

            timelineView                     = new TimelineView(timelineViewScrollView);
            timelineView.KeyReleased        += new EventHandler <KeyEventArgs>(timelineView_KeyReleased);
            timelineView.ActiveDataChanging += new EventHandler <CancelEventArgs>(timelineView_ActiveDataChanging);
            timelineView.MarkerMoved        += new EventDelegate <TimelineView, float>(timelineView_MarkerMoved);
            timelineView.ActiveDataChanged  += new EventHandler(timelineView_ActiveDataChanged);

            //Track filter
            ScrollView trackFilterScrollView = window.findWidget("ActionFilter") as ScrollView;

            actionFilter = new TrackFilter(trackFilterScrollView, timelineView);
            actionFilter.AddTrackItem += new AddTrackItemCallback(actionFilter_AddTrackItem);

            numberLine = new NumberLine(window.findWidget("NumberLine") as ScrollView, timelineView);

            //Add tracks to timeline.
            buildTrackActions();
            foreach (TimelineActionPrototype action in actionDataManager.Prototypes)
            {
                timelineView.addTrack(action.TypeName);
            }

            //Enabled = false;

            ViewHost.Context.getModel <EditMenuManager>(EditMenuManager.DefaultName).setMenuProvider(this);
        }
 public ViewHostComponent createViewHostComponent(MyGUIView view, AnomalousMvcContext context, MyGUIViewHost viewHost)
 {
     if (view is TimelineEditorView)
     {
         TimelineEditorView      editorView     = (TimelineEditorView)view;
         TimelineEditorComponent timelineEditor = new TimelineEditorComponent(viewHost, editorView, clipboard);
         timelineEditor.CurrentTimeline = editorView.Timeline;
         editorView.fireComponentCreated(timelineEditor);
         return(timelineEditor);
     }
     return(null);
 }