Ctrl+A to select all items in list views

Bug #203763 reported by poy
10
Affects Status Importance Assigned to Milestone
DC++
Fix Released
Low
Unassigned

Bug Description

Ctrl+A doesn't select all items in list views currently (DC++ 0.705).

Revision history for this message
poy (poy) wrote :

this patch adds a WidgetListView in win32/ to sub-class all list views.
i tried the usual way (handle onKeyDown) but this wasn't working in frames that already capture that event to handle their own key presses; so i used the tryFire function which is called from smartwin/Policies.h.

added files:
win32/WidgetListView.h
win32/WidgetListView.cpp

description: updated
Revision history for this message
Jacek Sieka (arnetheduck) wrote :

Hm, that sounds like a bug with the capturing - if the frame captures the keypress but doesn't do anything, it should pass it on to the next handler...also, if the list has focus, it should receive the key press first, no?

Changed in dcplusplus:
status: New → Confirmed
Changed in dcplusplus:
importance: Undecided → Low
Revision history for this message
poy (poy) wrote :

the patch was done before multiple callbacks were possible, which is why simply using an event handler didn't work (the list used setCallback to set its key-down event, and then the frame made another setCallback call to handle its own keys).
now that onKeyDown uses addCallback instead of setCallback, it works fine. :)

added files:
win32/Table.h
win32/Table.cpp

Revision history for this message
Jacek Sieka (arnetheduck) wrote :

Hm, I'm slightly concerned by this patch - there's the problem of return value and which event gets called first...and what happens if more than one event wants to handle ctrl-a...? bah, this is more of an architectural issue - any good ideas? I considered splitting the events into pure listeners which don't affect return value and at most one control-listener which determines what to return (and if defwindowproc should be called)....

Revision history for this message
poy (poy) wrote :

what happens if 2 events want to handle the same message is in the Widget::tryFire function: both events are called, and if at least one of them handles the message, the message is considered handled. good enough imo, better than having to call ::DefWindowProc in the beginning or the end of the event handler (which is often seen in other libraries...).
if both key-down events want to handle the same key, then they'll both get called separately and each will do what it has to do.

Revision history for this message
Jacek Sieka (arnetheduck) wrote :

since we already have accelerator problems in other areas of the app, I think we should add a proper accelerator handling mechanism to dwt and then implement this using that mechanism...that would sort of solve the key event listener bit as well in this case...

Changed in dcplusplus:
status: Confirmed → Fix Committed
MikeJJ (mrmikejj)
Changed in dcplusplus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.