Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DblClick FloatWindow caption shown disabled close button #75

Closed
vinogradniy opened this issue Nov 7, 2012 · 5 comments
Closed

DblClick FloatWindow caption shown disabled close button #75

vinogradniy opened this issue Nov 7, 2012 · 5 comments

Comments

@vinogradniy
Copy link

2.5.1RC1.

DockContent (CloseButton = false, CloseButtonVisible = false)

When I dblclick FloatWindow caption, floating form show and hide disabled close button. In some case click on this button close form.

@roken
Copy link
Member

roken commented Nov 7, 2012

Have you tried upgrading to the latest version? Version 2.5 is two years old and the upgrade should be seamless.

I'm also afraid the description of your issue isn't very clear.

@vinogradniy
Copy link
Author

Close button glimpse when dblclick onto float window caption and if in this time was clicked at close button floating windows hide with their content. I expect that DockContent restore their position into panel.

@vinogradniy
Copy link
Author

Have you tried upgrading to the latest version? Version 2.5 is two years old and the upgrade should be seamless.

Memory leaks prevent to migrate. I use patched version. When dispose visible DockContent from DockPanel. DockPanel holding disposed DockContent and prevent its GC. See my comment: #74 (comment)

@vinogradniy
Copy link
Author

Patch for remove close button glimps for 2.5.1RC1 (this applied also for current version)

Index: tags/Release_2.5_RC1/WinFormsUI/Docking/FloatWindow.cs
===================================================================
--- tags/Release_2.5_RC1/WinFormsUI/Docking/FloatWindow.cs  (revision 115)
+++ tags/Release_2.5_RC1/WinFormsUI/Docking/FloatWindow.cs  (working copy)
@@ -131,18 +131,17 @@
                    content.OnDeactivate(e);
        }

-       protected override void OnLayout(LayoutEventArgs levent)
-       {
-           VisibleNestedPanes.Refresh();
-           RefreshChanges();
-            Visible = (VisibleNestedPanes.Count > 0);
-            SetText();
+    protected override void OnLayout(LayoutEventArgs levent)
+    {
+      VisibleNestedPanes.Refresh();
+      RefreshChanges();
+      SetText();

-           base.OnLayout(levent);
-       }
+      base.OnLayout(levent);
+    }


-        [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)")]
+     [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)")]
         internal void SetText()
        {
            DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
@@ -173,7 +172,7 @@
        {
            if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDOWN)
            {
-               if (IsDisposed)
+               if (Disposing || IsDisposed)
                    return;

                uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
@@ -268,14 +267,12 @@

        internal void RefreshChanges()
        {
-            if (IsDisposed)
-                return;
+      if (Disposing || IsDisposed)
+      {
+        return;
+      }

-           if (VisibleNestedPanes.Count == 0)
-           {
-               ControlBox = true;
-               return;
-           }
+      Visible = (VisibleNestedPanes.Count > 0);

            for (int i=VisibleNestedPanes.Count - 1; i>=0; i--)
            {
@@ -295,7 +292,7 @@
            }
            //Only if there is a ControlBox do we turn it off
            //old code caused a flash of the window.
-            if (ControlBox)
+      if (ControlBox)
                ControlBox = false;
        }

@roken
Copy link
Member

roken commented Mar 11, 2013

The issue here still is not clear and a change to manipulate the Visibility of the FloatWindow doesn't really make sense here.

Closing this issue, please repost if you continue to experience trouble with the current release.

@roken roken closed this as completed Mar 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants