Esempio n. 1
0
        public void ShowPad(IPadContent content)
        {
            if (contentHash[content] == null)
            {
                IProperties properties = (IProperties)propertyService.GetProperty("Workspace.ViewMementos", new DefaultProperties());
                string      type       = content.GetType().ToString();
                content.Control.Dock = DockStyle.None;
                Content c1;
                if (content.Icon != null)
                {
                    ImageList imgList = new ImageList();
                    imgList.Images.Add(content.Icon);
                    c1 = dockManager.Contents.Add(content.Control, content.Title, imgList, 0);
                }
                else
                {
                    c1 = dockManager.Contents.Add(content.Control, content.Title);
                }

                c1.DisplaySize = new Size(270, 200);

                contentHash[content] = c1;


                if (properties.GetProperty(type, "Left") == "Left")
                {
                    if (leftContent == null)
                    {
                        leftContent = dockManager.AddContentWithState(c1, State.DockLeft);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, leftContent);
                    }
                }
                else if (properties.GetProperty(type, "Left") == "Bottom")
                {
                    if (bottomContent == null)
                    {
                        bottomContent = dockManager.AddContentWithState(c1, State.DockBottom);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, bottomContent);
                    }
                }
            }
            else
            {
                Content c = (Content)contentHash[content];
                if (c != null)
                {
                    dockManager.ShowContent(c);
                }
            }
        }
Esempio n. 2
0
    protected void OnCreateC33(object sender, EventArgs e)
    {
        // Create three Content objects, one of each type
        Content cA = _manager.Contents.Add(new DummyForm(), "Form " + _count++, _internalImages, _count % 6);
        Content cB = _manager.Contents.Add(new DummyPanel(), "Panel " + _count++, _internalImages, _count % 6);
        Content cC = _manager.Contents.Add(new RichTextBox(), "RichTextBox " + _count++, _internalImages, _count % 6);

        // Setup initial state to match menu selections
        DefineContentState(cA);
        DefineContentState(cB);
        DefineContentState(cC);

        // Setup the correct starting colors to match the menu selections
        DefineControlColors(cA);
        DefineControlColors(cB);
        DefineControlColors(cC);

        // Request a new Docking window be created for the first content on the bottom edge
        WindowContent wc = _manager.AddContentWithState(cA, State.DockBottom) as WindowContent;

        // Add two other content into the same Window
        _manager.AddContentToWindowContent(cB, wc);
        _manager.AddContentToWindowContent(cC, wc);
    }
        public void CreateViews(IContent codeView, IContent outputView, IContent watchView, IContent registersView,
                                IContent dataCacheView, IContent instructionCacheView, IContent unifiedCacheView,
                                IContent stackView, IContent pluginsUIView)
        {
            /* BB - 08/10/2014 -
             * The original position of the codeView was as the 'background' which occupied
             * whatever space wasn't used by the docked windows. This approach broke somehow
             * during the interface change, so now the codeView is treated as another docking
             * window. It's not a high priority to fix the problem since this docking interface
             * is being deprecated.
             */
            /*
             *          codeView.Control.Dock = DockStyle.Fill;
             * mManager.InnerControl.Controls.Add(codeView.Control);
             */
            //The codeView is added at the bottom of this method.

            Content c = mManager.Contents.Add(registersView.Control, registersView.Control.Text, mInternalImages, 0);

            mManager.AddContentWithState(c, State.DockLeft);
            registersView.Tag = c;

            Content c1 = mManager.Contents.Add(outputView.Control, outputView.Control.Text, mInternalImages, 0);

            outputView.Tag = c1;
            Content c2 = mManager.Contents.Add(watchView.Control, watchView.Control.Text, mInternalImages, 0);

            watchView.Tag = c2;
            mManager.Contents.Add(c2);
            WindowContent wc = mManager.AddContentWithState(c1, State.DockBottom) as WindowContent;

            mManager.AddContentToWindowContent(c2, wc);

            //mContents.Add(outputView.Text, new ContentControl(outputView, outputView.Text, c1, mManager));
            //mContents.Add(watchView.Text, new ContentControl(watchView, watchView.Text, c2, mManager));

            c = mManager.Contents.Add(dataCacheView.Control, dataCacheView.Control.Text, mInternalImages, 0);
            dataCacheView.Tag = c;
            mManager.AddContentWithState(c, State.DockTop);
            mManager.HideContent(c);
            //mContents.Add(dataCacheView.Text, new ContentControl(dataCacheView, dataCacheView.Text, c, mManager));

            c = mManager.Contents.Add(instructionCacheView.Control, instructionCacheView.Control.Text, mInternalImages, 0);
            instructionCacheView.Tag = c;
            mManager.AddContentWithState(c, State.DockTop);
            mManager.HideContent(c);
            //mContents.Add(instructionCacheView.Text, new ContentControl(instructionCacheView, instructionCacheView.Text, c, mManager));

            c = mManager.Contents.Add(unifiedCacheView.Control, unifiedCacheView.Control.Text, mInternalImages, 0);
            unifiedCacheView.Tag = c;
            mManager.AddContentWithState(c, State.DockTop);
            mManager.HideContent(c);
            //mContents.Add(unifiedCacheView.Text, new ContentControl(unifiedCacheView, unifiedCacheView.Text, c, mManager));

            c             = mManager.Contents.Add(stackView.Control, stackView.Control.Text, mInternalImages, 0);
            stackView.Tag = c;
            mManager.AddContentWithState(c, State.DockRight);
            mManager.ToggleContentAutoHide(c);
            //mContents.Add(stackView.Text, new ContentControl(stackView, stackView.Text, c, mManager));

            //pluginsUIView.Visible = false;
            c = mManager.Contents.Add(pluginsUIView.Control, pluginsUIView.Control.Text, mInternalImages, 0);
            pluginsUIView.Tag = c;
            mManager.AddContentWithState(c, State.DockTop);
            mManager.HideContent(c);
            //mContents.Add(pluginsUIView.Text, new ContentControl(pluginsUIView, pluginsUIView.Text, c, mManager));

            Content c0 = mManager.Contents.Add(codeView.Control, codeView.Control.Text, mInternalImages, 0);

            mManager.AddContentWithState(c0, State.Floating);
            codeView.Tag = c0;
        }//CreateViews