Inheritance: IDisposable, IDockDragSource
コード例 #1
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;
 }
コード例 #2
0
        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;
        }
コード例 #3
0
ファイル: DockContent.cs プロジェクト: ywscr/ynoteclassic
 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;
 }
コード例 #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]);
                }
            }
コード例 #5
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);
 }
コード例 #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);
                }
            }
コード例 #7
0
ファイル: DockPanel.FocusManager.cs プロジェクト: jakedw7/iAM
            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);
                    }
                }
            }
コード例 #8
0
ファイル: DockContent.cs プロジェクト: thijse/dockpanelsuite
 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);
 }
コード例 #9
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     if (PatchController.EnableFontInheritanceFix != true)
     {
         m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     }
 }
コード例 #10
0
 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);
 }
コード例 #11
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     if (PatchController.EnableFontInheritanceFix != true)
     {
         m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
     }
 }
コード例 #12
0
ファイル: DockContent.cs プロジェクト: armano2/dockpanelsuite
        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);
        }
コード例 #13
0
 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);
     }
 }
コード例 #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;
     }
 }
コード例 #15
0
            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;
            }
コード例 #16
0
            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;
                }
            }
コード例 #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);
                    }
                }
            }
コード例 #18
0
ファイル: BaseForm.cs プロジェクト: SoMeTech/hnbthelper
 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);
 }
コード例 #19
0
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
 }
コード例 #20
0
ファイル: DockContent.cs プロジェクト: xeronith/flashdevelop
 public DockContent()
 {
     m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
     m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
 }