Comments (5)
Please respect our guidelines on the project homepage for submitting bugs. Please include your version of Virtual TreeView and attach a sample compiling project as ZIP to your report. If you already have a solution, please supply a patch file.
Since #925 was merged
Well, that was 5 years ago. Maybe the original contributor @lyynxx can comment on this?
from virtual-treeview.
Pardon, I've been in a bit of a hurry, yesterday. The issue is easy reproducible in HeaderCustomDrawDemo's tab of Advanced.exe
demo of current master (c3ddc11), as well as in the merge commit back then (2d4f75), when hoAutoResizeInclCaption
is included in Header.Options
property; see Virtual-TreeView-reproduce-issue-#1250.patch. Thus, the issue applies to all versions since 7.3.
This applied, if one holds ctrl-key and double-clicks the column headers' edges, the columns are resized badly:
- The first (index 0) and second (index 1) column each become way to wide, as the captions' widths aren't measured properly.
- The third (index 2) column does not apply a width for the caption's text, which is to be expected here – I guess – because there is no text set at all. Nonetheless, it would be nice to get control over the width being applied or not, e.g. by some event.
Unfortunately, I cannot provide a fix right now. I thought about delegating the text measurement to the already existing method TCustomVirtualStringTree.CalculateTextWidth
, but did not find a proper way to call it from class TVirtualTreeColumns
without casting its TBaseVirtualTreeView
reference to TCustomVirtualStringTree
.
from virtual-treeview.
The first (index 0) and second (index 1) column each become way to wide, as the captions' widths aren't measured properly
For some reason I could not yet figure out, in TVirtualTreeColumn.GetCaptionWidth()
the canvas' font size was very large. I need to debug why this is the case here. Based on the font's size, the width is calculated correctly.
it would be nice to get control over the width being applied or not, e.g. by some event.
Have you tried the OnAfterGetMaxColumnWidth
event?
from virtual-treeview.
The first (index 0) and second (index 1) column each become way to wide, as the captions' widths aren't measured properly
For some reason I could not yet figure out the canvas' font size was very large. I need to debug why this is the case here. Based on the font's size, the width is calculated correctly.
Yes. The values width is correct, based on the wrong value. Although, the way it's calculated duplicates a more sophisticated logic, elsewhere (see TVirtualTreeColumns.PaintHeader
). This is quite uncommon for this project's code. Thus, the value may be equal in value, but logically it's not guaranteed to be the same.
it would be nice to get control over the width being applied or not, e.g. by some event.
Have you tried the
OnAfterGetMaxColumnWidth
event?
I am aware of the OnAfterGetMaxColumnWidth
event. That's what I use ever since to include the column's header's width for the column. If TVirtualTreeColumn.GetCaptionWidth
could call TCustomVirtualStringTree.CalculateTextWidth
, then the events OnMeasureText…
of method TCustomVirtualStringTree.DoTextMeasuring
could be used to customize the calculation.
from virtual-treeview.
The values width is correct, based on the wrong value.
I found the reason why the font size is so large: It was modified that way in THeaderOwnerDrawForm.HeaderCustomDrawTreeAdvancedHeaderDraw()
to draw the world map, but the original font was not restored. This is now changed and the columns now resize OK in your repro steps above.
If
TVirtualTreeColumn.GetCaptionWidth
could callTCustomVirtualStringTree.CalculateTextWidth
Well it couldn't as, it exists only in the derived class for the Virtual String Tree. Also, the events you mentioned are for painting the client area of the virtual string tree, they can't recognize if some text is from the client area or the header, which by the way has its own Font
property. This would be a breaking change, and I don't think it is a good idea to mix up the tree header and the derived class TCustomVirtualStringTree
.
from virtual-treeview.
Related Issues (20)
- Reordered Grid of columns htrows exception when moving left with the keyboard HOT 2
- Fixed columns are broken in V7.6.6 and V8.0.2 HOT 3
- As of the September 22, 2023 release, the C++Builder version is not compatible with the previous version HOT 2
- Incompatible error when calling VTAccessibilityFactory.GetAccessibilityFactory.CreateIAccessible(Self); HOT 4
- VirtualTreeView DefaultNodeHeight dont work HOT 1
- Access violation on changing option of multiselected column header HOT 1
- Distorted shape when dragging the columns HOT 1
- double-click clears selected checkboxes HOT 1
- Cannot compile 8.0.3 package in Delphi XE3 HOT 1
- Vertical Scrollbar Cannot Show if the Tree Nodes are Hidden Initially HOT 6
- Let toAutoTristateTracking to ignore invisible nodes HOT 2
- AutoScroll does not respect AutoScrollDelay property HOT 6
- Height overflow when adding large number of nodes HOT 5
- AutoScale wrongly assumes that node height only depends on font size HOT 3
- A loooooooooooong bug in IterateSubtree HOT 4
- DefaultNodeHeight ignores set value and recalculates to default HOT 1
- Wrong canvas brush color in OnAfterCellPaint event HOT 6
- GetNodeData returns invalid data when (Node = Pointer(Self)) HOT 1
- Please implement multiselect and "Copy with Headers"
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.