示例#1
0
        public override void OnInspectorGUI()
        {
            FoldingButton t = (FoldingButton)target;

            t.Content = (GameObject)EditorGUILayout.ObjectField("Content", t.Content, typeof(GameObject), true);
            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
            base.OnInspectorGUI();
        }
示例#2
0
        protected override void CreateInnerControls(ExolutioCanvas canvas)
        {
            base.CreateInnerControls(canvas);

            foldingButton = new FoldingButton();
            MainNode.InnerConnectorControl.Children.Add(foldingButton);
            Canvas.SetBottom(foldingButton, -15);
            foldingButton.Click += delegate { this.ViewHelper.IsFolded = !this.ViewHelper.IsFolded; };

            #region main node content components
            border = new Border
            {
                BorderBrush     = ViewToolkitResources.NodeBorderBrush,
                BorderThickness = ViewToolkitResources.Thickness1,
                Background      = ViewToolkitResources.NoInterpretationBrush,
                Opacity         = ViewToolkitResources.LittleOpaque,
                Padding         = ViewToolkitResources.Thickness0,
                CornerRadius    = new CornerRadius(15)
            };
            MainNode.InnerContentControl.Content = border;
            MainNode.MinWidth = 50;

            stackPanel = new StackPanel
            {
                Orientation = Orientation.Vertical
            };
            border.Child = stackPanel;

            tbContentModelHeader = new EditableTextBox
            {
                FontWeight    = FontWeights.Bold,
                TextAlignment = TextAlignment.Center,
                Background    = ViewToolkitResources.TransparentBrush,
                FontSize      = 15,
            };

            stackPanel.Children.Add(tbContentModelHeader);

            #endregion

            ExolutioContextMenu exolutioContextMenu = MenuHelper.GetContextMenu(ScopeAttribute.EScope.PSMContentModel, this.DiagramView.Diagram);
            ContextMenu = exolutioContextMenu;

#if SILVERLIGHT
            ContextMenuService.SetContextMenu(tbContentModelHeader, ContextMenu);
#endif
        }
示例#3
0
        protected override void CreateInnerControls(ExolutioCanvas canvas)
        {
            base.CreateInnerControls(canvas);

            foldingButton = new FoldingButton();
            MainNode.InnerConnectorControl.Children.Add(foldingButton);
            Canvas.SetBottom(foldingButton, -15);
            foldingButton.Click += delegate { this.ViewHelper.IsFolded = !this.ViewHelper.IsFolded; };

            #region main node content components
            border = new Border
            {
                BorderBrush       = ViewToolkitResources.NodeBorderBrush,
                BorderThickness   = ViewToolkitResources.Thickness1,
                VerticalAlignment = VerticalAlignment.Stretch,
                Opacity           = ViewToolkitResources.LittleOpaque
            };
            MainNode.InnerContentControl.Content = border;

            stackPanel = new StackPanel
            {
                Orientation = Orientation.Vertical
            };
            border.Child = stackPanel;

            Border headerBorder = new Border
            {
                Background      = ViewToolkitResources.NoInterpretationBrush,
                BorderThickness = ViewToolkitResources.Thickness0,
                Padding         = ViewToolkitResources.Thickness2,
                BorderBrush     = ViewToolkitResources.BlackBrush
            };

            tbClassHeader = new EditableTextBox
            {
                FontWeight    = FontWeights.Bold,
                TextAlignment = TextAlignment.Center,
                Background    = ViewToolkitResources.NoInterpretationBrush,
                FontSize      = 15,
            };

            headerBorder.Child = tbClassHeader;
            stackPanel.Children.Add(headerBorder);

            Border attributesBorder = new Border
            {
                BorderBrush = ViewToolkitResources.BlackBrush,
                Visibility  = Visibility.Collapsed,
                Background  = ViewToolkitResources.ClassBody
            };
            StackPanel attributesSection = new StackPanel
            {
                Background = ViewToolkitResources.ClassBody
            };
            attributesBorder.Child = attributesSection;

            stackPanel.Children.Add(attributesBorder);
            //Border operationsBorder = new Border
            //{
            //    BorderBrush = ViewToolkitResources.BlackBrush,
            //    Visibility = Visibility.Collapsed,
            //    Background = ViewToolkitResources.SeaShellBrush
            //};

            //StackPanel operationsSection = new StackPanel
            //{
            //    Background = ViewToolkitResources.SeaShellBrush
            //};
            //operationsBorder.Child = operationsSection;
            //stackPanel.Children.Add(operationsBorder);

            //Border[] stackBorders = new Border[] { headerBorder, attributesBorder };
            //ITextBoxContainer[] stackContainers = new ITextBoxContainer[] { attributesContainer };
            //attributesContainer.StackBorders = stackBorders;
            //attributesContainer.StackContainers = stackContainers;
            //classOperations.StackBorders = stackBorders;
            //classOperations.StackContainers = stackContainers;

            #endregion

            ExolutioContextMenu exolutioContextMenu = MenuHelper.GetContextMenu(ScopeAttribute.EScope.PSMSchemaClass, this.DiagramView.Diagram);
            exolutioContextMenu.ScopeObject = PSMSchemaClass;
            exolutioContextMenu.Diagram     = DiagramView.Diagram;
            ContextMenu = exolutioContextMenu;

#if SILVERLIGHT
            ContextMenuService.SetContextMenu(headerBorder, ContextMenu);
#else
            headerBorder.ContextMenu  = ContextMenu;
            tbClassHeader.MouseEnter += tbClassHeader_MouseEnter;
            tbClassHeader.MouseLeave += tbClassHeader_MouseLeave;
#endif
        }