Recent

Author Topic: Glowing Vista listview or treeview selection background  (Read 7304 times)

tk

  • Sr. Member
  • ****
  • Posts: 367
Glowing Vista listview or treeview selection background
« on: November 06, 2010, 08:11:14 pm »
Hello
I don't know how to paint this nice glowing selection with the Vista theme API (both in Lazarus and Delphi). Delphi XE has this in some of their own controls but I don't have VCL source yet. If anyone knows, thanks for help in advance.

tk

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Glowing Vista listview or treeview selection background
« Reply #1 on: November 06, 2010, 08:21:51 pm »
It is not possible to post copyrighted code here.

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: Glowing Vista listview or treeview selection background
« Reply #2 on: November 07, 2010, 06:35:03 am »
You can use themed controls: http://wiki.freepascal.org/Theme_library. I found an article about themed controls in the very interesting journal BlaisePascal, #5 - free available on their homepage http://www.blaisepascal.eu/. It was easy to adopt to tables and listviews.
Lazarus 1.7 (SVN) FPC 3.0.0

tk

  • Sr. Member
  • ****
  • Posts: 367
Re: Glowing Vista listview or treeview selection background
« Reply #3 on: November 07, 2010, 10:39:00 am »
My friend figured it out and sent me the code:
Code: [Select]
   
var ATheme: HTHEME;

ATheme := ThemeServices.Theme[teMenu];
DrawThemeBackground(ATheme, Canvas.Handle, MENU_POPUPITEM, MPI_HOT, Rect, nil);


Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: Glowing Vista listview or treeview selection background
« Reply #4 on: November 08, 2010, 07:51:35 am »
Don't forget to test whether or not themes are enabled: "if ThemeServices.ThemesEnabled then...". This ensures also that themes are available at all.
Lazarus 1.7 (SVN) FPC 3.0.0

lainz

  • Guest
Re: Glowing Vista listview or treeview selection background
« Reply #5 on: November 26, 2010, 01:49:55 am »
reported bug "0018053: Glowing Vista listview or treeview selection background" to improve lazarus list view.

 

TinyPortal © 2005-2018