예제 #1
0
        public override void HandleShiftKey()
        {
            if (!Config.Tips.ShowPreviewsWithShift)
            {
                HideThumbnailTooltip(5);
            }

            if (Config.Tips.ShowSubDirTips)
            {
                if (Config.Tips.SubDirTipsWithShift)
                {
                    if (MouseIsOverListView())
                    {
                        // HandleShiftKey is called by a Hook callback, which apparently causes
                        // problems with automation.  Use PostMessage to update the SubDirTip later.
                        hotElement = null;
                        PInvoke.PostMessage(Handle, WM_AFTERPAINT, IntPtr.Zero, IntPtr.Zero);
                    }
                }
                else if (!SubDirTipMenuIsShowing())
                {
                    HideSubDirTip(6);
                }
            }
        }
예제 #2
0
 protected override void OnDragOver(Point pt)
 {
     base.OnDragOver(pt);
     if (hotElement != null)
     {
         PInvoke.ScreenToClient(Handle, ref pt);
         if (!hotElement.FullRect.Contains(pt))
         {
             hotElement = null;
         }
     }
 }
예제 #3
0
        public override void HandleShiftKey()
        {
            if(!Config.Tips.ShowPreviewsWithShift) {
                HideThumbnailTooltip(5);
            }

            if(Config.Tips.ShowSubDirTips) {
                if(Config.Tips.SubDirTipsWithShift) {
                    if(MouseIsOverListView()) {
                        // HandleShiftKey is called by a Hook callback, which apparently causes
                        // problems with automation.  Use PostMessage to update the SubDirTip later.
                        hotElement = null;
                        PInvoke.PostMessage(Handle, WM_AFTERPAINT, IntPtr.Zero, IntPtr.Zero);
                    }
                }
                else if(!SubDirTipMenuIsShowing()) {
                    HideSubDirTip(6);
                }
            }
        }
예제 #4
0
        private void RefreshCache()
        {
            int prevItem = hotElement == null ? -1 : hotElement.Index;

            hotElement     = null;
            focusedElement = null;
            if (!IsHotTrackingEnabled())
            {
                return;
            }
            bool hasFocus = HasFocus();
            bool hasMouse = MouseIsOverListView();
            int  nextItem = AutomationManager.DoQuery(factory => {
                AutomationElement elem;
                if (hasFocus)
                {
                    elem = factory.FromKeyboardFocus();
                    if (elem != null)
                    {
                        focusedElement = new CachedListItemElement(elem, this);
                    }
                }
                if (hasMouse)
                {
                    elem = ListItemElementFromPoint(factory, Control.MousePosition);
                    if (elem == null)
                    {
                        return(-1);
                    }
                    hotElement = new CachedListItemElement(elem, this);
                    return(hotElement.Index);
                }
                return(-1);
            });

            if (nextItem != prevItem)
            {
                OnHotItemChanged(nextItem);
            }
        }
예제 #5
0
 public override int HitTest(Point pt, bool ScreenCoords)
 {
     if (hotElement != null)
     {
         Point pt2 = pt;
         if (ScreenCoords)
         {
             PInvoke.ScreenToClient(Handle, ref pt2);
         }
         if (hotElement.FullRect.Contains(pt2))
         {
             return(hotElement.Index);
         }
     }
     if (!ScreenCoords)
     {
         PInvoke.ClientToScreen(Handle, ref pt);
     }
     if (subDirTip != null && subDirTip.IsShowing && subDirTip.Bounds.Contains(pt))
     {
         return(subDirIndex);
     }
     if (PInvoke.WindowFromPoint(pt) != Handle)
     {
         return(-1);
     }
     return(AutomationManager.DoQuery(factory => {
         AutomationElement elem = ListItemElementFromPoint(factory, pt);
         if (elem == null)
         {
             return -1;
         }
         hotElement = new CachedListItemElement(elem, this);
         return hotElement.Index;
     }));
 }
예제 #6
0
 private void RefreshCache() {
     int prevItem = hotElement == null ? -1 : hotElement.Index;
     hotElement = null;
     focusedElement = null;
     if(!IsHotTrackingEnabled()) return;
     bool hasFocus = HasFocus();
     bool hasMouse = MouseIsOverListView();
     int nextItem = AutoMan.DoQuery(factory => {
         AutomationElement elem;
         if(hasFocus) {
             elem = factory.FromKeyboardFocus();
             if(elem != null) {
                 focusedElement = new CachedListItemElement(elem, this);
             }
         }
         if(hasMouse) {
             elem = ListItemElementFromPoint(factory, Control.MousePosition);
             if(elem == null) return -1;
             hotElement = new CachedListItemElement(elem, this);
             return hotElement.Index;
         }
         return -1;
     });
     if(nextItem != prevItem) {
         OnHotItemChanged(nextItem);
     }
 }
예제 #7
0
 protected override void OnDragOver(Point pt) {
     base.OnDragOver(pt);
     if(hotElement != null) {
         PInvoke.ScreenToClient(Handle, ref pt);
         if(!hotElement.FullRect.Contains(pt)) {
             hotElement = null;
         }
     } 
 }
예제 #8
0
 public override int HitTest(Point pt, bool ScreenCoords) {
     if(hotElement != null) {
         Point pt2 = pt;
         if(ScreenCoords) {
             PInvoke.ScreenToClient(Handle, ref pt2);
         }
         if(hotElement.FullRect.Contains(pt2)) {
             return hotElement.Index;
         }
     }
     if(!ScreenCoords) {
         PInvoke.ClientToScreen(Handle, ref pt);
     }
     if(subDirTip != null && subDirTip.IsShowing && subDirTip.Bounds.Contains(pt)) {
         return subDirIndex;
     }
     if(PInvoke.WindowFromPoint(pt) != Handle) {
         return -1;
     }
     return AutoMan.DoQuery(factory => {
         AutomationElement elem = ListItemElementFromPoint(factory, pt);
         if(elem == null) return -1;
         hotElement = new CachedListItemElement(elem, this);
         return hotElement.Index;
     });
 }