suggestion and solution for filmstrip view (1 Viewer)

nickola

Portal Member
January 30, 2008
15
2
Saint Etienne
Home Country
France France
suggestion for filmstrip view

--------------------------------------------------------------------------------

How to make selected thumb fixed in Filmstrip view?

Solution tested :

Add <scrollOffset>1</scrollOffset> on skin xml files and make this change on GUIFilmstripControl.cs

Add-------------------------------------------------------------------------------------------------

[XMLSkinElement("scrollOffset")] protected int _scrollStartOffset = 1;

Modify-------------------------------------------------------------------------------------------------

void OnRight()
{
Action action = new Action();
action.wID = Action.ActionType.ACTION_MOVE_RIGHT;
if (_listType == GUIListControl.ListType.CONTROL_LIST)
{
if (_scrollingRight)
{
_scrollingRight = false;
_offset++;
int iPage = _offset / (_columns);
if ((_offset % (_columns)) != 0) iPage++;
if (_upDownControl != null) _upDownControl.Value = iPage + 1;
}

if (_cursorX + 1 + _scrollStartOffset == _columns)
{
_offset++;
if (!ValidItem(_cursorX))
{
_offset--;
}
else if ((_scrollStartOffset !=0) && (!ValidItem(_cursorX + _scrollStartOffset)))
{
{
_offset--;
_cursorX++;
}
OnSelectionChanged();
}
else
{
_offset--;
_scrollCounter = _itemWidth;
_scrollingRight = true;
}

OnSelectionChanged();
return;
}
else
{
if (ValidItem(_cursorX + 1))
{
_cursorX++;
}
OnSelectionChanged();
}
}
else if (_upDownControl != null)
{
if (_upDownControl.SelectedButton == GUISpinControl.SpinSelect.SPIN_BUTTON_UP)
{
_upDownControl.Focus = false;
_listType = GUIListControl.ListType.CONTROL_LIST;
this.Focus = true;
}
else
{
_upDownControl.OnAction(action);
if (!_upDownControl.Focus)
{
base.OnAction(action);
}
}
OnSelectionChanged();
}
}

Modify-------------------------------------------------------------------------------------------------

void OnLeft()
{
Action action = new Action();
action.wID = Action.ActionType.ACTION_MOVE_LEFT;
if (_listType == GUIListControl.ListType.CONTROL_LIST)
{
if (_scrollingLeft)
{
_scrollCounter = 0;
_scrollingLeft = false;
_offset--;
int iPage = _offset / (_columns);
if ((_offset % (_columns)) != 0) iPage++;
if (_upDownControl != null) _upDownControl.Value = iPage + 1;
}

if (_cursorX > _scrollStartOffset)
{
_cursorX--;
}
else if (_cursorX > 0 && _cursorX <= _scrollStartOffset && _offset == 0)
{
_cursorX--;
}
else if (_cursorX == _scrollStartOffset && _offset != 0)
{
_scrollCounter = _itemWidth;
_scrollingLeft = true;
}
else
{
base.OnAction(action);
}
OnSelectionChanged();
}
else if (_upDownControl != null)
{
if (_upDownControl.SelectedButton == GUISpinControl.SpinSelect.SPIN_BUTTON_DOWN)
{
_upDownControl.Focus = false;
_listType = GUIListControl.ListType.CONTROL_LIST;
this.Focus = true;
}
else
{
_upDownControl.OnAction(action);
}
if (!_upDownControl.Focus)
{
_listType = GUIListControl.ListType.CONTROL_LIST;
}
OnSelectionChanged();
}
}

------------------------------------------------------------------------------------------

thanks

Nickola
 

Users who are viewing this thread

Top Bottom