Monday, 15 August 2011

delphi - How to Draw Vertical Centered Content on DBGrid -


edited: I JDI a vertical centered triangular graphic and text (the project on a Tixaveedibigreed descendants of Teedibigreed) I disable DefaultDrawing method JvDBGrid and try to override it, but I can only fill the cells with black (I think that override my address is incomplete).

Now I draw the mark on the cell and the text stays with the default drawing. How can I do the icon (vertical and horizontal) and text (just vertical) like the center?

Here is my code:

  process TFrmXXX.JvDBGridXXXDrawColumnCell (Sender: Tubakst; construct Rikt: Trkt; Detacol: integer; Column: TC columns: State: Tigreed Deravstet) ; Var icon: TIcon; FixRect: TRCT; IMGuuth: integer; Correct start: reference =; If the column.index = 0 then / always always the first symbol will start Icon: = GetIcon; Try Returning TIcon Object: imgWidth: = (Rect.Bottom - Rect.Top); FixRect.Right: = Rect. Left + img-depth; (Sender as TJVDB Grid) .Canva. Stretch Draw (FixRect, Icon); The icon at the end. free; End; FixRect: Rectangle; FixRect.Left: = fixRect.Left + imgWidth; End; (Sender as TJVDB Grid) Default dourecolmel (lowercase, datacol, column, state); End; After several trials, I got the solution to merge various tutorials on the internet. At DrawColumnCell event, I wrote something like this:  
  canvas.fillart (rect); // Fill the cell using the current brush  

And in the case of each specific column, I used one of these methods:

  canvas. Draw ((Rikt. Right - Rikt. Left - icon width) div 2 + rect.Left, (Rikt. Batm - Rikt. Top - icon. Height) div 2 + Rect.Top, icon); // focuses on cell canvas Graphic Draw draft text (Kanwaskhandl, Pisihara (Colmkfild. Display text), length (Colmkfild. Display text), Riktat, Ditiviviakveyr or D Tisiiattr or Ditisisijiielian or Ditiantiapiariaksaks); // Draw vertical and horizontal centered text Canvas. Devtekst (Kanwaskhandl, Pisihara (Colmkfild. Display text), length (Colmkfild. Display text), Riktat, Ditiviaviaksar or Ditisisijiielian or Ditiantiapiariaksaks); // Vertical and leave horizontally appropriate text  

No comments:

Post a Comment