ScrollDataInfo method

void ScrollDataInfo(
  1. int DX,
  2. int DY,
  3. TGridDrawInfo DrawInfo
)

Implementation

void ScrollDataInfo(int DX, int DY, TGridDrawInfo DrawInfo)
{

  TRect ScrollArea;
  // Scroll the area
  if(DY == 0)
  {
    // Scroll both the column titles and data area at the same time
    if(!UseRightToLeftAlignment())
      ScrollArea = TRect(DrawInfo.Horz.FixedBoundary, 0, DrawInfo.Horz.GridExtent, DrawInfo.Vert.GridExtent);
    else
    {
      ScrollArea = TRect(ClientWidth - DrawInfo.Horz.GridExtent, 0, ClientWidth - DrawInfo.Horz.FixedBoundary, DrawInfo.Vert.GridExtent);
      DX = -DX;
    }
    ConstrainGrid(); // new
    // ScrollWindowEx(Handle, DX, 0, @ScrollArea, @ScrollArea, 0, nil, ScrollFlags);
  }
  else
  if(DX == 0)
  {
    // Scroll both the row titles and data area at the same time
    ScrollArea = TRect(0, DrawInfo.Vert.FixedBoundary, DrawInfo.Horz.GridExtent, DrawInfo.Vert.GridExtent);
    // ScrollWindowEx(Handle, 0, DY, @ScrollArea, @ScrollArea, 0, nil, ScrollFlags);
  }
  else
  {
    // Scroll titles and data area separately
    // Column titles
    ScrollArea = TRect(DrawInfo.Horz.FixedBoundary, 0, DrawInfo.Horz.GridExtent, DrawInfo.Vert.FixedBoundary);
    // ScrollWindowEx(Handle, DX, 0, @ScrollArea, @ScrollArea, 0, nil, ScrollFlags);
    // Row titles
    ScrollArea = TRect(0, DrawInfo.Vert.FixedBoundary, DrawInfo.Horz.FixedBoundary, DrawInfo.Vert.GridExtent);
    // ScrollWindowEx(Handle, 0, DY, @ScrollArea, @ScrollArea, 0, nil, ScrollFlags);
    // Data area
    ScrollArea = TRect(DrawInfo.Horz.FixedBoundary, DrawInfo.Vert.FixedBoundary, DrawInfo.Horz.GridExtent, DrawInfo.Vert.GridExtent);
    //ScrollWindowEx(Handle, DX, DY, @ScrollArea, @ScrollArea, 0, nil, ScrollFlags);
  }

  if(Options.contains(GridOptions.RowSelect))
    InvalidateRect(Selection);
}