Recent

Author Topic: TTreeView Font Color Bug?  (Read 7301 times)

wjackson153

  • Sr. Member
  • ****
  • Posts: 267
TTreeView Font Color Bug?
« on: January 02, 2013, 11:25:09 pm »
I have tried to change the font color of TTreeView componient with no success
back color changes fine, but font will not change.

Can anyone else confirm this?
Lazarus 1.1 r39490 CT FPC 2.7.1 i386-linux KDE
Linux Mint 14 KDE 4

wjackson153

  • Sr. Member
  • ****
  • Posts: 267
Re: TTreeView Font Color Bug?
« Reply #1 on: January 03, 2013, 02:48:59 am »
Man 45 reviews and no one can confirm this issue ?

Ok, perhaps I left out a vital peice of information

Lazarus 1.04  FPC 2.6
Linux Mint 12 i386
GTK2 and KDE4 same effect both enviroments
Debian 6.05  same effect

Confirmed also on Ubuntu 12.04

Lazarus 1.1 r39490 CT FPC 2.7.1 i386-linux KDE
Linux Mint 14 KDE 4

Bart

  • Hero Member
  • *****
  • Posts: 4747
    • Bart en Mariska's Webstek
Re: TTreeView Font Color Bug?
« Reply #2 on: January 03, 2013, 05:47:22 pm »
I can confirm that on Windows.
(Lazarus 1.1 r39620 FPC 2.6.2 i386-win32-win32/win64)

Setting font.color has no visual effect, althoug querying the font.color will return the value you have assigned.

Bart

wjackson153

  • Sr. Member
  • ****
  • Posts: 267
Re: TTreeView Font Color Bug?
« Reply #3 on: January 03, 2013, 07:05:03 pm »
Ok thanks for your comfirmation, I was beginning to think it was a linux issue
as I do not use Windows nor own  a copy of windows I had no way of testing
it to confirm it was a linux only issue.

Good to know im not the only affected user :)

Now I wonder if there are any plans to fix it in the next control release.
Lazarus 1.1 r39490 CT FPC 2.7.1 i386-linux KDE
Linux Mint 14 KDE 4

Bart

  • Hero Member
  • *****
  • Posts: 4747
    • Bart en Mariska's Webstek
Re: TTreeView Font Color Bug?
« Reply #4 on: January 04, 2013, 01:17:49 pm »
You can file a bugreport in the bugtracker.
This will ensure it gets the attention it needs.

Mind you, under Windows (WinME) using Delphi 3 (okay, very old indeed) I cannot alter TTreeView.Font.Color as well.
So this may well be a limitation of the underlying widgetset (but this does not show in the Restriction Tab of the OI, nor in the Restriction Browser).

Bart
« Last Edit: January 04, 2013, 02:00:20 pm by Bart »

Bart

  • Hero Member
  • *****
  • Posts: 4747
    • Bart en Mariska's Webstek
Re: TTreeView Font Color Bug?
« Reply #5 on: January 04, 2013, 02:34:18 pm »
It seems that you need to use the OnCustomDrawItem() event for that.
See: this topic at ProgrammersHeaven.com for an example.

Bart

wjackson153

  • Sr. Member
  • ****
  • Posts: 267
Re: TTreeView Font Color Bug?
« Reply #6 on: January 04, 2013, 04:46:26 pm »
In regards to :
Code: [Select]
It seems that you need to use the OnCustomDrawItem() event for that.
Tried that as well

procedure TForm1.TreeView1AdvancedCustomDrawItem(Sender: TCustomTreeView;
  Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage;
  var PaintImages, DefaultDraw: Boolean);
begin
 with TreeView1.Canvas do
 begin // use the canvas of the treeview and not the form's canvas
    if Node.Level = 0 then // root nodes have a level of 0
      begin

      Font.Style := [fsBold, fsItalic];
      font.Color:= clRed;
      end

    else // all other have higher level properties
    begin
      Font.Style := [];
    DefaultDraw := true; // let the treeview do the drawing with your selected properties

    end;
  end;
end;       
     
« Last Edit: January 04, 2013, 05:01:00 pm by wjackson153 »
Lazarus 1.1 r39490 CT FPC 2.7.1 i386-linux KDE
Linux Mint 14 KDE 4

prenic

  • Newbie
  • Posts: 1
Re: TTreeView Font Color Bug?
« Reply #7 on: July 05, 2013, 03:36:13 pm »
On TTreeView control property, set Options | tvoThemedDraw to False.

vaun

  • Newbie
  • Posts: 1
Re: TTreeView Font Color Bug?
« Reply #8 on: August 05, 2014, 04:58:36 am »
Changing options->tvoTHemedDraw works for me.
Thanks.

 

TinyPortal © 2005-2018