Patch for drives toolbar double click

Discuss development issues and submit patches here
Post Reply
ajs
Posts: 409
Joined: Mon Jul 05, 2010 6:37 pm

Patch for drives toolbar double click

Post by ajs »

Patch for drives toolbar double click.

This patch does this:
1) handles a double click on a drives toolbar's button. On double click, the corresponding drive is expanded/collapsed in the treeview (see request here http://www.explorerplusplus.com/forum/v ... 703&p=2070)

2) centralizes the logic of the drive toolbar mouse commands. Before, the left single click was handled in MainWndSwitch.cpp while the middle click was handled in DrivesToolbarHandler.cpp, with some duplication of code. With the patch, all click commands (single left, single middle, and double left) are handled in DrivesToolbarHandler.cpp

Patch against commit 186
Attachments
patch_41__v186.7z
(1.55 KiB) Downloaded 617 times
David Erceg
Site Admin
Posts: 936
Joined: Sat Apr 18, 2009 1:46 am

Re: Patch for drives toolbar double click

Post by David Erceg »

Edit: Ok, looks good to me. The only (fairly minor) issue I have is with the WM_LBUTTONDBLCLK handler in DrivesToolbarHandler.cpp. Looking at the WM_LBUTTONDBLCLK documentation, double clicking sends four messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP. So, the handler becomes pretty inefficient when you double click (the folder will be browsed to on the first WM_LBUTTONUP message, it will be browsed again on the double click message, and the node will be toggled, and then it will be browsed for a third time on the last WM_LBUTTONUP message).

The WM_LBUTTONUP handler will probably have to have some custom logic to stop it browsing the folder multiple times. Aside from that, the rest is good.
David Erceg
Site Admin
Posts: 936
Joined: Sat Apr 18, 2009 1:46 am

Re: Patch for drives toolbar double click

Post by David Erceg »

One other issue is that when the drives are shown via the toolbar chevron (if the toolbar doesn't have enough space to display), selecting a drive no longer works, due to the code moved out of the WM_COMMAND handler. Centralizing the code may still be a good idea, but drive selection will have to be handled within WM_COMMAND.
Post Reply