Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: CListControlComplete auto scroll (Read 1137 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

CListControlComplete auto scroll

It works fine if I get QueryDragDropTypes to return dragDrop_reorder only. Combining with dragDrop_external breaks internal reordering.

If possible, I'd like to get both working. I guess it means overriding some methods myself but I'm stuck.  ;D

For completeness, I'm deriving from CListControlComplete and I have the actual reordering / inserting external items working fine, it's just the scroll I'm struggling with.

Code: [Select]
class QueueList : public CListControlComplete
{
public:
dragDropAccept_t DragDropAccept2(IDataObject* obj) final
{
dragDropAccept_t accept;

metadb_handle_list handles;
if (get_dd_handles(obj, handles))
{
accept.dwEFfect = DROPEFFECT_COPY;
accept.showDropMark = true;
}

return accept;
}

uint32_t QueryDragDropTypes() const final
{
return dragDrop_reorder | dragDrop_external;
}

void OnDrop(IDataObject* obj, CPoint pt) final
{
this->ScreenToClient(&pt);
const size_t idx = InsertIndexFromPoint(pt);
if (idx == SIZE_MAX) return;

// do stuff
}

void RequestReorder(const size_t* order, size_t count) final
{
// do stuff
}
};



Re: CListControlComplete auto scroll

Reply #1
Well I got there in the end. I had to rip out copies of CDropSourceImpl / CDropTargetImpl and make some minor changes. I then had to override RunDragDrop and wrap the DoDragDrop call with ToggleDDScroll. I also had to bypass the default OnCreatePassthru with my own copy that could make use of ToggleDDScroll as well.

It might be nicer in future if dragDropAccept_t had an additional auto-scroll option then it could have been done without so much copy/pasting.  :P


Re: CListControlComplete auto scroll

Reply #2
Fixed for the next SDK, thanks for pointing out.
Microsoft Windows: We can't script here, this is bat country.

Re: CListControlComplete auto scroll

Reply #3
... new SDK with the fix released.
Microsoft Windows: We can't script here, this is bat country.