Mouse Wheel Scrolling Issues with VCL Styles

When RowSelect and DisjunctRowSelect is enabled with VCL styles, there is a double line selection when scrolling with mouse wheel.


Traced back to the following code:  

         if FUseVCLStyles then
          begin
            // workaround for VCL style bug where scrollbar does not update
            nr := Row;
            inherited;
            if MouseActions.WheelIncrement > 0 then
              Row := nr;
          end;
 
Inherited call seems to messing it up, also workaround is not needed with DisjunctRowSelect as scroll bar updates as expected.






The only remaining issue is when I scroll with the mouse wheel to the bottom of the grid selection background is removed when you scroll past the bottom or top of grid.  This seems to only happen when DisjunctRowSelect is on, with DisjunctRowSelectNoCtrl it stops at the last or first line of the grid and keeps the selection color






Is this with the latest version of TAdvStringGrid?
I have retested this here but could not see an issue.

Test code applied to a default grid:


procedure TForm1.FormCreate(Sender: TObject);
begin
  advstringgrid1.MouseActions.DisjunctRowSelect := true;
  advstringgrid1.MouseActions.RowSelect:= true;
  // tested with & without
  advstringgrid1.MouseActions.DisjunctRowSelectNoCtrl := true;
  advstringgrid1.RowCount := 500;
  advstringgrid1.RandomFill(false);
  advstringgrid1.SearchFooter.Visible := true;
end;

Here is the dfm of the test form unit I am using, compiled with Luna as default VCL Style and latest AdvGrid.   Left grid has issue with DisjunctRowSelect right with DisjunctRowSelectNoCtrl does not.    If compiled with windows as VCL style the problem is not there.   If I remove the inherited from AdvGrid.pas or wrap it in an if the problem goes away.  
          if FUseVCLStyles then
          begin
            // workaround for VCL style bug where scrollbar does not update
            nr := Row;
            if not(MouseActions.DisjunctRowSelect) then inherited;
            if MouseActions.WheelIncrement > 0 then
              Row := nr;
          end;


