-
Notifications
You must be signed in to change notification settings - Fork 253
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
Make it possible to override RangeX #670
Comments
There is a protected SetRangeX() now and UpdateHorizontalRange is virtual. |
thankyou :)
regards
Peter
Am 29.11.2016 um 20:58 schrieb Joachim Marder:
…
There is a protected SetRangeX() now and UpdateHorizontalRange is virtual.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#670 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AV_D7cuuk4TrueBxK4msWktWhgDWrAASks5rDIPMgaJpZM4Kf5MM>.
|
Hi there, I have found a side effect with this change request. Taking Peter's example to adjust the RangeX value to accommodate the subtable breaks the function TVTHeader.DetermineSplitterIndex. RangeX value is used to initialize the Variable SplitPoint for the determination of the column splitter. If I haven't missed anything else following change should fix the problem. |
And to pick up on my previous post and complete my request... I have missed the block TreeView.UseRightToLeftAlignment in the function TVTHeader.DetermineSplitterIndex.
|
@jovanvasic: It's difficult to judge your proposed changes without having a sample project that makes use of overriding @mp3freak: Can you comment on them? |
Hi Joachim, I attached a sample project to show what I'm trying to do. On a click in the first column of a node the node expands and displays a sub table. The sub table is a TVirtualStringTree and it is wider then the main table. The Scrollbar in the sub table is deactivated. Using your announced changes for UpdateHorizontalRange() and SetRangeX() I manipulate the RangeX value of the main table with the RangeX value from the sub table. This allows me to adjust the Scroll Range to access the content of the sub table using the main table scrollbar. Now to come back to yesterdays post, if a node in the main table is expanded and the main table RangeX value therefore manipulated the function TVTHeader.DetermineSplitterIndex cannot determine the SplitterIndex anymore because it uses the RangeX value. Testing and comparing the values I found the RangeX value is the same like the Columns.TotalWidth. Being in a function of the header to find the splitter points I thought it may be better to use the Columns.TotalWidth instead, in case the RangeX gets modified. |
I fully agree with jovan. I didn't see that splitpoint side effect of my change. |
@jovanvasic: Thanks, your changes have been included. |
FRangeX is calculated by TBaseVirtualTree.UpdateHorizontalRange() from header FHeader.FColumns.TotalWidth.
It would be useful if it can be overwritten in some special cases when columns width get's larger than it's header, such as a subtable.
In this case it is inpossible to scroll to the end of the subtable because FRangeX / HorzScrollbar is calculated by header width.
I guess to make a few little changes in VirtualTrees.pas to make it possible:
+ procedure SetRangeX(value: Cardinal);
- property RangeX: Cardinal read GetRangeX;
+ property RangeX: Cardinal read GetRangeX write SetRangeX;
- procedure UpdateHorizontalRange;
+ procedure UpdateHorizontalRange; virtual;
+procedure TBaseVirtualTree.SetRangeX(value: Cardinal);
+begin
+ FRangeX := value;
+end;
With this changes, UpdateHorizontalRange can be overwritten,
after calling inherited, RangeX can be modified for special cases like subtables.
regards
Peter
The text was updated successfully, but these errors were encountered: