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); } } }
protected override void OnDragOver(Point pt) { base.OnDragOver(pt); if (hotElement != null) { PInvoke.ScreenToClient(Handle, ref pt); if (!hotElement.FullRect.Contains(pt)) { hotElement = null; } } }
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); } } }
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); } }
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; })); }
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); } }
protected override void OnDragOver(Point pt) { base.OnDragOver(pt); if(hotElement != null) { PInvoke.ScreenToClient(Handle, ref pt); if(!hotElement.FullRect.Contains(pt)) { hotElement = null; } } }
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; }); }