Dont support moving with the keyboard inside the view.

Change-Id: I129243ed21a3fb0847d2cb6077f78bf074e515f8
This commit is contained in:
Rafael Dominguez 2012-07-01 19:39:12 -04:30
parent 0c1126ffd7
commit 1fdbf7163a
2 changed files with 0 additions and 126 deletions

View file

@ -256,8 +256,6 @@ protected:
virtual void Tracking( const TrackingEvent& rMEvt );
virtual void KeyInput( const KeyEvent& rKEvt );
virtual void Command( const CommandEvent& rCEvt );
virtual void Paint( const Rectangle& rRect );

View file

@ -656,130 +656,6 @@ void ThumbnailView::Tracking( const TrackingEvent& rTEvt )
ImplTracking( aMousePos, rTEvt.IsTrackingRepeat() );
}
void ThumbnailView::KeyInput( const KeyEvent& rKEvt )
{
size_t nLastItem = mItemList.size();
if ( !nLastItem || !ImplGetFirstItem() )
{
Control::KeyInput( rKEvt );
return;
}
--nLastItem;
const size_t nCurPos = mnSelItemId ? GetItemPos( mnSelItemId ) : 0;
size_t nItemPos = THUMBNAILVIEW_ITEM_NOTFOUND;
size_t nVStep = mnCols;
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_HOME:
nItemPos = 0;
break;
case KEY_END:
nItemPos = nLastItem;
break;
case KEY_LEFT:
if (nCurPos != THUMBNAILVIEW_ITEM_NONEITEM)
{
if (nCurPos)
{
nItemPos = nCurPos-1;
}
}
break;
case KEY_RIGHT:
if (nCurPos < nLastItem)
nItemPos = nCurPos+1;
break;
case KEY_PAGEUP:
if (rKEvt.GetKeyCode().IsShift() || rKEvt.GetKeyCode().IsMod1() || rKEvt.GetKeyCode().IsMod2())
{
Control::KeyInput( rKEvt );
return;
}
nVStep *= mnVisLines;
// intentional fall-through
case KEY_UP:
if (nCurPos != THUMBNAILVIEW_ITEM_NONEITEM)
{
if (nCurPos == nLastItem)
{
const size_t nCol = nLastItem % mnCols;
if (nCol < mnCurCol)
{
// Move to previous row/page, keeping the old column
nVStep -= mnCurCol - nCol;
}
}
if (nCurPos >= nVStep)
{
// Go up of a whole page
nItemPos = nCurPos-nVStep;
}
else if (nCurPos > mnCols)
{
// Go to same column in first row
nItemPos = nCurPos % mnCols;
}
}
break;
case KEY_PAGEDOWN:
if (rKEvt.GetKeyCode().IsShift() || rKEvt.GetKeyCode().IsMod1() || rKEvt.GetKeyCode().IsMod2())
{
Control::KeyInput( rKEvt );
return;
}
nVStep *= mnVisLines;
// intentional fall-through
case KEY_DOWN:
if (nCurPos != nLastItem)
{
if (nCurPos == THUMBNAILVIEW_ITEM_NONEITEM)
{
nItemPos = nVStep-mnCols+mnCurCol;
}
else
{
nItemPos = nCurPos+nVStep;
}
if (nItemPos > nLastItem)
{
nItemPos = nLastItem;
}
}
break;
// intentional fall-through
default:
Control::KeyInput( rKEvt );
return;
}
// This point is reached only if key travelling was used,
// in which case selection mode should be switched off
if ( nItemPos != THUMBNAILVIEW_ITEM_NOTFOUND )
{
if ( nItemPos!=THUMBNAILVIEW_ITEM_NONEITEM && nItemPos<nLastItem )
{
// update current column only in case of a new position
// which is also not a "specially" handled one.
mnCurCol = nItemPos % mnCols;
}
const sal_uInt16 nItemId = (nItemPos != THUMBNAILVIEW_ITEM_NONEITEM) ? GetItemId( nItemPos ) : 0;
if ( nItemId != mnSelItemId )
{
SelectItem( nItemId );
}
}
}
void ThumbnailView::Command( const CommandEvent& rCEvt )
{
if ( (rCEvt.GetCommand() == COMMAND_WHEEL) ||