public override void onClick(string SelectedidString)
            {
                ETransformSelection ETransformSelection = "ETransformSelection";

                GuiControl id = ((GuiControl)this.getRoot()).getFirstResponder();

                if (id > -1 && ETransformSelection.controlIsChild(id))
                {
                    id.clearFirstResponder(true);
                }
            }
Esempio n. 2
0
        public void saveNewFileFinish(string newFileName)
        {
            GuiWindowCollapseCtrl DatablockEditorInspectorWindow = "DatablockEditorInspectorWindow";

            // Clear the first responder to capture any inspector changes
            GuiControl ctrl = ((GuiCanvas)"canvas").getFirstResponder();

            if (ctrl.isObject())
            {
                ctrl.clearFirstResponder(false);
            }

            GuiTreeViewCtrl tree     = "DatablockEditorTree";
            int             count    = tree.getSelectedItemsCount();
            string          selected = tree.getSelectedItemList();

            foreach (string id in selected.Split(' '))
            {
                //TODO
                SimObject db = tree.getItemValue(id.AsInt());
                //db = this.getSelectedDatablock();

                // Remove from current file.

                string oldFileName = db.getFilename();
                if (oldFileName != "")
                {
                    this.PM.removeObjectFromFile(db, oldFileName);
                }

                // Save to new file.

                this.PM.setDirty(db, newFileName);
                if (this.PM.saveDirtyObject(db))
                {
                    // Clear dirty state.

                    this.flagDatablockAsDirty(db, false);
                }
            }

            ((GuiTextEditCtrl)DatablockEditorInspectorWindow.findObjectByInternalName("DatablockFile", true)).setText
                (newFileName);
        }
        public void save()
        {
            // Clear the first responder to capture any inspector changes
            GuiControl ctrl = ((GuiCanvas)"canvas").getFirstResponder();

            if (ctrl.isObject())
            {
                ctrl.clearFirstResponder(false);
            }

            GuiTreeViewCtrl tree     = "DatablockEditorTree";
            string          selected = tree.getSelectedItemList();

            foreach (string id in selected.Split(' '))
            {
                string db = tree.getItemValue(id.AsInt());
                if (this.PM.isDirty(db))
                {
                    this.PM.saveDirtyObject(db);
                    this.flagDatablockAsDirty(db, false);
                }
            }
        }