Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
635
Drag and drop location indicator
posted

Hello,

I'm currently adding UltraExplorerBarGroups to an UltraExplorerBar by dragging items from an UltraTree. What I'd like to do is show a drop location indicator in the explorer bar when I'm adding a new item in between existing items. Basically, the same indicator when you drag groups around to rearrage their order. Thanks.

Parents
  • 69832
    Suggested Answer
    Offline posted

    This can be done using either the IUIElementDrawFilter or IUIElementCreationFilter interfaces. The UltraTree samples that ship with the SDK include an UltraTree example of the IUIElementDrawFilter approach, which demonstrates the concept, but it refers to UltraTree rather than UltraExplorerBar.

    To quickly explain how this could be done with a creation filter: There is already a UIElement class (ItemDropHighlightUIElement) that does the drawing, which you could use (to be honest it is a very simple element and using it will not save you a huge amount of time over creating your own). When you implement IUIElementCreationFilter, you would add one of these elements to the ItemAreaInnerUIElement's ChildElements collection. To know where it goes, you would have to track the item closest to the cursor position, which you can use the ItemFromPoint method to do.

Reply Children