Recent

Author Topic: VirtualTreeview black header  (Read 5962 times)

JD

  • Hero Member
  • *****
  • Posts: 1848
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 - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

zeljko

  • Hero Member
  • *****
  • Posts: 1591
    • 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: 1848
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 - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

zeljko

  • Hero Member
  • *****
  • Posts: 1591
    • 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 ?

balazsszekely

  • Guest
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: 1848
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 - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 457
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: 1848
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 - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

JD

  • Hero Member
  • *****
  • Posts: 1848
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 - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

balazsszekely

  • Guest
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: 1848
Re: VirtualTreeview black header
« Reply #10 on: January 16, 2018, 03:51:12 pm »
@GetMem

Perfect! Thanks a lot.

JD
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

 

TinyPortal © 2005-2018