Exemplo n.º 1
0
        // proper cascade = cascade from top right to bottom left -
        // keep right edge at right margin and bottom edge at bottom margin
        // left edge to left margin max
        internal void RepositionWindows()
        {
            RevitWindow active = null;

            foreach (RevitWindow rw in ChildWindows)
            {
                if (rw.IsActive)
                {
                    active = rw;
                }
                else if (rw.IsCurrDoc || rw.IsNonCurrDoc)
                {
                    SetWindowPos(rw.Handle, HWND.Bottom, rw.Proposed.X, rw.Proposed.Y,
                                 rw.Proposed.Width, rw.Proposed.Height, SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE);
                }
                else if (rw.IsMinimized)
                {
                    SetWindowPos(rw.Handle, HWND.Bottom, rw.Proposed.X, rw.Proposed.Y,
                                 rw.Proposed.Width, rw.Proposed.Height, SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE | SetWindowPosFlags.SWP_NOSIZE);
                }
            }

            SetWindowPos(active.Handle, HWND.Top, active.Proposed.X, active.Proposed.Y,
                         active.Proposed.Width, active.Proposed.Height, SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE);
        }
Exemplo n.º 2
0
        internal static bool GetRevitChildWindows(IntPtr parent)
        {
            RevitWindow.ResetRevitWindows();

            List <IntPtr> children = GetChildWindows(parent);
            IList <View>  views    = GetRevitChildViews(Uidoc);

            bool activeSet = false;

            if (children == null || children.Count == 0)
            {
                return(false);
            }

            string currDoc = Doc.Title.ToLower();

            foreach (IntPtr child in children)
            {
                WINDOWINFO wi = new WINDOWINFO(true);
                GetWindowInfo(child, ref wi);

                if ((wi.dwExStyle & (uint)WinStyleEx.WS_EX_MDICHILD) == 0)
                {
                    continue;
                }

                // got a good window - store it for later
                // create the revit window data
                RevitWindow rw = new RevitWindow(child, NewRectangle(wi.rcWindow), currDoc);

                RevitWindow.ChildWindows.Add(rw);

                // no maximized windows allowed
                if (IsZoomed(child))
                {
                    ShowWindow(child, ShowWinCmds.SW_RESTORE);
                }
            }

            return(true);
        }
Exemplo n.º 3
0
 // 10
 internal static void ListChildIsCurr(RevitWindow rw)
 {
     logMsgln("        is curr doc| " + rw.IsCurrDoc);
 }
Exemplo n.º 4
0
 // 12
 internal static void ListChildIsCurrNonSel(RevitWindow rw)
 {
     logMsgln("    is curr non sel| " + rw.IsCurrDocNonSeleced);
 }
Exemplo n.º 5
0
 // 8
 internal static void ListChildCurrRect(RevitWindow rw)
 {
     logMsgln("       rect current| " + ListRect(rw.Current));
 }
Exemplo n.º 6
0
 // 9
 internal static void ListChildPropRect(RevitWindow rw)
 {
     logMsgln("      rect proposed| " + ListRect(rw.Proposed));
 }
Exemplo n.º 7
0
 // 6
 internal static void ListChildIsMin(RevitWindow rw)
 {
     logMsgln("       is minimized| " + rw.IsMinimized);
 }
Exemplo n.º 8
0
 // 7
 internal static void ListChildIsActive(RevitWindow rw)
 {
     logMsgln("          is active| " + rw.IsActive);
 }
Exemplo n.º 9
0
 // 5
 internal static void ListChildViewType(RevitWindow rw)
 {
     logMsgln("     child ViewType| " + rw.ViewType
              + "  viewtype name| " + (ViewType)rw.ViewType);
 }
Exemplo n.º 10
0
 // 4
 internal static void ListChildWinStatus(RevitWindow rw)
 {
     logMsgln("      window status| " + Enum.GetName(typeof(WindowStatus), rw.WinStatus));
 }
Exemplo n.º 11
0
 // 3
 internal static void ListChildSeq(RevitWindow rw)
 {
     logMsgln("     child sequence| " + rw.Sequence);
 }
Exemplo n.º 12
0
 // 2
 internal static void ListChildHandle(RevitWindow rw)
 {
     logMsgln("       child handle| " + rw.Handle);
 }
Exemplo n.º 13
0
 // 1
 internal static void ListChildTitle(RevitWindow rw)
 {
     logMsgln("        child title| " + rw.WindowTitle);
 }