Inheritance: IDisposable, IDockDragSource
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, GetPersistString);
     m_dockHandler.DockStateChanged += DockHandler_DockStateChanged;
     //Suggested as a fix by bensty regarding form resize
     ParentChanged += DockContent_ParentChanged;
 }
        public DocumentTabForm(Script script)
        {
            if (script == null) throw new ArgumentNullException("script");

            Script = script;
            InitializeComponent();

            DockHandler = new DockContentHandler(this);
            DockHandler.DockAreas = DockAreas.Document;
            DockHandler.AllowEndUserDocking = false;

            Controls.Add(textEditor);

            textEditor.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            textEditor.Name = "textEditor";
            textEditor.BorderStyle = BorderStyle.Fixed3D;
            textEditor.ShowMatchingBracket = true;
            textEditor.SetHighlighting("lua");
            textEditor.ShowSpaces = true;
            textEditor.ShowTabs = true;
            textEditor.Dock = DockStyle.Fill;
            textEditor.Text = Script.Text;

            script.NameChanged += ScriptNameChanged;
            FormClosed += (sender, args) => {
                script.NameChanged -= ScriptNameChanged;
            };
            Text = Script.ShortName;
        }
Beispiel #3
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, GetPersistString);
     m_dockHandler.DockStateChanged += DockHandler_DockStateChanged;
     //Suggested as a fix by bensty regarding form resize
     ParentChanged += DockContent_ParentChanged;
 }
Beispiel #4
0
            public void GiveUpFocus(IDockContent content)
            {
                DockContentHandler handler = content.DockHandler;

                if (!handler.Form.ContainsFocus)
                {
                    return;
                }

                if (IsFocusTrackingSuspended)
                {
                    DockPanel.DummyControl.Focus();
                }

                if (LastActiveContent == content)
                {
                    IDockContent prev = handler.PreviousActive;
                    if (prev != null)
                    {
                        Activate(prev);
                    }
                    else if (ListContent.Count > 0)
                    {
                        Activate(ListContent[ListContent.Count - 1]);
                    }
                }
                else if (LastActiveContent != null)
                {
                    Activate(LastActiveContent);
                }
                else if (ListContent.Count > 0)
                {
                    Activate(ListContent[ListContent.Count - 1]);
                }
            }
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     //Suggested as a fix by bensty regarding form resize
     this.ParentChanged += new EventHandler(DockContent_ParentChanged);
 }
Beispiel #6
0
            public void Activate(IDockContent content)
            {
                if (IsFocusTrackingSuspended)
                {
                    ContentActivating = content;
                    return;
                }
                if (content == null)
                {
                    return;
                }
                DockContentHandler handler = content.DockHandler;

                if (handler.Form.IsDisposed)
                {
                    return;                          // Should not reach here, but better than throwing an exception
                }
                if (ContentContains(content, handler.ActiveWindowHandle))
                {
                    NativeMethods.SetFocus(handler.ActiveWindowHandle);
                }
                if (!handler.Form.ContainsFocus)
                {
                    if (!handler.Form.SelectNextControl(handler.Form.ActiveControl, true, true, true, true))
                    // Since DockContent Form is not selectalbe, use Win32 SetFocus instead
                    // HACK: This isn't working so good.  doesn't matter because we do our own focusing. -NICK
                    {
                    } // if (NativeMethods.ShouldUseWin32()) NativeMethods.SetFocus(handler.Form.Handle);
                }
            }
Beispiel #7
0
            public void Activate(IDockContent content)
            {
                if (IsFocusTrackingSuspended)
                {
                    ContentActivating = content;
                    return;
                }

                if (content == null)
                {
                    return;
                }
                DockContentHandler handler = content.DockHandler;

                if (handler.Form.IsDisposed)
                {
                    return; // Should not reach here, but better than throwing an exception
                }
                if (ContentContains(content, handler.ActiveWindowHandle))
                {
                    NativeMethods.SetFocus(handler.ActiveWindowHandle);
                }
                if (!handler.Form.ContainsFocus)
                {
                    if (!handler.Form.SelectNextControl(handler.Form.ActiveControl, true, true, true, true))
                    {
                        // Since DockContent Form is not selectalbe, use Win32 SetFocus instead
                        NativeMethods.SetFocus(handler.Form.Handle);
                    }
                }
            }