TestUnit.dfm:

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 714
  ClientWidth = 1421
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object AdvStringGrid1: TAdvStringGrid
    Left = 24
    Top = 64
    Width = 585
    Height = 353
    Cursor = crDefault
    ColCount = 25
    DoubleBuffered = True
    DrawingStyle = gdsClassic
    FixedCols = 0
    RowCount = 15
    Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goColSizing, goEditing, goRowSelect]
    ParentDoubleBuffered = False
    ScrollBars = ssBoth
    TabOrder = 0
    HoverRowCells = [hcNormal, hcSelected]
    ActiveCellFont.Charset = DEFAULT_CHARSET
    ActiveCellFont.Color = clWindowText
    ActiveCellFont.Height = -11
    ActiveCellFont.Name = 'Tahoma'
    ActiveCellFont.Style = [fsBold]
    ActiveCellColor = 15387318
    Balloon.Enable = True
    Balloon.InitialDelay = 1000
    Balloon.ReshowDelay = 12000
    Balloon.Transparency = 20
    CellNode.TreeColor = clSilver
    ColumnHeaders.Strings = (
      'Col1'
      'Col2'
      'Col3'
      'Col4'
      'Col5'
      'Col6'
      'Col7'
      'Col8'
      'Col9'
      'Col10'
      'Col11'
      'Col12'
      'Col13'
      'Col14'
      'Col15'
      'Col16'
      'Col17'
      'Col18'
      'Col19'
      'Col20'
      'Col21')
    ControlLook.FixedGradientFrom = clWhite
    ControlLook.FixedGradientTo = clBtnFace
    ControlLook.FixedGradientHoverFrom = 13619409
    ControlLook.FixedGradientHoverTo = 12502728
    ControlLook.FixedGradientHoverMirrorFrom = 12502728
    ControlLook.FixedGradientHoverMirrorTo = 11254975
    ControlLook.FixedGradientDownFrom = 8816520
    ControlLook.FixedGradientDownTo = 7568510
    ControlLook.FixedGradientDownMirrorFrom = 7568510
    ControlLook.FixedGradientDownMirrorTo = 6452086
    ControlLook.FixedGradientDownBorder = 14007466
    ControlLook.DropDownHeader.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownHeader.Font.Color = clWindowText
    ControlLook.DropDownHeader.Font.Height = -11
    ControlLook.DropDownHeader.Font.Name = 'Tahoma'
    ControlLook.DropDownHeader.Font.Style = []
    ControlLook.DropDownHeader.Visible = True
    ControlLook.DropDownHeader.Buttons = <>
    ControlLook.DropDownFooter.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownFooter.Font.Color = clWindowText
    ControlLook.DropDownFooter.Font.Height = -11
    ControlLook.DropDownFooter.Font.Name = 'Tahoma'
    ControlLook.DropDownFooter.Font.Style = []
    ControlLook.DropDownFooter.Visible = True
    ControlLook.DropDownFooter.Buttons = <>
    Filter = <>
    FilterDropDown.Font.Charset = DEFAULT_CHARSET
    FilterDropDown.Font.Color = clWindowText
    FilterDropDown.Font.Height = -11
    FilterDropDown.Font.Name = 'Tahoma'
    FilterDropDown.Font.Style = []
    FilterDropDownClear = '(All)'
    FilterEdit.TypeNames.Strings = (
      'Starts with'
      'Ends with'
      'Contains'
      'Not contains'
      'Equal'
      'Not equal'
      'Larger than'
      'Smaller than'
      'Clear')
    FixedColWidth = 34
    FixedRowHeight = 35
    FixedRowAlways = True
    FixedFont.Charset = DEFAULT_CHARSET
    FixedFont.Color = clBlack
    FixedFont.Height = -11
    FixedFont.Name = 'Tahoma'
    FixedFont.Style = [fsBold]
    FloatFormat = '%.2f'
    Grouping.HeaderColor = 14059353
    Grouping.HeaderColorTo = 9648131
    Grouping.HeaderTextColor = clWhite
    Grouping.SummaryColor = 16440004
    Grouping.SummaryColorTo = 16105376
    HoverButtons.Buttons = <>
    HoverButtons.Position = hbLeftFromColumnLeft
    HTMLSettings.ImageFolder = 'images'
    HTMLSettings.ImageBaseName = 'img'
    MouseActions.DisjunctRowSelect = True
    MouseActions.RowSelect = True
    MouseActions.WheelIncrement = 1
    Navigation.AdvanceAutoEdit = False
    Navigation.CursorWalkAlwaysEdit = False
    Navigation.KeepHorizScroll = True
    PrintSettings.DateFormat = 'dd/mm/yyyy'
    PrintSettings.Font.Charset = DEFAULT_CHARSET
    PrintSettings.Font.Color = clWindowText
    PrintSettings.Font.Height = -11
    PrintSettings.Font.Name = 'MS Sans Serif'
    PrintSettings.Font.Style = []
    PrintSettings.FixedFont.Charset = DEFAULT_CHARSET
    PrintSettings.FixedFont.Color = clWindowText
    PrintSettings.FixedFont.Height = -11
    PrintSettings.FixedFont.Name = 'MS Sans Serif'
    PrintSettings.FixedFont.Style = []
    PrintSettings.HeaderFont.Charset = DEFAULT_CHARSET
    PrintSettings.HeaderFont.Color = clWindowText
    PrintSettings.HeaderFont.Height = -11
    PrintSettings.HeaderFont.Name = 'MS Sans Serif'
    PrintSettings.HeaderFont.Style = []
    PrintSettings.FooterFont.Charset = DEFAULT_CHARSET
    PrintSettings.FooterFont.Color = clWindowText
    PrintSettings.FooterFont.Height = -11
    PrintSettings.FooterFont.Name = 'MS Sans Serif'
    PrintSettings.FooterFont.Style = []
    PrintSettings.PageNumSep = '/'
    SearchFooter.ColorTo = 15790320
    SearchFooter.FindNextCaption = 'Find next'
    SearchFooter.FindPrevCaption = 'Find previous'
    SearchFooter.Font.Charset = DEFAULT_CHARSET
    SearchFooter.Font.Color = clWindowText
    SearchFooter.Font.Height = -11
    SearchFooter.Font.Name = 'MS Sans Serif'
    SearchFooter.Font.Style = []
    SearchFooter.HighLightCaption = 'Highlight'
    SearchFooter.HintClose = 'Close'
    SearchFooter.HintFindNext = 'Find next occurence'
    SearchFooter.HintFindPrev = 'Find previous occurence'
    SearchFooter.HintHighlight = 'Highlight occurences'
    SearchFooter.MatchCaseCaption = 'Match case'
    SearchFooter.ResultFormat = '(%d of %d)'
    SearchFooter.SearchColumn = 2
    SearchFooter.ShowClose = False
    SearchFooter.ShowHighLight = False
    SearchFooter.ShowMatchCase = False
    SearchFooter.Visible = True
    SelectionRectangle = True
    SortSettings.DefaultFormat = ssAutomatic
    SortSettings.Show = True
    SortSettings.Full = False
    SortSettings.HeaderColorTo = 16579058
    SortSettings.HeaderMirrorColor = 16380385
    SortSettings.HeaderMirrorColorTo = 16182488
    Version = '8.4.0.3'
    ColWidths = (
      34
      231
      75
      81
      107
      39
      80
      113
      101
      69
      68
      110
      98
      80
      75
      78
      71
      64
      64
      64
      64
      64
      64
      64
      64)
    RowHeights = (
      35
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22)
  end
  object AdvStringGrid2: TAdvStringGrid
    Left = 672
    Top = 64
    Width = 529
    Height = 353
    Cursor = crDefault
    ColCount = 25
    DoubleBuffered = True
    DrawingStyle = gdsClassic
    RowCount = 25
    Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSelect]
    ParentDoubleBuffered = False
    ScrollBars = ssBoth
    TabOrder = 1
    HoverRowCells = [hcNormal, hcSelected]
    ActiveCellFont.Charset = DEFAULT_CHARSET
    ActiveCellFont.Color = clWindowText
    ActiveCellFont.Height = -11
    ActiveCellFont.Name = 'Tahoma'
    ActiveCellFont.Style = [fsBold]
    Balloon.Enable = True
    Balloon.InitialDelay = 1000
    Balloon.ReshowDelay = 12000
    Balloon.Transparency = 20
    ColumnHeaders.Strings = (
      'Col1'
      'Col2'
      'Col3'
      'Col4'
      'Col5'
      'Col6'
      'Col7'
      'Col8'
      'Col9'
      'Col10'
      'Col11'
      'Col12'
      'Col13'
      'Col14'
      'Col15'
      'Col16'
      'Col17'
      'Col18'
      'Col19'
      'Col20'
      'Col21'
      '')
    ControlLook.FixedGradientHoverFrom = clGray
    ControlLook.FixedGradientHoverTo = clWhite
    ControlLook.FixedGradientDownFrom = clGray
    ControlLook.FixedGradientDownTo = clSilver
    ControlLook.DropDownHeader.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownHeader.Font.Color = clWindowText
    ControlLook.DropDownHeader.Font.Height = -11
    ControlLook.DropDownHeader.Font.Name = 'Tahoma'
    ControlLook.DropDownHeader.Font.Style = []
    ControlLook.DropDownHeader.Visible = True
    ControlLook.DropDownHeader.Buttons = <>
    ControlLook.DropDownFooter.Font.Charset = DEFAULT_CHARSET
    ControlLook.DropDownFooter.Font.Color = clWindowText
    ControlLook.DropDownFooter.Font.Height = -11
    ControlLook.DropDownFooter.Font.Name = 'Tahoma'
    ControlLook.DropDownFooter.Font.Style = []
    ControlLook.DropDownFooter.Visible = True
    ControlLook.DropDownFooter.Buttons = <>
    Filter = <>
    FilterDropDown.Font.Charset = DEFAULT_CHARSET
    FilterDropDown.Font.Color = clWindowText
    FilterDropDown.Font.Height = -11
    FilterDropDown.Font.Name = 'Tahoma'
    FilterDropDown.Font.Style = []
    FilterDropDown.TextChecked = 'Checked'
    FilterDropDown.TextUnChecked = 'Unchecked'
    FilterDropDownClear = '(All)'
    FilterEdit.TypeNames.Strings = (
      'Starts with'
      'Ends with'
      'Contains'
      'Not contains'
      'Equal'
      'Not equal'
      'Larger than'
      'Smaller than'
      'Clear')
    FixedRowHeight = 35
    FixedRowAlways = True
    FixedFont.Charset = DEFAULT_CHARSET
    FixedFont.Color = clWindowText
    FixedFont.Height = -11
    FixedFont.Name = 'Tahoma'
    FixedFont.Style = [fsBold]
    FloatFormat = '%.2f'
    HoverButtons.Buttons = <>
    HoverButtons.Position = hbLeftFromColumnLeft
    HTMLSettings.ImageFolder = 'images'
    HTMLSettings.ImageBaseName = 'img'
    MouseActions.DisjunctRowSelectNoCtrl = True
    MouseActions.RowSelect = True
    MouseActions.WheelIncrement = 1
    PrintSettings.DateFormat = 'dd/mm/yyyy'
    PrintSettings.Font.Charset = DEFAULT_CHARSET
    PrintSettings.Font.Color = clWindowText
    PrintSettings.Font.Height = -11
    PrintSettings.Font.Name = 'Tahoma'
    PrintSettings.Font.Style = []
    PrintSettings.FixedFont.Charset = DEFAULT_CHARSET
    PrintSettings.FixedFont.Color = clWindowText
    PrintSettings.FixedFont.Height = -11
    PrintSettings.FixedFont.Name = 'Tahoma'
    PrintSettings.FixedFont.Style = []
    PrintSettings.HeaderFont.Charset = DEFAULT_CHARSET
    PrintSettings.HeaderFont.Color = clWindowText
    PrintSettings.HeaderFont.Height = -11
    PrintSettings.HeaderFont.Name = 'Tahoma'
    PrintSettings.HeaderFont.Style = []
    PrintSettings.FooterFont.Charset = DEFAULT_CHARSET
    PrintSettings.FooterFont.Color = clWindowText
    PrintSettings.FooterFont.Height = -11
    PrintSettings.FooterFont.Name = 'Tahoma'
    PrintSettings.FooterFont.Style = []
    PrintSettings.PageNumSep = '/'
    SearchFooter.FindNextCaption = 'Find &next'
    SearchFooter.FindPrevCaption = 'Find &previous'
    SearchFooter.Font.Charset = DEFAULT_CHARSET
    SearchFooter.Font.Color = clWindowText
    SearchFooter.Font.Height = -11
    SearchFooter.Font.Name = 'Tahoma'
    SearchFooter.Font.Style = []
    SearchFooter.HighLightCaption = 'Highlight'
    SearchFooter.HintClose = 'Close'
    SearchFooter.HintFindNext = 'Find next occurrence'
    SearchFooter.HintFindPrev = 'Find previous occurrence'
    SearchFooter.HintHighlight = 'Highlight occurrences'
    SearchFooter.MatchCaseCaption = 'Match case'
    SearchFooter.ResultFormat = '(%d of %d)'
    SearchFooter.Visible = True
    SelectionRectangle = True
    SortSettings.DefaultFormat = ssAutomatic
    Version = '8.4.0.3'
    ColWidths = (
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64
      64)
    RowHeights = (
      35
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22
      22)
  end
end



This was a fix needed for an issue in older Delphi versions with VCL styles.
In newer Delphi versions, this appears no longer needed and as such we removed it. The next update will handle this.

Great.   Thank you.