public PropertiesEditor(String caption, String persistName, bool horizontal)
            : base(horizontal ? MDIObjectEditor.HorizontalLayoutName : MDIObjectEditor.VerticalLayoutName, persistName)
        {
            window.Caption = caption;

            uiCallback = new GuiFrameworkUICallback();

            tree         = new Tree((ScrollView)window.findWidget("TreeScroller"));
            editTreeView = new EditInterfaceTreeView(tree, uiCallback);
            editTreeView.EditInterfaceSelectionChanged += editTreeView_EditInterfaceSelectionChanged;
            editTreeView.EditInterfaceAdded            += editTreeView_EditInterfaceAdded;
            editTreeView.EditInterfaceRemoved          += editTreeView_EditInterfaceRemoved;

            addRemoveButtons = new AddRemoveButtons((Button)window.findWidget("Add"), (Button)window.findWidget("Remove"), window.findWidget("AddRemovePanel"));
            addRemoveButtons.VisibilityChanged += addRemoveButtons_VisibilityChanged;

            tableScroller = (ScrollView)window.findWidget("TableScroller");
            table         = new ResizingTable(tableScroller);
            propTable     = new PropertiesTable(table, uiCallback, addRemoveButtons);
            propTable.EditablePropertyValueChanged += propTable_EditablePropertyValueChanged;
            addRemoveButtons.RemoveButtonClicked   += addRemoveButtons_RemoveButtonClicked;
            addRemoveButtons.AddButtonClicked      += addRemoveButtons_AddButtonClicked;

            objectEditor = new ObjectEditor(editTreeView, propTable, uiCallback);

            this.Resized += DebugVisualizer_Resized;

            gap = tableScroller.Bottom - addRemoveButtons.Top;

            splitter = new Splitter(window.findWidget("Splitter"));
            splitter.Widget1Resized += split => tree.layout();
            splitter.Widget2Resized += split => table.layout();
        }
        public DebugVisualizer(StandaloneController standaloneController)
            : base("Developer.GUI.DebugVisualizer.DebugVisualizer.layout")
        {
            this.medicalController               = standaloneController.MedicalController;
            this.pluginManager                   = medicalController.PluginManager;
            standaloneController.SceneLoaded    += standaloneController_SceneLoaded;
            standaloneController.SceneUnloading += standaloneController_SceneUnloading;

            uiCallback = new GuiFrameworkUICallback();

            tree         = new Tree((ScrollView)window.findWidget("TreeScroller"));
            editTreeView = new EditInterfaceTreeView(tree, uiCallback);

            propertiesForm = new ScrollablePropertiesForm((ScrollView)window.findWidget("TableScroller"), uiCallback);

            objectEditor = new ObjectEditor(editTreeView, propertiesForm, uiCallback);

            this.Resized += DebugVisualizer_Resized;

            currentScene = standaloneController.MedicalController.CurrentScene;

            splitter = new Splitter(window.findWidget("Splitter"));
            splitter.Widget1Resized += a => tree.layout();
            splitter.Widget2Resized += a => propertiesForm.layout();
        }
示例#3
0
        public GenericEditorComponent(MyGUIViewHost viewHost, GenericEditorView view, bool horizontalAlignment = true)
            : base(horizontalAlignment ? "Medical.GUI.Editor.GenericEditor.GenericEditorComponent.layout" : "Medical.GUI.Editor.GenericEditor.GenericEditorVerticalComponent.layout", viewHost)
        {
            this.name             = view.Name;
            this.editorController = view.EditorController;
            this.uiCallback       = view.EditUICallback;

            tree         = new Tree((ScrollView)widget.findWidget("TreeScroller"));
            editTreeView = new EditInterfaceTreeView(tree, view.EditUICallback);

            tableScroller = (ScrollView)widget.findWidget("TableScroller");
            table         = new ResizingTable(tableScroller);

            addRemoveButtons = new AddRemoveButtons((Button)widget.findWidget("Add"), (Button)widget.findWidget("Remove"), widget.findWidget("AddRemovePanel"));
            addRemoveButtons.VisibilityChanged += addRemoveButtons_VisibilityChanged;
            propTable = new PropertiesTable(table, view.EditUICallback, addRemoveButtons);

            objectEditor = new ObjectEditor(editTreeView, propTable, view.EditUICallback);

            gap = tableScroller.Bottom - addRemoveButtons.Top;

            EditInterfaceHandler editInterfaceHandler = viewHost.Context.getModel <EditInterfaceHandler>(EditInterfaceHandler.DefaultName);

            if (editInterfaceHandler != null)
            {
                editInterfaceHandler.setEditInterfaceConsumer(this);
            }

            widget.RootKeyChangeFocus += new MyGUIEvent(widget_RootKeyChangeFocus);

            splitter = new Splitter(widget.findWidget("Splitter"));
            splitter.Widget1Resized += split => tree.layout();
            splitter.Widget2Resized += split => table.layout();
        }
