public PropTimelineData(ShowPropSubAction action, PropEditController propEditController)
 {
     this.action              = action;
     this.propEditController  = propEditController;
     action.StartTimeChanged += action_StartTimeChanged;
     action.DurationChanged  += action_DurationChanged;
 }
        public void initialize(StandaloneController standaloneController)
        {
            GUIManager guiManager = standaloneController.GUIManager;

            editorTimelineController = new TimelineController(standaloneController);
            standaloneController.giveGUIsToTimelineController(editorTimelineController);

            editorController = new EditorController(standaloneController, editorTimelineController);
            editorController.ProjectTypes.addInfo(new ZipProjectType(".sl"));
            standaloneController.DocumentController.addDocumentHandler(new SlideshowDocumentHandler(editorController));

            //Prop Mover
            MedicalController medicalController = standaloneController.MedicalController;

            propMover = new SimObjectMover("LectureProps", medicalController.PluginManager.RendererPlugin, medicalController.EventManager, standaloneController.SceneViewController);

            propEditController = new PropEditController(propMover);

            editorUICallback = new LectureUICallback(standaloneController, editorController, propEditController);

            slideshowEditController = new SlideshowEditController(standaloneController, editorUICallback, this.propEditController, editorController, editorTimelineController);
            slideshowExplorer       = new SlideshowExplorer(slideshowEditController);
            guiManager.addManagedDialog(slideshowExplorer);

            TaskController taskController = standaloneController.TaskController;

            taskController.addTask(new MDIDialogOpenTask(slideshowExplorer, "Medical.SlideshowExplorer", "Authoring Tools", "Lecture.Icon.SmartLectureIcon", TaskMenuCategories.Create));

            CommonEditorResources.initialize(standaloneController);
            standaloneController.ViewHostFactory.addFactory(new SlideTaskbarFactory());

            standaloneController.MedicalStateController.StateAdded      += MedicalStateController_StateAdded;
            standaloneController.MedicalStateController.BlendingStopped += MedicalStateController_BlendingStopped;
        }
Example #3
0
        void propEditController_PropClosed(PropEditController source, ShowPropAction arg)
        {
            uint itemIndex = propList.findItemWithData(arg);

            if (itemIndex != uint.MaxValue)
            {
                propList.removeItemAt(itemIndex);
            }
        }
 public OpenPropManagerView(String name, PropEditController propEditController)
     : base(name)
 {
     ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Floating)
     {
         AllowedDockLocations = DockLocation.Left | DockLocation.Right | DockLocation.Floating
     };
     this.PropEditController = propEditController;
 }
        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 PropTimelineView(String name, PropEditController propEditController, PropFactory propFactory)
     : base(name)
 {
     ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Top)
     {
         AllowedDockLocations = DockLocation.Top | DockLocation.Bottom | DockLocation.Floating
     };
     this.PropEditController = propEditController;
     this.PropFactory        = propFactory;
 }
        public SlideshowEditController(StandaloneController standaloneController, LectureUICallback uiCallback, PropEditController propEditController, EditorController editorController, TimelineController timelineController)
        {
            this.standaloneController        = standaloneController;
            this.uiCallback                  = uiCallback;
            this.propEditController          = propEditController;
            this.editorController            = editorController;
            this.timelineController          = timelineController;
            editorController.ProjectChanged += editorController_ProjectChanged;
            slideImageManager                = new SlideImageManager(this);
            this.AllowSlideSceneSetup        = true;

            //Show Type Controller
            showTypeController = new ShowTypeController(editorController);
            editorController.addTypeController(showTypeController);
            timelineTypeController = new TimelineTypeController(editorController);
            editorController.addTypeController(timelineTypeController);

            medicalSlideTemplate = new MedicalSlideItemTemplate(standaloneController.SceneViewController, standaloneController.MedicalStateController);
            medicalSlideTemplate.SlideCreated += (slide) =>
            {
                if (lastEditSlide != null)
                {
                    int insertIndex = slideshow.indexOf(lastEditSlide);
                    if (insertIndex != -1)
                    {
                        ++insertIndex;
                    }
                    addSlide(slide, insertIndex);
                }
                else
                {
                    addSlide(slide);
                }
            };
            editorController.addItemTemplate(medicalSlideTemplate);
        }
Example #8
0
        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);
        }
Example #9
0
        public OpenPropManager(PropEditController propEditController, MyGUIViewHost viewHost)
            : base("Medical.GUI.Editor.OpenPropManager.OpenPropManager.layout", viewHost)
        {
            this.propEditController        = propEditController;
            propEditController.PropOpened += propEditController_PropOpened;
            propEditController.PropClosed += propEditController_PropClosed;

            propList = (MultiListBox)widget.findWidget("propList");
            propList.addColumn("Prop", 50);
            propList.setColumnResizingPolicyAt(0, ResizingPolicy.Fill);

            Button close = (Button)widget.findWidget("close");

            close.MouseButtonClick += new MyGUIEvent(close_MouseButtonClick);

            Button closeAll = (Button)widget.findWidget("closeAll");

            closeAll.MouseButtonClick += new MyGUIEvent(closeAll_MouseButtonClick);

            foreach (ShowPropAction prop in propEditController.OpenProps)
            {
                propList.addItem(prop.PropType, prop);
            }
        }
