Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Vertical scrollbar non responsive with style activated


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Feb 13, 2018 1:38 PM Last Post By: Russell Ailion
Russell Ailion

Posts: 3
Registered: 10/15/99
Vertical scrollbar non responsive with style activated  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 11, 2018 6:14 PM
I have just begun migrating a D7 app to XE3 and have discovered a problem with vertical scrollbars when styles are activated.

Most of my analysis relates to TDBGrids, but I also have a Tstringgrid with the same issue.

Essentially, the problem is that the scrollbar does not respond to mouse clicks, in fact, double clicking anywhere on the scroll bar (except the up arrow) translates to a double click on the grid. If I manually scroll down thu the records, the up arrow of the scroll bar is the only element that will work.

I have discovered that if I open the dataset between form.onCreate and form.OnShow, the scrollbar works ok. However, if I open the dataset in either of those events, or refresh the data after the form is shown, the scrollbar is broken.

I have also found that if I disable the seBorder style element, the scrollbar works ok.

Any help on this would be appreciated, as the above workarounds are too onerous to be viable.

Thanks.
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Vertical scrollbar non responsive with style activated  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 9:58 AM   in response to: Russell Ailion in response to: Russell Ailion
Russell Ailion wrote:

I have just begun migrating a D7 app to XE3 and have discovered a
problem with vertical scrollbars when styles are activated.

Most of my analysis relates to TDBGrids, but I also have a
Tstringgrid with the same issue.

Essentially, the problem is that the scrollbar does not respond to
mouse clicks, in fact, double clicking anywhere on the scroll bar
(except the up arrow) translates to a double click on the grid. If I
manually scroll down thu the records, the up arrow of the scroll bar
is the only element that will work.

I have discovered that if I open the dataset between form.onCreate
and form.OnShow, the scrollbar works ok. However, if I open the
dataset in either of those events, or refresh the data after the form
is shown, the scrollbar is broken.

I have also found that if I disable the seBorder style element, the
scrollbar works ok.

Any help on this would be appreciated, as the above workarounds are
too onerous to be viable.

Thanks.

XE3 is one of the versions I never used in production. I can only tell
you that I never had a problem with TStringgrid scrollbars in XE2, XE5,
XE7, 10.1 Berlin or 10.2 Tokyo.

Can you reproduce this problem with a simple test application created
in XE3?

--
Peter Below
TeamB
Russell Ailion

Posts: 3
Registered: 10/15/99
Re: Vertical scrollbar non responsive with style activated  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 3:59 PM   in response to: Peter Below in response to: Peter Below
Peter Below wrote:
Russell Ailion wrote:

I have just begun migrating a D7 app to XE3 and have discovered a
problem with vertical scrollbars when styles are activated.

Most of my analysis relates to TDBGrids, but I also have a
Tstringgrid with the same issue.

Essentially, the problem is that the scrollbar does not respond to
mouse clicks, in fact, double clicking anywhere on the scroll bar
(except the up arrow) translates to a double click on the grid. If I
manually scroll down thu the records, the up arrow of the scroll bar
is the only element that will work.

I have discovered that if I open the dataset between form.onCreate
and form.OnShow, the scrollbar works ok. However, if I open the
dataset in either of those events, or refresh the data after the form
is shown, the scrollbar is broken.

I have also found that if I disable the seBorder style element, the
scrollbar works ok.

Any help on this would be appreciated, as the above workarounds are
too onerous to be viable.

Thanks.

XE3 is one of the versions I never used in production. I can only tell
you that I never had a problem with TStringgrid scrollbars in XE2, XE5,
XE7, 10.1 Berlin or 10.2 Tokyo.

Can you reproduce this problem with a simple test application created
in XE3?

--
Peter Below
TeamB

Hi Peter

In the course of putting together a q&d test app, I have found that the problem is not present when I run the app on windows 10. For clarification, I run my dev platform on an XP VM. Does that shed any light on the issue?

Despite that, I have attached a sample which demonstrates the issue with a string grid, but I'm guessing that if you don't have access to XP then maybe it's a little pointless.

Thanks again
Russell.

PS I'm not sure how to attach a file, so here is the form & pas file:

object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 341
ClientWidth = 643
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object gridString: TStringGrid
Left = 0
Top = 0
Width = 643
Height = 341
TabStop = False
Align = alClient
ColCount = 1
Ctl3D = False
DefaultColWidth = 290
FixedCols = 0
RowCount = 1
FixedRows = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goEditing]
ParentCtl3D = False
ScrollBars = ssVertical
TabOrder = 0
RowHeights = (
25)
end
end

unit FScrollBarTest;

interface

uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids;

type
TForm1 = class(TForm)
gridString: TStringGrid;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

const
cDispenseWastageLabels = '5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100';

procedure TForm1.FormShow(Sender: TObject);

procedure SetGridCount(Cols, Rows, ColWidth, FixedCols: Integer);
begin
gridString.RowCount := Rows;
gridString.ColCount := Cols;
gridString.DefaultColWidth := ColWidth;
gridString.FixedCols := FixedCols;
end;

var
i: Integer;
StrList: TStringList;
begin

gridString.FixedRows := 0;
SetGridCount(2, 21, 140, 1);
gridString.Cols[0].CommaText := cDispenseWastageLabels;

end;

end.

Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Vertical scrollbar non responsive with style activated  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 11:17 PM   in response to: Russell Ailion in response to: Russell Ailion
Russell Ailion wrote:

Peter Below wrote:
Russell Ailion wrote:

I have just begun migrating a D7 app to XE3 and have discovered a
problem with vertical scrollbars when styles are activated.

Most of my analysis relates to TDBGrids, but I also have a
Tstringgrid with the same issue.

Essentially, the problem is that the scrollbar does not respond to
mouse clicks, in fact, double clicking anywhere on the scroll bar
(except the up arrow) translates to a double click on the grid.
If I manually scroll down thu the records, the up arrow of the
scroll bar is the only element that will work.

I have discovered that if I open the dataset between form.onCreate
and form.OnShow, the scrollbar works ok. However, if I open the
dataset in either of those events, or refresh the data after the
form is shown, the scrollbar is broken.

I have also found that if I disable the seBorder style element,
the scrollbar works ok.

Any help on this would be appreciated, as the above workarounds
are too onerous to be viable.

Thanks.

XE3 is one of the versions I never used in production. I can only
tell you that I never had a problem with TStringgrid scrollbars in
XE2, XE5, XE7, 10.1 Berlin or 10.2 Tokyo.

Can you reproduce this problem with a simple test application
created in XE3?

--
Peter Below
TeamB

Hi Peter

In the course of putting together a q&d test app, I have found that
the problem is not present when I run the app on windows 10. For
clarification, I run my dev platform on an XP VM. Does that shed any
light on the issue?


XP had no themes yet, and the newer Delphi IDEs are not intended to be
run on such an old OS.

Despite that, I have attached a sample which demonstrates the issue
with a string grid, but I'm guessing that if you don't have access to
XP then maybe it's a little pointless.

Probably. I have WIn10 and the oldest Delphi IDE I have installed here
is XE5. It does not show any problem with your test program.

One thing came to mind, though. The grid controls have gained a new
property named DrawingStyle since D7. This is set to gdsThemed by
default. Try to set it to gdsClassic (this basically reverts to the D7
behaviour) and see whether that has an influence on your problem.


--
Peter Below
TeamB

Russell Ailion

Posts: 3
Registered: 10/15/99
Re: Vertical scrollbar non responsive with style activated  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2018 1:38 PM   in response to: Peter Below in response to: Peter Below
Peter Below wrote:
Russell Ailion wrote:

Peter Below wrote:
Russell Ailion wrote:

I have just begun migrating a D7 app to XE3 and have discovered a
problem with vertical scrollbars when styles are activated.

Most of my analysis relates to TDBGrids, but I also have a
Tstringgrid with the same issue.

Essentially, the problem is that the scrollbar does not respond to
mouse clicks, in fact, double clicking anywhere on the scroll bar
(except the up arrow) translates to a double click on the grid.
If I manually scroll down thu the records, the up arrow of the
scroll bar is the only element that will work.

I have discovered that if I open the dataset between form.onCreate
and form.OnShow, the scrollbar works ok. However, if I open the
dataset in either of those events, or refresh the data after the
form is shown, the scrollbar is broken.

I have also found that if I disable the seBorder style element,
the scrollbar works ok.

Any help on this would be appreciated, as the above workarounds
are too onerous to be viable.

Thanks.

XE3 is one of the versions I never used in production. I can only
tell you that I never had a problem with TStringgrid scrollbars in
XE2, XE5, XE7, 10.1 Berlin or 10.2 Tokyo.

Can you reproduce this problem with a simple test application
created in XE3?

--
Peter Below
TeamB

Hi Peter

In the course of putting together a q&d test app, I have found that
the problem is not present when I run the app on windows 10. For
clarification, I run my dev platform on an XP VM. Does that shed any
light on the issue?


XP had no themes yet, and the newer Delphi IDEs are not intended to be
run on such an old OS.

Despite that, I have attached a sample which demonstrates the issue
with a string grid, but I'm guessing that if you don't have access to
XP then maybe it's a little pointless.

Probably. I have WIn10 and the oldest Delphi IDE I have installed here
is XE5. It does not show any problem with your test program.

One thing came to mind, though. The grid controls have gained a new
property named DrawingStyle since D7. This is set to gdsThemed by
default. Try to set it to gdsClassic (this basically reverts to the D7
behaviour) and see whether that has an influence on your problem.


--
Peter Below
TeamB

No, that didn't help, but now that I know it's only a XP issue, I feel a little better.

Thanks for your input.

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02