示例#4
0
        public GenericPropertiesFormComponent(MyGUIViewHost viewHost, GenericPropertiesFormView genericEditorView)
            : base(genericEditorView.HorizontalAlignment ? "Medical.GUI.Editor.GenericEditor.GenericEditorComponent.layout" : "Medical.GUI.Editor.GenericEditor.GenericEditorVerticalComponent.layout", viewHost)
        {
            Widget window = this.widget;

            this.name             = genericEditorView.Name;
            this.editorController = genericEditorView.EditorController;

            tree         = new Tree((ScrollView)window.findWidget("TreeScroller"));
            editTreeView = new EditInterfaceTreeView(tree, genericEditorView.EditUICallback);

            //This class does not use the add / remove buttons from the layout, so hide them
            Widget addRemovePanel = widget.findWidget("AddRemovePanel");

            addRemovePanel.Visible = false;

            tableScroller    = (ScrollView)widget.findWidget("TableScroller");
            table            = new ResizingTable(tableScroller);
            addRemoveButtons = new AddRemoveButtons((Button)widget.findWidget("Add"), (Button)widget.findWidget("Remove"), widget.findWidget("AddRemovePanel"));
            addRemoveButtons.VisibilityChanged += addRemoveButtons_VisibilityChanged;
            addRemoveButtons_VisibilityChanged(addRemoveButtons, addRemoveButtons.Visible);
            propTable = new PropertiesTable(table, genericEditorView.EditUICallback, addRemoveButtons);

            propertiesForm = new ScrollablePropertiesForm(tableScroller, genericEditorView.EditUICallback);

            contextualProperties = new ContextualPropertiesEditor(propertiesForm, propTable);

            objectEditor = new ObjectEditor(editTreeView, contextualProperties, genericEditorView.EditUICallback);

            EditInterfaceHandler editInterfaceHandler = viewHost.Context.getModel <EditInterfaceHandler>(EditInterfaceHandler.DefaultName);

            if (editInterfaceHandler != null)
            {
                editInterfaceHandler.setEditInterfaceConsumer(this);
            }

            widget.RootKeyChangeFocus += new MyGUIEvent(widget_RootKeyChangeFocus);

            CurrentEditInterface = genericEditorView.EditInterface;

            gap = tableScroller.Bottom - addRemoveButtons.Top;

            splitter = new Splitter(widget.findWidget("Splitter"));
            splitter.Widget1Resized += split => tree.layout();
            splitter.Widget2Resized += split =>
            {
                if (contextualProperties.CurrentEditor == propertiesForm)
                {
                    propertiesForm.layout();
                }
                else
                {
                    table.layout();
                }
            };
        }
示例#5
0
        public SolutionWindow()
            : base("Anomaly.GUI.SolutionWindow.SolutionWindow.layout")
        {
            tree = new Tree((ScrollView)window.findWidget("TreeScroller"));
            editInterfaceView = new EditInterfaceTreeView(tree, uiCallback);

            editInterfaceView.EditInterfaceSelectionChanged += editInterfaceView_EditInterfaceSelectionChanged;

            this.Resized += SolutionWindow_Resized;
        }
示例#6
0
        public ScratchArea(ScratchAreaController scratchAreaController, GuiFrameworkUICallback uiCallback)
            : base("Medical.GUI.ScratchArea.ScratchArea.layout")
        {
            this.scratchAreaController = scratchAreaController;

            this.uiCallback = uiCallback;
            uiCallback.addCustomQuery <SaveableClipboard>(ScratchAreaCustomQueries.GetClipboard, getClipboardCallback);

            tree         = new Tree((ScrollView)window.findWidget("TableScroll"));
            editTreeView = new EditInterfaceTreeView(tree, uiCallback);
            editTreeView.EditInterface = scratchAreaController.EditInterface;
            editTreeView.EditInterfaceSelectionChanged += editTreeView_EditInterfaceSelectionChanged;

            this.Resized += new EventHandler(ScratchArea_Resized);
        }
示例#7
0
        public DebugVisualizer(PluginManager pluginManager, SceneController sceneController)
            : base("Anomaly.GUI.DebugVisualizer.DebugVisualizer.layout")
        {
            this.pluginManager   = pluginManager;
            this.sceneController = sceneController;

            uiCallback = new GuiFrameworkUICallback();

            tree         = new Tree((ScrollView)window.findWidget("TreeScroller"));
            editTreeView = new EditInterfaceTreeView(tree, uiCallback);

            propertiesForm = new ScrollablePropertiesForm((ScrollView)window.findWidget("TableScroller"), uiCallback);

            objectEditor = new ObjectEditor(editTreeView, propertiesForm, uiCallback);

            this.Resized += DebugVisualizer_Resized;

            currentScene = sceneController.CurrentScene;

            splitter = new Splitter(window.findWidget("Splitter"));
            splitter.Widget1Resized += a => tree.layout();
            splitter.Widget2Resized += a => propertiesForm.layout();
        }