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 OffsetSequenceEditor(SaveableClipboard clipboard, MyGUIViewHost viewHost, OffsetSequenceEditorView view, MedicalController medicalController) : base("Medical.GUI.OffsetSequence.OffsetSequenceEditor.layout", viewHost) { this.clipboard = clipboard; this.medicalController = medicalController; this.simObjectMover = view.SimObjectMover; widget.KeyButtonReleased += new MyGUIEvent(window_KeyButtonReleased); widget.RootKeyChangeFocus += new MyGUIEvent(widget_RootKeyChangeFocus); //Remove button Button removeButton = widget.findWidget("RemoveAction") as Button; removeButton.MouseButtonClick += new MyGUIEvent(removeButton_MouseButtonClick); //Timeline view ScrollView timelineViewScrollView = widget.findWidget("ActionView") as ScrollView; timelineView = new TimelineView(timelineViewScrollView); timelineView.Duration = Duration; timelineView.KeyReleased += new EventHandler <KeyEventArgs>(timelineView_KeyReleased); timelineView.ActiveDataChanged += timelineView_ActiveDataChanged; //Properties ScrollView timelinePropertiesScrollView = widget.findWidget("ActionPropertiesScrollView") as ScrollView; actionProperties = new TimelineDataProperties(timelinePropertiesScrollView, timelineView); actionProperties.Visible = false; actionProperties.addPanel("Offset Position", new OffsetKeyframeProperties(timelinePropertiesScrollView, this, view.UICallback)); //Timeline filter ScrollView timelineFilterScrollView = widget.findWidget("ActionFilter") as ScrollView; trackFilter = new TrackFilter(timelineFilterScrollView, timelineView); trackFilter.AddTrackItem += new AddTrackItemCallback(trackFilter_AddTrackItem); numberLine = new NumberLine(widget.findWidget("NumberLine") as ScrollView, timelineView); //Add tracks to timeline. timelineView.addTrack("Offset Position"); ViewHost.Context.getModel <EditMenuManager>(EditMenuManager.DefaultName).setMenuProvider(this); Button chooseTargetButton = (Button)widget.findWidget("ChooseTargetButton"); chooseTargetButton.MouseButtonClick += chooseTargetButton_MouseButtonClick; targetLabel = (TextBox)widget.findWidget("TargetLabel"); targetLabel.Caption = DefaultTargetLabelText; CurrentSequence = view.Sequence; }
public PropTimeline(SaveableClipboard clipboard, PropEditController propEditController, PropFactory propFactory, MyGUIViewHost viewHost) : base("Medical.GUI.Editor.PropTimeline.PropTimeline.layout", viewHost) { this.clipboard = clipboard; this.propEditController = propEditController; this.propFactory = propFactory; propEditController.ShowPropActionChanged += propEditController_ShowPropActionChanged; propEditController.DurationChanged += propEditController_DurationChanged; propEditController.MarkerMoved += propEditController_MarkerMoved; widget.KeyButtonReleased += new MyGUIEvent(window_KeyButtonReleased); widget.RootKeyChangeFocus += new MyGUIEvent(widget_RootKeyChangeFocus); //Timeline view ScrollView timelineViewScrollView = widget.findWidget("ActionView") as ScrollView; timelineView = new TimelineView(timelineViewScrollView); timelineView.Duration = 5.0f; timelineView.KeyReleased += new EventHandler <KeyEventArgs>(timelineView_KeyReleased); timelineView.ActiveDataChanged += new EventHandler(timelineView_ActiveDataChanged); //Properties timelineDataManager = new PropTimelineDataManager(); //Timeline filter ScrollView timelineFilterScrollView = widget.findWidget("ActionFilter") as ScrollView; trackFilter = new TrackFilter(timelineFilterScrollView, timelineView); trackFilter.AddTrackItem += new AddTrackItemCallback(trackFilter_AddTrackItem); numberLine = new NumberLine(widget.findWidget("NumberLine") as ScrollView, timelineView); setPropData(propEditController.CurrentShowPropAction); ViewHost.Context.getModel <EditMenuManager>(EditMenuManager.DefaultName).setMenuProvider(this); }
public MovementSequenceEditor(MovementSequenceController movementSequenceController, SaveableClipboard clipboard, MyGUIViewHost viewHost, MovementSequenceEditorView view) : base("Medical.GUI.Editor.MovementSequence.MovementSequenceEditor.layout", viewHost) { this.clipboard = clipboard; widget.KeyButtonReleased += new MyGUIEvent(window_KeyButtonReleased); widget.RootKeyChangeFocus += new MyGUIEvent(widget_RootKeyChangeFocus); this.movementSequenceController = movementSequenceController; movementSequenceController.PlaybackStarted += movementSequenceController_PlaybackStarted; movementSequenceController.PlaybackStopped += movementSequenceController_PlaybackStopped; movementSequenceController.PlaybackUpdate += movementSequenceController_PlaybackUpdate; //Remove button Button removeButton = widget.findWidget("RemoveAction") as Button; removeButton.MouseButtonClick += new MyGUIEvent(removeButton_MouseButtonClick); //Duration Edit durationEdit = new NumericEdit(widget.findWidget("SequenceDuration") as EditBox); durationEdit.AllowFloat = true; durationEdit.ValueChanged += new MyGUIEvent(durationEdit_ValueChanged); durationEdit.MinValue = 0.0f; durationEdit.MaxValue = 600; //Play Button playButton = widget.findWidget("PlayButton") as Button; playButton.MouseButtonClick += new MyGUIEvent(playButton_MouseButtonClick); //Timeline view ScrollView timelineViewScrollView = widget.findWidget("ActionView") as ScrollView; timelineView = new TimelineView(timelineViewScrollView); timelineView.DurationChanged += new EventHandler(timelineView_DurationChanged); timelineView.Duration = 5.0f; timelineView.KeyReleased += new EventHandler <KeyEventArgs>(timelineView_KeyReleased); //Properties ScrollView timelinePropertiesScrollView = widget.findWidget("ActionPropertiesScrollView") as ScrollView; actionProperties = new TimelineDataProperties(timelinePropertiesScrollView, timelineView); actionProperties.Visible = false; actionProperties.addPanel("Muscle Position", new MovementKeyframeProperties(timelinePropertiesScrollView)); //Timeline filter ScrollView timelineFilterScrollView = widget.findWidget("ActionFilter") as ScrollView; trackFilter = new TrackFilter(timelineFilterScrollView, timelineView); trackFilter.AddTrackItem += new AddTrackItemCallback(trackFilter_AddTrackItem); numberLine = new NumberLine(widget.findWidget("NumberLine") as ScrollView, timelineView); //Add tracks to timeline. timelineView.addTrack("Muscle Position"); CurrentSequence = view.Sequence; if (view.ListenForSequenceChanges) { movementSequenceController.CurrentSequenceChanged += movementSequenceController_CurrentSequenceChanged; if (CurrentSequence == null) { CurrentSequence = movementSequenceController.CurrentSequence; } } ViewHost.Context.getModel <EditMenuManager>(EditMenuManager.DefaultName).setMenuProvider(this); }