Comments (2)
Thanks, issue 1 and 2 are addressed.
Incidentally it is also worth moving UpdateHeaderRect() after the inherited call
Agreed.
Instead of using CurrentPPI it is faster ....
I don't think we should do preemptive performance optimization here.
and more reliable to use FCurrentPPI
Can you explain why? Given general best practices, one should use the property, not the member variable.
from virtual-treeview.
@joachimmarder
Thanks for the changes!
I don't think we should do preemptive performance optimization here.
It is not about optimization. As explained in #1205 FCurrentPPI is a protected field and CurrentPPI is a property that gets the PPI from the control handle. The former is more reliable and consistent with the current control scaling state. So, if you can (meaning if FCurrentPPI has been updated by the inherited ChangeScale), you should use FCurrentPPI instead of CurrentPPI.
On Issue 2:
You can significantly simplify the code by not checking IsSystemStyle and just using StyleServices.GetElementSize, Please see above.
In other words the following:
if StyleServices.IsSystemStyle then
begin
{$if CompilerVersion >= 33}
if TOSVersion.Check(10) and (TOSVersion.Build >= 15063) then
Theme := OpenThemeDataForDPI(Handle, 'BUTTON', CurrentPPI)
else
{$ifend}
Theme := OpenThemeData(Self.Handle, 'BUTTON');
Details := StyleServices.GetElementDetails(tbCheckBoxUncheckedNormal);
Res := GetThemePartSize(Theme, BM.Canvas.Handle, Details.Part, Details.State, nil, TS_TRUE, lSize) = S_OK;
end
else
can just be removed!
from virtual-treeview.
Related Issues (20)
- Remaining header AutoScale issue HOT 1
- Possible double scaling of unitialized nodes HOT 2
- Extract VST into VirtualTrees.StringTree.pas, leave VirtualTrees.pas as aggregate unit HOT 3
- Advanded Demo stack overflow HOT 2
- Advanced Demo Memory leak
- Advanced Demo Memory leak (TPicture) HOT 1
- Keep current selection when right-clicking a selected node (toRightClickSelect enabled) HOT 2
- Double click on cell reverts focus to VT when custom combobox editor is showed with DroppedDown:=True; HOT 1
- Setting LineStyle to lsDotted does not work HOT 1
- TBaseVirtualTree.AddChild( ) fails for toReadOnly HOT 2
- Clarification please regarding OnFreeNode handling for strings etc HOT 2
- OnShortenString not called for column headers HOT 2
- OnHeaderClick Event triggered twice if vclstyle enabled HOT 2
- Tree lines not painted HOT 3
- How to get lighter/finer GridLines; GridLineColor not used. HOT 4
- Columns EndUpdate and duplicate position HOT 14
- Does TVirtualstringTree support multi-level headers? HOT 1
- AutoScale is setting wrong node height HOT 2
- Packages for Delphi 12 Athens? HOT 1
- Update to Delphi 12 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtual-treeview.