Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] LA floating panels - option to make not always on top of the main window
#1
#34
I've set the Recipe panel as a floating panel, but it always stays on top. Is there a way to unpin it?
#2
Code:
Copy      Help
// script "LA floating panel make unowned.cs"
LA.FloatingPanelMakeUnowned("Recipe");
//LA.FloatingPanelMakeUnowned("*"); //all

static class LA {
    /// <summary>
    ///
Finds a LA floating panel and makes it not owned by the main LA window.
    /// </summary>
    ///
<param name="name">Panel name. Or <c>"*"</c> for "all panels".</param>
    ///
<remarks>
    ///
Then the panel is not always on top of the main LA window. It is visible when the main window is minimized. It can be maximized and minimized, and has a taskbar button.
    /// </remarks>
    public static void FloatingPanelMakeUnowned(string name) {
        foreach (var w in wnd.findAll("Au.Editor - " + name, "HwndWrapper[Au.Editor;*", default, WFlags.CloakedToo, also: o => o.HasExStyle(WSE.TOOLWINDOW) && !o.HasStyle(WS.CAPTION))) {
            FloatingPanelMakeUnowned(w);
        }
    }

    
    /// <summary>
    ///
Makes a LA floating panel not owned by the main LA window.
    /// </summary>
    ///
<param name="w">Floating panel window.</param>
    public static void FloatingPanelMakeUnowned(wnd w) {
        WndUtil.SetOwnerWindow(w, default);
        w.SetExStyle(WSE.TOOLWINDOW, WSFlags.Remove);
        w.SetStyle(WS.CAPTION | WS.MAXIMIZEBOX | WS.MINIMIZEBOX | WS.SYSMENU, WSFlags.Add | WSFlags.UpdateNonclient);
        api.EnableMenuItem(api.GetSystemMenu(w, false), api.SC_CLOSE, api.MF_GRAYED);
        w.TaskbarButton.Add();
    }

    
    unsafe class api : NativeApi {
        [
DllImport("user32.dll")]
        internal static extern IntPtr GetSystemMenu(wnd hWnd, bool bRevert);
        
        [
DllImport("user32.dll")]
        internal static extern bool EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);
        
        internal const uint SC_CLOSE = 0xF060;
        
        internal const uint MF_GRAYED = 0x1;
    }
}
#3
Thank you.
It would be better if this feature could be added to the right-click menu.
https://i.ibb.co/qYRzRD7/pic.png
#4
In new LA this option is in the context menu of all panels. Right-click caption.


Forum Jump:


Users browsing this thread: 1 Guest(s)