Example #10
0
 void propEditController_PropOpened(PropEditController source, ShowPropAction arg)
 {
     propList.addItem(arg.PropType, arg);
 }
 public LectureUICallback(StandaloneController standaloneController, EditorController editorController, PropEditController propEditController)
     : base(standaloneController, editorController, propEditController)
 {
     addCustomQuery <String, String>(PlaySoundAction.CustomQueries.Record, (queryResult, soundFile) =>
     {
         String finalSoundFile = Path.Combine(CurrentDirectory, Guid.NewGuid().ToString("D") + ".ogg");
         String error          = null;
         QuickSoundRecorder.ShowDialog(standaloneController.MedicalController, finalSoundFile, editorController.ResourceProvider.openWriteStream,
                                       newSoundFile =>
         {
             queryResult.Invoke(newSoundFile, ref error);
         });
     });
 }
Example #12
0
 public TimelineEditorView(String name, Timeline timeline, TimelineController timelineController, EditorController editorController, PropEditController propEditController)
     : base(name)
 {
     ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Bottom)
     {
         AllowedDockLocations = DockLocation.Top | DockLocation.Bottom | DockLocation.Floating
     };
     this.Timeline           = timeline;
     this.TimelineController = timelineController;
     this.EditorController   = editorController;
     this.PropEditController = propEditController;
 }