Beispiel #8
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     //Suggested as a fix by bensty regarding form resize
     this.ParentChanged += new EventHandler(DockContent_ParentChanged);
 }
Beispiel #9
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     if (PatchController.EnableFontInheritanceFix != true)
     {
         m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     }
 }
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     this.Font = ProjectAllocationConstant.ProjectAllocationFont;
     //Suggested as a fix by bensty regarding form resize
     //this.ParentChanged += new EventHandler(DockContent_ParentChanged);
 }
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     if (PatchController.EnableFontInheritanceFix != true)
     {
         m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     }
 }
Beispiel #12
0
        public DockContent()
        {
            m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
            m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
            //Suggested as a fix by bensty regarding form resize
            this.ParentChanged += new EventHandler(DockContent_ParentChanged);
            this.ReloadTheme();

            ThemeMgr.Instance.RegisterControl(this);
        }
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     if (PatchController.EnableFontInheritanceFix != true)
     {
         //Suggested as a fix by bensty regarding form resize
         this.ParentChanged += new EventHandler(DockContent_ParentChanged);
     }
 }
Beispiel #14
0
 /// <summary>
 /// Initialize <see cref="DockContent"/> with a predefined ContentId. This will allow more than one windows of same <see cref="Type"/>
 /// </summary>
 /// <param name="contentID"></param>
 public DockContent(string contentID)
 {
     CurrentContentID = -1;
     DockContentID    = contentID;
     m_dockHandler    = new DockContentHandler(this, GetPersistString);
     m_dockHandler.DockStateChanged += DockHandler_DockStateChanged;
     if (PatchController.EnableFontInheritanceFix != true)
     {
         //Suggested as a fix by bensty regarding form resize
         ParentChanged += DockContent_ParentChanged;
     }
 }
            private void AddLastToActiveList(IDockContent content)
            {
                IDockContent last = LastActiveContent;
                if (last == content)
                    return;

                DockContentHandler handler = content.DockHandler;

                if (IsInActiveList(content))
                    RemoveFromActiveList(content);

                handler.PreviousActive = last;
                handler.NextActive = null;
                LastActiveContent = content;
                if (last != null)
                    last.DockHandler.NextActive = LastActiveContent;
            }
            private void AddLastToActiveList(IDockContent content)
            {
                IDockContent last = this.LastActiveContent;

                if (last == content)
                {
                    return;
                }
                DockContentHandler handler = content.DockHandler;

                if (this.IsInActiveList(content))
                {
                    this.RemoveFromActiveList(content);
                }
                handler.PreviousActive = last;
                handler.NextActive     = null;
                this.LastActiveContent = content;
                if (last != null)
                {
                    last.DockHandler.NextActive = this.LastActiveContent;
                }
            }
Beispiel #17
0
            public void Activate(IDockContent content)
            {
                if (IsFocusTrackingSuspended)
                {
                    ContentActivating = content;
                    return;
                }

                DockContentHandler handler = content.DockHandler;

                if (ContentContains(content, handler.ActiveWindowHandle))
                {
                    NativeMethods.SetFocus(handler.ActiveWindowHandle);
                }
                if (!handler.Form.ContainsFocus)
                {
                    if (!handler.Form.SelectNextControl(handler.Form.ActiveControl, true, true, true, true))
                    {
                        // Since DockContent Form is not selectalbe, use Win32 SetFocus instead
                        NativeMethods.SetFocus(handler.Form.Handle);
                    }
                }
            }
Beispiel #18
0
 public DockContent()
 {
     this.m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(this.GetPersistString));
     this.m_dockHandler.DockStateChanged += new EventHandler(this.DockHandler_DockStateChanged);
     base.ParentChanged += new EventHandler(this.DockContent_ParentChanged);
 }
Beispiel #19
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
 }
Beispiel #20
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
 }