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

Add support for vertical alignment #433

Open
vincentparrett opened this issue Jan 21, 2015 · 2 comments
Open

Add support for vertical alignment #433

vincentparrett opened this issue Jan 21, 2015 · 2 comments

Comments

@vincentparrett
Copy link
Contributor

From [email protected] on April 30, 2014 18:41:16

Hi,

we updated from 5.01 to 5.4. now in trees where we have multiline nodes. the multiline column is as normal. but all other columns have now the text centered. we do not want this.

the problem is that in "TCustomVirtualStringTree.PaintNormalText" there are the following new lines in V5.4:

// Center the text vertically if it fits entirely into the content rect.
if R.Bottom - R.Top > Height then
InflateRect(R, 0, (Height - R.Bottom - R.Top) div 2);

this crops the rect and paints the text in the center.

we made a patch-file wich should upgrade the virtualtreeview to support vertical alignment in the column definition. therefore a user can setup the column to paint the text as in V5.01 (top) or V5.4 (center) or new (bottom).

Multiline.7z is a test-project for the new verticalalignment property.
VirtualTrees.pas.patch is the TortoiseSVN-patch file.

please check if we did this properly. we do not often code on components themself. also check the names for coresponding to your coding standards.

cheers

Attachment: Multiline.7z VirtualTrees.pas.patch

Original issue: http://code.google.com/p/virtual-treeview/issues/detail?id=433

@vincentparrett
Copy link
Contributor Author

From [email protected] on June 20, 2014 11:42:09

Summary: Add support for vertical alignment (was: Vertical alignment)
Status: Started
Owner: [email protected]

@vincentparrett
Copy link
Contributor Author

vincentparrett commented Jan 21, 2015

From [email protected] on June 20, 2014 12:10:49

we updated from 5.01 to 5.4. now in trees where we
have multiline nodes. the multiline column is as
normal. but all other columns have now the text centered.

At least as default behavior the vertically centered text is a better solution than a vertically top aligned text. The Windows Explorer does the same in case it has multiline items, see the attached screenshot.

we made a patch-file wich should upgrade the
virtualtreeview to support vertical alignment
in the column definition

I personally don't see a need to have different vertical alignments for different columns. But I can understand that someone wants a different default behavior for the entire tree.

There is already some support for vertical alignment in the current source code: The property TBaseVirtualTree.VerticalAlignment

We should consider using this and fix TCustomVirtualStringTree.PaintNormalText() so that it considers this property. If that has been fixed, we just need to allow defining a default value, instead of the fixed value 50(%).

Status: New

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants