Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ListDialog : Change the color of particular lines
#1
I wonder whether there has been any contribution regarding coloring of a particular line in ListDialog. Thanks in advance.
#2
No. It is possible, because it is a standard SysListView32 control that supports custom draw, and examples can be found, for example with QM_Grid control. But need to create a copy of ListDialog. Or subclass the dialog. I will not give an example, but can advise if you'll try.
#3
Many thanks Gintaras for your reply. I have already made a copy of ListDialog and I am working on it. I will also ask for your invaluable assistance if needed. Best regards.
#4
I came-up with the following solution, which it works :

1. In messages 3
case NM_CUSTOMDRAW
ret DT_Ret(hDlg sub.TvCustomdraw(+nh 171))
where 171 is the color code in this example

2. Passing the color paramater in TvCustomdraw :

#sub TvCustomdraw
function# NMTVCUSTOMDRAW*cd int'col

out cd.nmcd.dwDrawStage
out col

sel cd.nmcd.dwDrawStage
case CDDS_PREPAINT ret CDRF_NOTIFYITEMDRAW ;;yes, notify me to draw items
case CDDS_ITEMPREPAINT
cd.clrText=col


I wonder whether there exists a simpler way to pass the color parameter into TvCustomdraw.

Thanks for any advice.
#5
The routine, as finally modified, is attached herewith.


Attached Files
.qml   ListDialog_SES.qml (Size: 13 KB / Downloads: 371)
#6
thanks for work on this. I am trying to use sample but errors on unknown identifiers ideb and NowT.
Any thoughts?
Thanks,
Stuart
#7
Thank you for your interest. They are local variables and functions used by me for debugging purposes. You may ignore them. I will upload a new version, first thing tomorrow morning, without any annoying stuff. Best regards. Simos.
#8
much appreciated.
S
#9
Version for QM-Forum users


Attached Files
.qml   ListDialog_SES_Forum.qml (Size: 12 KB / Downloads: 357)


Forum Jump:


Users browsing this thread: 8 Guest(s)