* * *

Author Topic: VirtualTreeview black header  (Read 3255 times)

JD

  • Hero Member
  • *****
  • Posts: 1716
VirtualTreeview black header
« on: May 27, 2017, 07:49:05 pm »
Hi there everyone,

I use VirtualTreeview 5.5.3 and for a while now I've noticed a black patch on the header when Header.Options.hoVisible := True

Is there anyway I can hide the black patch or at least change it's colour to white? The screenshot is shown below

Thanks,

JD
Windows (10, 7) - Lazarus 1.8/FPC 3.0.4, NewPascal, Delphi
Linux Mint Cinnamon  - Lazarus 1.8/FPC 3.0.4, NewPascal

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

zeljko

  • Hero Member
  • *****
  • Posts: 974
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: VirtualTreeview black header
« Reply #1 on: May 27, 2017, 08:02:59 pm »
Looks like canvas is assigning Color (clDefault) instead of GetColorResolvingParent()

JD

  • Hero Member
  • *****
  • Posts: 1716
Re: VirtualTreeview black header
« Reply #2 on: May 27, 2017, 08:43:53 pm »
Looks like canvas is assigning Color (clDefault) instead of GetColorResolvingParent()

So what should I do to correct it?
Windows (10, 7) - Lazarus 1.8/FPC 3.0.4, NewPascal, Delphi
Linux Mint Cinnamon  - Lazarus 1.8/FPC 3.0.4, NewPascal

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

zeljko

  • Hero Member
  • *****
  • Posts: 974
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: VirtualTreeview black header
« Reply #3 on: May 27, 2017, 09:15:12 pm »
Check VirtualTrees.pas sources at the place where header is painted ?

GetMem

  • Hero Member
  • *****
  • Posts: 3083
Re: VirtualTreeview black header
« Reply #4 on: May 28, 2017, 06:12:12 am »
Hi JD,

Although I cannot reproduce it(image1), it looks like a painting issue as @Zeljko already mentioned. Until you find out what causes the issue, just choose your main column(usually the first one) and set autoresize to true(image2). I'm aware that this is just a workaround not a solution, but it might work for you.
« Last Edit: May 28, 2017, 06:24:14 am by GetMem »

JD

  • Hero Member
  • *****
  • Posts: 1716
Re: VirtualTreeview black header
« Reply #5 on: May 28, 2017, 09:45:42 pm »
Thanks GetMem. AutoSizing a column hides the black header patch.

JD
Windows (10, 7) - Lazarus 1.8/FPC 3.0.4, NewPascal, Delphi
Linux Mint Cinnamon  - Lazarus 1.8/FPC 3.0.4, NewPascal

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 456
Re: VirtualTreeview black header
« Reply #6 on: May 29, 2017, 06:51:02 pm »
Still interested in fixing it.

What OS are you using?

The example is just drop a VirtualTreeView into an empty project?

JD

  • Hero Member
  • *****
  • Posts: 1716
Re: VirtualTreeview black header
« Reply #7 on: May 30, 2017, 02:31:26 am »
Still interested in fixing it.

What OS are you using?

The example is just drop a VirtualTreeView into an empty project?

Windows 7 and yes I just dropped a VirtualTreeView onto an empty project and chose to display column headers.

JD
Windows (10, 7) - Lazarus 1.8/FPC 3.0.4, NewPascal, Delphi
Linux Mint Cinnamon  - Lazarus 1.8/FPC 3.0.4, NewPascal

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

JD

  • Hero Member
  • *****
  • Posts: 1716
Re: VirtualTreeview black header
« Reply #8 on: January 16, 2018, 12:01:46 pm »
Hi there everyone,

The VirtualTreeview [hoAutoResize] option works and hides the black header but it only applies to the first column in the VirtualTreeview and no other column.

But sometimes I prefer to auto-resize another column (for example a "Description" or "Commentaries" column that is not the first column. Whenever I try this, it always applies the action to the first column which is undesirable in this case because it is the "ID" column.

How can I do this?

Thanks,

JD
Windows (10, 7) - Lazarus 1.8/FPC 3.0.4, NewPascal, Delphi
Linux Mint Cinnamon  - Lazarus 1.8/FPC 3.0.4, NewPascal

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

GetMem

  • Hero Member
  • *****
  • Posts: 3083
Re: VirtualTreeview black header
« Reply #9 on: January 16, 2018, 01:11:44 pm »
Quote
Hi there everyone,

The VirtualTreeview [hoAutoResize] option works and hides the black header but it only applies to the first column in the VirtualTreeview and no other column.

But sometimes I prefer to auto-resize another column (for example a "Description" or "Commentaries" column that is not the first column. Whenever I try this, it always applies the action to the first column which is undesirable in this case because it is the "ID" column.

How can I do this?
By setting Header-->AutoSizeIndex to whatever column you wish to auto-size? Also make sure autospring is off.
 

JD

  • Hero Member
  • *****
  • Posts: 1716
Re: VirtualTreeview black header
« Reply #10 on: January 16, 2018, 03:51:12 pm »
@GetMem

Perfect! Thanks a lot.

JD
Windows (10, 7) - Lazarus 1.8/FPC 3.0.4, NewPascal, Delphi
Linux Mint Cinnamon  - Lazarus 1.8/FPC 3.0.4, NewPascal

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus