probleme with a TStringGrid lazarus / 13-General ---------------------------------------------------------------------- christophe_D · 2006-06-07 21:00 i have make a program for people who have a collection of french phoneCard (telecarte) The probleme i want to solve it's to have a custom pattern for TstringGrid.canvas.brush.style in the OnDrawCell i use BsCross for test : under Linux it work fine , but windows Nothing !!! know bug ?? error of me ?? i give the code i use Code: [Select] procedure TForm1.cataGDDrawCell(Sender: TObject; Col, Row: Integer;   aRect: TRect; aState: TGridDrawState); var    rech : string;    l,h  : integer; begin      (sender as TstringGrid).SelectedColor:=ClWhite;      (sender as TstringGrid).FocusColor:=ClWhite;      rech:=(sender as TstringGrid).Cells[1,row];      with sender as TstringGrid do with canvas do           Begin                { selection de la couleur de fond }                brush.Style:=Bssolid;                If gdFixed in aState                   Then                       begin                            Brush.Color := clBtnFace;                       end                   Else                       If gdSelected In aState                         Then                             begin                                  brush.Style:=BsdiagCross;                                  Brush.Color := $B0B0FF;                             end                         Else                             begin                                  DBcol.SavePosition;                                  DBcol.GoFirst;                                  DBcol.BeginSeek(MLB_FORWARD);                                  if DBcol.SeekData('numero','=',rech) then                                     begin                                          if DBcol.GetData('col')='y'                                             then Brush.Color:=ColorCol;                                          if DBcol.GetData('double')='y'                                             then Brush.Color:=ColorDou;                                     end;                                  DBcol.EndSeek;                                  DBcol.RestorePosition;                                  DBdou.GoFirst;                                  DBdou.BeginSeek(MLB_FORWARD);                                  if DBdou.SeekData('numero','=',rech)                                     then Brush.Color:=Colordis;                                  DBdou.EndSeek;                             end;                FillRect(aRect);                Font.Color:=clBlack;           end; end; and an other probleme under linux and windows with a multiSelect of row ( with TstringGrid.GoRowSelect:=True) if you select for example 4 row and click an other row ,the 4 row look select i solve the probleme with add TstringGrid.Refresh in TstringGrid.OnClick is it a bug off the drawing component ?? if you want to see the complete source and test the programme you can found it at http://sourceforge.net/projects/telecarte/ thank for reponse ---------------------------------------------------------------------- christophe_D · 2006-06-08 19:50 found a solution !! with a tBitmap in the form.create add this  Code: [Select] Pbr:=TbitMap.Create;   PBr.LoadFromFile(chemin+'brush.bmp'); // chemin --> string: path of the application and in the code of the OndrawCell add Code: [Select] TstringGrid.canvas.brush.bitmap:=Pbr; work fine in windows but crash the programme under Linux ---------------------------------------------------------------------- jesusr · 2006-06-08 20:56 Quote from: "christophe_D"found a solution !! with a tBitmap in the form.create add this  Code: [Select] Pbr:=TbitMap.Create;   PBr.LoadFromFile(chemin+'brush.bmp'); // chemin --> string: path of the application and in the code of the OndrawCell add Code: [Select] TstringGrid.canvas.brush.bitmap:=Pbr; work fine in windows but crash the programme under Linux And I though that bitmaped brushes were not implemented yet , please make a report that it doesn't work under linux. The problem of brush styles in windows is known but not reported yet? The problem you describe on RowSelect and Selection was introduced recently (was not intended though) when I tried to do some optimizations on the grid, but I'm working in a new patch to optimize even more grids drawing and It's fixed now, I just need to do more tests, and then I will submit it to SVN. So it's not necessary create a bug report about it. In the future, please try to create bug reports about things that not work this way reports are more easily noted. ---------------------------------------------------------------------- jesusr · 2006-06-09 17:25 the stringgrid bug should be fixed in svn by now. ---------------------------------------------------------------------- christophe_D · 2006-06-09 20:16 i think for bug, but my english is not perfect !! and i prefere to post a message at first time , because it can be an error of me ! and how can i do a search in the bug tracker ??? thank for your help