[fixed] Page scroll in EPG (1 Viewer)

elliottmc

Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    So, in order to keep track, I am now trying

    Code:
        private void OnPageUp()
        {
          int Steps;
          if (_singleChannelView)
          {
            Steps = _channelCount; // all available rows
          }
          else
          {
            if (_guideContinuousScroll)
            {
              Steps = _channelCount; // all available rows
            }
            else
            {
              // If we're on the first channel in the guide then allow one step to get back to the end of the guide.
              if (_channelOffset == 0 && _cursorX == 0)
              {
                Steps = 1;
              }
              else
              {
                // only number of additional avail channels
                Steps = Math.Min(_channelOffset + _cursorX, _channelCount);
              }
            }
          }
          UnFocus();
          for (int i = 0; i < Steps; ++i)
          {
            OnUp(false, true);
          }
          Correct();
          Update(false);
          SetFocus();
          if (_singleChannelView) UpdateCurrentProgram();
          SetProperties();
        }
    
        private void OnPageDown()
        {
          int Steps;
          if (_singleChannelView)
            Steps = _channelCount; // all available rows
          else
          {
            if (_guideContinuousScroll)
            {
              Steps = _channelCount; // all available rows
            }
            else
            {
              // If we're on the last channel in the guide then allow one step to get back to top of guide.
              if (_channelOffset + (_cursorX + 1) == _channelList.Count)
              {
                Steps = 1;
              }
              else
              {
                // only number of additional avail channels
                Steps = Math.Min(_channelList.Count - _channelOffset - _cursorX - 1, _channelCount);
              }
            }
          }
    
          UnFocus();
          for (int i = 0; i < Steps; ++i)
          {
            OnDown(false);
          }
          Correct();
          Update(false);
          SetFocus();
          if (_singleChannelView) UpdateCurrentProgram();
          SetProperties();
        }

    A relatively quick test shows that this seems fine. I guess I need someone with more expertise to comment on whether the UpdateCurrentProgram(); and SetProperties(); are needed here or not.

    Mark
     

    Users who are viewing this thread

    Top Bottom