Gallery: no SelectionEvent when selection becomes empty [message #592765] |
Wed, 19 November 2008 18:30 |
Justin Dolezy Messages: 68 Registered: July 2009 |
Member |
|
|
Hi,
I noticed that some of my actions weren't getting disabled when the
gallery selection became empty - ie something was selected, then click on
a blank group area, now nothing selected.
Turns out that no SeletionEvent is fired by the Gallery in this situation.
I've made a simple change to onMouseDown() which does the trick for me, to
just call notifySelectionListeners with a null GalleryItem.
void onMouseDown(MouseEvent e) {
if (DEBUG)
System.out.println("Mouse down "); //$NON-NLS-1$
mouseClickHandled = false;
if (!_mouseDown(e)) {
mouseClickHandled = true;
return;
}
GalleryItem item = getItem(new Point(e.x, e.y));
if (e.button == 1) {
if (item == null) {
_deselectAll();
redraw();
mouseClickHandled = true;
lastSingleClick = null;
>>> ADD notifySelectionListeners(null, -1, false) here!!!!!!!
} else {
Regards,
Justin
|
|
|
Powered by
FUDForum. Page generated in 0.02720 seconds