Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006540 [JEDI VCL] 00 JVCL Components minor always 2016-12-09 14:24 2016-12-28 16:35
Reporter CDametto View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.48
Summary 0006540: Horizontal reset of dbgrid scrollbar by moving a column
Description In a DBGrid with dgRowSelect in Options, TitleButton = True and TitleButtonAllowMove = True, whether the horizontal scrollbar is present and you move a column at the right end, the grid is repositioned to the start left.
Additional Information This is my correction, in the file JvDBGrid.pas near the bottom of the MouseUp procedure...
Original block:

  if (Button = mbLeft) and (FGridState = gsColSizing) then
  begin
    ALeftCol := LeftCol;
    inherited MouseUp(Button, Shift, X, Y);
    if (dgRowSelect in Options) then
      LeftCol := ALeftCol;
    if Assigned(OnColumnResized) then
      OnColumnResized(Self, FSizingIndex + Byte(not (dgIndicator in Options)) - 1,
        ColWidths[FSizingIndex]);
  end
  else
    inherited MouseUp(Button, Shift, X, Y);
  DoAutoSizeColumns;


I just developed the penultimate row:

  if (Button = mbLeft) and (FGridState = gsColSizing) then
  begin
    ALeftCol := LeftCol;
    inherited MouseUp(Button, Shift, X, Y);
    if (dgRowSelect in Options) then
      LeftCol := ALeftCol;
    if Assigned(OnColumnResized) then
      OnColumnResized(Self, FSizingIndex + Byte(not (dgIndicator in Options)) - 1,
        ColWidths[FSizingIndex]);
  end
  else
  begin
    SI.cbSize := SizeOf(SI); //
    SI.fMask := SIF_POS; // Store scrollbar position
    GetScrollInfo(Handle, SB_HORZ, SI); //
    LockWindowUpdate(Handle);
    try
      inherited MouseUp(Button, Shift, X, Y);
      Perform(WM_HSCROLL, MakeWParam(SB_THUMBPOSITION, SI.nPos), 0); //Repos
    finally
      LockWindowUpdate(0);
    end;
  end;
  DoAutoSizeColumns;
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0021407)
CDametto (reporter)
2016-12-28 16:35

The variable SI is declared locally in the procedure as SI: TScrollInfo;

- Issue History
Date Modified Username Field Change
2016-12-09 14:24 CDametto New Issue
2016-12-28 16:35 CDametto Note Added: 0021407


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker