Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High DPI Inheritance of Form #606

Closed
PetrDaricek opened this issue Feb 16, 2016 · 1 comment
Closed

High DPI Inheritance of Form #606

PetrDaricek opened this issue Feb 16, 2016 · 1 comment
Assignees
Labels
Bug Pull Requests Invited There are no current plans to address the issue, but we would be happy if someone supplies a PR.

Comments

@PetrDaricek
Copy link

Hello,
I created FormAncestor and place on it VirtualTree component. Second I Created FormChild, it is inherited from FormAncestor. I Modified some properties of VirtualTree (I don't know if this step is required). All I develop on Windows 7 with standard 96DPI.
When I run this program on Windows 8.1. with 192 DPI (200%) header and rows are to big. I searched why and I recognize this algorithms:

  1. When loading FormAncestor DFM, then from TCustomForm.ReadState(Reader: TReader) method is called ScaleControls - > VirtualTree.ChangeScale -> VirtualHeader.ChangeScale. Height of Header has been changed too 19(Default) * 2 (192/96 DPI).
  2. When loading FormChild DFM, then from TCustomForm.ReadState(Reader: TReader) method is called ScaleControls - > VirtualTree.ChangeScale -> VirtualHeader.ChangeScale again. Heigh of Header has been changed too** 38 * 2 (192/96 DPI).**

So Header is more bigger than should be.
I see in VCL units are flags to Rescale and rescale is performed only when this flag is set. For example, when I Load from dfm with of TButton, than in SetWidth method is set rescale flag to witdh. In TButton.ChangeScale is change with only if this flag is set, and on end of changescale is Flags unset.
This mechanism ensures that the calling of Cahgnscale on with is only once.

I think it is bug in Virtual Tree.
I tested it on Delphi 10 Seatle with Subscription Update 1, Windows 7 64b (96DPI), and Windows 8.1 64b (192 DPI).

@joachimmarder joachimmarder added Bug Pull Requests Invited There are no current plans to address the issue, but we would be happy if someone supplies a PR. labels Feb 16, 2016
@joachimmarder
Copy link
Contributor

I agree, this sounds like a bug.

joachimmarder pushed a commit that referenced this issue Feb 28, 2016
* TBaseVirtualTree.ChangeScale() now respects inherited property ScalingFlags
* Improved code order in TVTHeader.ChangeScale() to prevent duplicate scaling
@joachimmarder joachimmarder self-assigned this Feb 28, 2016
ValtsS pushed a commit to ValtsS/Virtual-TreeView that referenced this issue Jan 25, 2019
* TBaseVirtualTree.ChangeScale() now respects inherited property ScalingFlags
* Improved code order in TVTHeader.ChangeScale() to prevent duplicate scaling
# Conflicts:
#	Source/VirtualTrees.pas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Pull Requests Invited There are no current plans to address the issue, but we would be happy if someone supplies a PR.
Projects
None yet
Development

No branches or pull requests

2 participants