View Issue Details

IDProjectCategoryView StatusLast Update
0000758Slicer3GUIpublic2010-08-14 07:35
Reporterlassoan Assigned Topieper  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Summary0000758: Mouse wheel/arrow buttons don't always browse through the image slices
Description

When the a slice viewer has the focus then scrolling sing the mouse wheel or pressing the arrow buttons can be used to browse through the image slices. However, often the slice viewer doesn't have the focus and the user cannot figure it out why the wheel/arrow buttons don't work. (Slicer nightly build Slicer3-3.5-alpha-2010-02-22)

Two cases when the focus shall be explicitly set to the specific slice viewer:

  1. When the user clicks on the slice selector slider. Because it is a natural to use the slider to find approximately the correct slice, then use the mouse wheel to find the exact slice.

  2. When the user switches to a single viewer layout. Because it doesn't make sense to browse the slices of any other viewer than the single one that is displayed.

Clicking inside the image could be used as a workaround, but it is not intuitive and it may have side effects (e.g., when placing fiducials, because then clicking on the image adds a fiducial).

TagsNo tags attached.

Activities

pieper

pieper

2010-02-25 14:30

administrator   ~0001351

This may be outside our control. There is a selection highlight around the window when it has focus if that helps.

lassoan

lassoan

2010-02-25 15:11

manager   ~0001361

Focus is automatically changed when the user clicks in a window. But we can explicitly give the focus to a window.

Either call the focus command with a tk window id:

focus .vtkSlicerWindow3.vtkKWFrame3.vtkKWSplitFrame0.vtkKWFrame4.vtkKWRenderWidget2.vtkKWCoreWidget0

Or call the Focus method of a KWWidget object:

[$::slicer3::ApplicationGUI GetMainSlicerWindow] Focus

pieper

pieper

2010-02-25 15:19

administrator   ~0001362

Hmm, I suppose we could do that after every interaction with the SliceControllerWidget.

I know in the past someone tried a mode where we called focus on ever Enter event, but on windows that caused the window to raise as well, and that was annoying.

lassoan

lassoan

2010-02-26 06:25

manager   ~0001366

Generally the focus handling is OK, only the slice browsing event handling is problematic.

I guess this part of the GUI will be completely reworked during the QT migration, so I would propose not to rework anything just add an explicit focus change in vtkSlicerSliceControllerWidget::ProcessWidgetEvents when the vtkKWScale::ScaleValueStartChangingEvent is received.

I don't think it could cause any issue, as the same method is called whenever the user clicks on the image:
void vtkKWRenderWidget::MouseButtonPressCallback(...)
{
this->VTKWidget->Focus();
...

I've done a very simple implementation to show what I mean (and it actually works for me, but the code has to be cleaned up the "find the sliceGUI for this controller" should be moved to a separate method, pointer checks, comments are needed). See the attached patch file.

2010-02-26 06:26

 

lassoan

lassoan

2010-02-27 08:34

manager   ~0001368

Last edited: 2010-02-27 08:37

Integrated a fix into latest Slicer trunk revision 12261.

Problem 1 (set focus if slice selector slider is clicked) is solved. Problem 2 would have needed many modifications (the focus should have been set whenever the user switches to any a single-view layout or switches between tabs in tabbed slice or 3D view layouts), that is significant effort and limited benefit (fix for problem 1 already eliminates most of the issues, and the KWWidget implementation is being phased out anyway).

The problem can be closed now.

Issue History

Date Modified Username Field Change
2010-02-22 15:33 lassoan New Issue
2010-02-25 14:30 pieper Note Added: 0001351
2010-02-25 14:30 pieper Assigned To => pieper
2010-02-25 14:30 pieper Status new => feedback
2010-02-25 15:11 lassoan Note Added: 0001361
2010-02-25 15:19 pieper Note Added: 0001362
2010-02-26 06:25 lassoan Note Added: 0001366
2010-02-26 06:26 lassoan File Added: SliceBrowsingFocusFix.patch
2010-02-27 08:34 lassoan Note Added: 0001368
2010-02-27 08:35 lassoan Note Edited: 0001368
2010-02-27 08:37 lassoan Note Edited: 0001368
2010-08-14 07:35 pieper Status feedback => closed
2010-08-14 07:35 pieper Resolution open => fixed