I was using a TStringGrid to show some data but I need the "non-linear multi-select" from TListView.
However, the tricks to set Brush color inside of OnCustomDraw or OnAdvancedCustomDraw do not work.
Am I missing something? How is it done?
Mailing lists / lazarus / 2012-09
Brush color on TListView
6 messages · 3 people · –
- AAlexsander Rosa 3
- BBenito van der Zander 2
- KKaj Mikkelsen 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Try using the PrepareCanvas event.
Something loke:
procedure TArpDatForm.SG1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
aState: TGridDrawState);
Var
St:String;
begin
SG1.Canvas.brush.color := clWhite;
If aCol = 4 Then
Begin
St := SG1.Cells[4,arow];
St := Copy(St,1,pos('.',st)-1);
If (SG1.Cells[3,aRow] St) Then
Begin
SG1.Canvas.Brush.color := clRed;
end;
End;
end;Earlier message 26 lines
I was using a TStringGrid to show some data but I need the "non-linear multi-select" from…
However, the tricks to set Brush color inside of OnCustomDraw or OnAdvancedCustomDraw do not work. Am I missing something? How is it done?
You cannot do that.
And even if you get it working with one widgetset, it would fail on any other OS, since they all draw it differently.
I ended up writing my own list view
(http://www.benibela.de/components_en.html#treelistview), just to get differently colored rows
Or you can stay with the grid and implement your own selection (http://www.lazarus.freepascal.org/index.php?topic=7981.0)
Benito
Alexsander Rosa wrote 18 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120913/e3bbf66c/attachment-0001.html>
2012/9/13 Benito van der Zander
Show quoted text 6 lines
May we use your component on a proprietary software?
Alexsander Rosa wrote 11 lines
Good question.
Not unconditonally for all of them, that's why it's gpled
But at least if it benefits humanity, you can just go ahead and use it...
Benito
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120914/6782e58a/attachment.html>
You cannot do that. And even if you get it working with one widgetset, it would fail on…
I'm using treelistview from Benibela (GTK2). I have some questions:
- How to set the SelectedFont background color? SelectedFont.Color sets only the "pen" color, not the "brush" color
- How to use the OnCustomRecordItemDraw to set a line's background color depending on its content ?
2012/9/13 Benito van der Zander