Example #13
0
        public TimelineEditorContext(Timeline timeline, Slide slide, String name, SlideshowEditController slideshowEditController, PropEditController propEditController, PropFactory propFactory, EditorController editorController, GuiFrameworkUICallback uiCallback, TimelineController timelineController)
        {
            this.slide                   = slide;
            this.currentTimeline         = timeline;
            this.slideshowEditController = slideshowEditController;
            this.propEditController      = propEditController;

            mvcContext = new AnomalousMvcContext();
            mvcContext.StartupAction = "Common/Start";
            mvcContext.FocusAction   = "Common/Focus";
            mvcContext.BlurAction    = "Common/Blur";
            mvcContext.SuspendAction = "Common/Suspended";
            mvcContext.ResumeAction  = "Common/Resumed";

            mvcContext.Models.add(new EditMenuManager());
            mvcContext.Models.add(new EditInterfaceHandler());

            var timelineEditorView = new TimelineEditorView("TimelineEditor", currentTimeline, timelineController, editorController, propEditController)
            {
                DisplayTitle = "Main Timeline"
            };

            timelineEditorView.ComponentCreated += timelineEditorView_ComponentCreated;
            mvcContext.Views.add(timelineEditorView);

            ExpandingGenericEditorView genericEditor = new ExpandingGenericEditorView("TimelinePropertiesEditor", currentTimeline.getEditInterface(), editorController, uiCallback)
            {
                DisplayTitle = "Properties"
            };

            genericEditor.ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Left)
            {
                AllowedDockLocations = DockLocation.Left | DockLocation.Right | DockLocation.Floating
            };
            mvcContext.Views.add(genericEditor);

            PropTimelineView propTimelineView = new PropTimelineView("PropTimeline", propEditController, propFactory)
            {
                DisplayTitle = "Prop Timeline"
            };

            propTimelineView.Buttons.add(new CloseButtonDefinition("Close", "PropTimeline/Close"));
            mvcContext.Views.add(propTimelineView);

            OpenPropManagerView propManagerView = new OpenPropManagerView("PropManager", propEditController)
            {
                DisplayTitle = "Prop Manager"
            };

            propManagerView.Buttons.add(new CloseButtonDefinition("Close", "PropManager/Close"));
            mvcContext.Views.add(propManagerView);

            MovementSequenceEditorView movementSequenceEditor = new MovementSequenceEditorView("MovementSequenceEditor", listenForSequenceChanges: true)
            {
                DisplayTitle = "Movement Sequence"
            };

            movementSequenceEditor.Buttons.add(new CloseButtonDefinition("Close", "MovementSequenceEditor/Close"));
            movementSequenceEditor.ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Top)
            {
                AllowedDockLocations = DockLocation.Top | DockLocation.Bottom | DockLocation.Floating
            };
            mvcContext.Views.add(movementSequenceEditor);

            SlideTaskbarView taskbar = new SlideTaskbarView("TimelineInfoBar", name);

            taskbar.addTask(new CallbackTask("SaveAll", "Save All", "CommonToolstrip/Save", "", 0, true, item =>
            {
                saveAll();
            }));
            taskbar.addTask(new RunMvcContextActionTask("Cut", "Cut", "Editor/CutIcon", "", "TimelineEditor/Cut", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("Copy", "Copy", "Editor/CopyIcon", "", "TimelineEditor/Copy", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("Paste", "Paste", "Editor/PasteIcon", "", "TimelineEditor/Paste", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("SelectAll", "Select All", "Editor/SelectAllIcon", "", "TimelineEditor/SelectAll", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("Translation", "Translation", "Editor/TranslateIcon", "", "TimelineEditor/Translation", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("Rotation", "Rotation", "Editor/RotateIcon", "", "TimelineEditor/Rotation", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("PropTimeline", "Prop Timeline Editor", "Editor/PropTimelineEditorIcon", "", "PropTimeline/ShowIfNotOpen", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("PropManager", "Open Prop Manager", "Editor/PropManagerIcon", "", "PropManager/ShowIfNotOpen", mvcContext));
            taskbar.addTask(new RunMvcContextActionTask("MovementSequenceEditor", "Movement Sequence Editor", "Editor/MovementSequenceEditorIcon", "", "MovementSequenceEditor/ShowIfNotOpen", mvcContext));
            taskbar.addTask(new CallbackTask("EditSlide", "Edit Slide", "Lecture.Icon.EditSlide", "", 0, true, item =>
            {
                slideshowEditController.editSlide(slide);
            }));
            mvcContext.Views.add(taskbar);

            RunCommandsAction showCommand = new RunCommandsAction("Show",
                                                                  new ShowViewCommand("TimelineEditor"),
                                                                  new ShowViewCommand("TimelinePropertiesEditor"),
                                                                  new ShowViewCommand("TimelineInfoBar"));

            refreshPanelPreviews(showCommand);

            mvcContext.Controllers.add(new MvcController("TimelineEditor",
                                                         showCommand,
                                                         new RunCommandsAction("Close",
                                                                               new CloseAllViewsCommand()),
                                                         new CutAction(),
                                                         new CopyAction(),
                                                         new PasteAction(),
                                                         new SelectAllAction(),
                                                         new CallbackAction("Translation", context =>
            {
                propEditController.setMoveMode();
            }),
                                                         new CallbackAction("Rotation", context =>
            {
                propEditController.setRotateMode();
            })
                                                         ));

            mvcContext.Controllers.add(new MvcController("PropTimeline",
                                                         new RunCommandsAction("ShowIfNotOpen",
                                                                               new ShowViewIfNotOpenCommand("PropTimeline")
                                                                               ),
                                                         new RunCommandsAction("Close",
                                                                               new CloseViewCommand())));

            mvcContext.Controllers.add(new MvcController("PropManager",
                                                         new RunCommandsAction("ShowIfNotOpen",
                                                                               new ShowViewIfNotOpenCommand("PropManager")),
                                                         new RunCommandsAction("Close",
                                                                               new CloseViewCommand())));

            mvcContext.Controllers.add(new MvcController("MovementSequenceEditor",
                                                         new RunCommandsAction("ShowIfNotOpen",
                                                                               new ShowViewIfNotOpenCommand("MovementSequenceEditor")
                                                                               ),
                                                         new RunCommandsAction("Close",
                                                                               new CloseViewCommand())));

            mvcContext.Controllers.add(new MvcController("Common",
                                                         new RunCommandsAction("Start", new RunActionCommand("TimelineEditor/Show")),
                                                         new CallbackAction("Focus", context =>
            {
                GlobalContextEventHandler.setEventContext(eventContext);
                if (Focus != null)
                {
                    Focus.Invoke(this);
                }
            }),
                                                         new CallbackAction("Blur", context =>
            {
                GlobalContextEventHandler.disableEventContext(eventContext);
                propEditController.removeAllOpenProps();
                if (Blur != null)
                {
                    Blur.Invoke(this);
                }
            }),
                                                         new RunCommandsAction("Suspended", new SaveViewLayoutCommand()),
                                                         new RunCommandsAction("Resumed", new RestoreViewLayoutCommand())));

            eventContext = new EventContext();

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                saveAll();
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_S }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                if (timeline.TimelineController.Playing)
                {
                    timeline.TimelineController.stopPlayback();
                }
                else
                {
                    timeline.TimelineController.startPlayback(timeline, propEditController.MarkerPosition, false);
                }
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_SPACE }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                mvcContext.runAction("TimelineEditor/Cut");
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_X }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                mvcContext.runAction("TimelineEditor/Copy");
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_C }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                mvcContext.runAction("TimelineEditor/Paste");
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_V }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                mvcContext.runAction("TimelineEditor/SelectAll");
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_A }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                mvcContext.runAction("TimelineEditor/Translation");
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_T }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                mvcContext.runAction("TimelineEditor/Rotation");
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_R }));

            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: EventManager =>
            {
                mvcContext.runAction("PropTimeline/ShowIfNotOpen");
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_P }));
        }
 public ShowPropActionPrototype(PropEditController propEditController)
     : base("Show Prop", typeof(ShowPropAction))
 {
     this.propEditController = propEditController;
 }
        public PropTimelineData createData(ShowPropAction showProp, ShowPropSubAction subAction, PropEditController propEditController)
        {
            PropTimelineData timelineData = new PropTimelineData(subAction, propEditController);

            actionDataBindings.Add(subAction, timelineData);
            return(timelineData);
        }
 public ShowPropActionData(ShowPropAction showPropAction, PropEditController propEditController)
     : base(showPropAction)
 {
     this.propEditController = propEditController;
     this.showProp           = showPropAction;
 }