Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
17. Nov 2010
Now working :D Thanks so much!
Brush.Style := bsClear;
FillRect(Rect);
if odSelected in State then
begin
DrawThemeBackground(Theme, lvRecentFiles.Canvas.Handle,
LVP_LISTITEM, LIS_SELECTED, Rect, nil
);
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
17. Nov 2010
Form:
object Form20: TForm20
Left = 0
Top = 0
Caption = 'Form20'
ClientHeight = 202
ClientWidth = 331
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
16. Nov 2010
Don't working, when try select item, all what is inside control is erased, so component is blank.
Maybe I'm calling in wrong order? I have: OwnerDraw is True, OnDrawItem to make grey text, OnCustom* event with DefaultDraw set to True. Now selection is don't visible, but items are with black and grey text. Then I added your first code for themes to form OnCreate - result was the same, then...
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
16. Nov 2010
If I don't use owner draw (in owner draw event I put my drawing code) items selection is as in all other listview components (system too). When enable owner drawing I don't have selection, though in custom draw event default draw is on.
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
16. Nov 2010
I added it to OnCreate, this is good procedere?
Still no effect :( OnDrawItem should be in OnCustomDrawItem? But this don't have Rect parameter. Don't have idea how to do it :(
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
16. Nov 2010
I tried OnCustomDraw and OnCustomDrawItem and set in both DefaultDraw to True. And I still don't have default selection. How to use it?
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
15. Nov 2010
What you mean? I'm not pro in owner drawing :( Could you give me an example?
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
15. Nov 2010
Yes, but how about in current system style. For example in XP there is solid color, but on Vista+ there is gradiented. I want to just grey text, all other should be "original". Are you understand what I mean ;)
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
15. Nov 2010
So, how I can draw it in current Windows's style?
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
15. Nov 2010
I wanted make list with recent files. I also wanted make grey these items, that match file not exists (click File-->Reopen-->Properties in Delphi to see what I want to do). This is what I have:
begin
with lvRecentFiles, lvRecentFiles.Canvas do
begin
if FileExists(Item.Caption) then
Pen.Color := clBlack
else
Pen.Color := clGrayText
;