Esempio n. 1
0
 public void SwitchView(BaseViewContent view)
 {
     if (subViewNotebook != null)
     {
         ShowPage(viewContents.IndexOf(view));
     }
 }
Esempio n. 2
0
        public void InsertViewContent(int index, BaseViewContent subViewContent)
        {
            // need to create child Notebook when first IAttachableViewContent is added
            CheckCreateSubViewContents();

            viewContents.Insert(index, subViewContent);
            subViewContent.WorkbenchWindow = this;
            InsertButton(index, subViewContent.TabPageLabel, subViewContent);

            if (ViewsChanged != null)
            {
                ViewsChanged(this, EventArgs.Empty);
            }
        }
Esempio n. 3
0
        protected Tab InsertButton(int index, string label, BaseViewContent viewContent)
        {
            CheckCreateSubViewToolbar();
            updating = true;

            var addedContent = (index == 0 || subViewToolbar.TabCount == 0) && IdeApp.Workbench.ActiveDocument == Document;
            var widgetBox    = new Gtk.VBox();
            var tab          = new Tab(subViewToolbar, label)
            {
                Tag = viewContent
            };

            if (tab.Accessible != null)
            {
                tab.Accessible.Help = viewContent.TabAccessibilityDescription;
            }

            // If this is the current displayed document we need to add the control immediately as the tab is already active.
            if (addedContent)
            {
                widgetBox.Add(viewContent.Control);
                widgetBox.Show();
            }

            subViewToolbar.InsertTab(index, tab);
            subViewNotebook.InsertPage(widgetBox, new Gtk.Label(), index);
            tab.Activated += (sender, e) => {
                if (!addedContent)
                {
                    widgetBox.Add(viewContent.Control);
                    widgetBox.Show();
                    addedContent = true;
                }

                int page = viewContents.IndexOf((BaseViewContent)tab.Tag);
                SetCurrentView(page);
                QueueDraw();
            };

            EnsureToolbarBoxSeparator();
            updating = false;

            if (index == 0)
            {
                ShowPage(0);
            }

            return(tab);
        }
Esempio n. 4
0
        public DocumentToolbar GetToolbar(BaseViewContent targetView)
        {
            DocumentToolbar toolbar;

            if (!documentToolbars.TryGetValue(targetView, out toolbar))
            {
                toolbar = new DocumentToolbar();
                documentToolbars [targetView] = toolbar;
                box.PackStart(toolbar.Container, false, false, 0);
                box.ReorderChild(toolbar.Container, 0);
                toolbar.Visible   = (targetView == ActiveViewContent);
                PathWidgetEnabled = !toolbar.Visible;
            }
            return(toolbar);
        }
Esempio n. 5
0
 DocumentView WrapView(BaseViewContent content)
 {
     if (content == null)
     {
         return(null);
     }
     if (views != null)
     {
         return(views.FirstOrDefault(v => v.BaseContent == content) ?? new DocumentView(this, content));
     }
     else
     {
         return(new DocumentView(this, content));
     }
 }
Esempio n. 6
0
 protected Tab AddButton(string label, BaseViewContent viewContent)
 {
     return(InsertButton(viewContents.Count, label, viewContent));
 }
Esempio n. 7
0
 public void AttachViewContent(BaseViewContent subViewContent)
 {
     InsertViewContent(viewContents.Count, subViewContent);
 }
Esempio n. 8
0
 public ActiveViewContentEventArgs(BaseViewContent content)
 {
     this.content = content;
 }
Esempio n. 9
0
                #pragma warning restore 67

        DocumentToolbar IWorkbenchWindow.GetToolbar(BaseViewContent targetView)
        {
            throw new System.NotImplementedException();
        }
Esempio n. 10
0
 public void SwitchView(BaseViewContent view)
 {
 }
Esempio n. 11
0
 public DocumentToolbar GetToolbar(BaseViewContent targetView)
 {
     throw new NotImplementedException();
 }
Esempio n. 12
0
 public void InsertViewContent(int index, BaseViewContent subViewContent)
 {
 }
Esempio n. 13
0
 public void AttachViewContent(BaseViewContent subViewContent)
 {
 }
Esempio n. 14
0
 internal DocumentView(Document doc, BaseViewContent content)
 {
     document     = doc;
     this.content = content;
 }
Esempio n. 15
0
 public DocumentToolbar GetToolbar(BaseViewContent targetView)
 {
     return(null);
 }