Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 18 Apr 2024, 08:21

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 08 Mar 2015, 03:52 
Offline

Joined: 15 Aug 2013, 15:13
Posts: 9
Column.GetBarType=ctDataList

procedure TForm3.DBGridEh1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
begin
Column.Grid.Canvas.Brush.Color :=$0082A7FD;//$00C4C4FF;// $008096FF;
// Column.Grid.Canvas.FillRect(Rect);
Column.Grid.DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;



procedure TCustomDBGridEh.DefaultDrawColumnCell(const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
var
Value: string;
ARect, ARect1: TRect;
XFrameOffs, YFrameOffs, KeyIndex: Integer;
RowHeight: Integer;
IsCellFilled: Boolean;
MultiLine: Boolean;
begin
ARect := Rect;
if (dghFooter3D in OptionsEh) then
begin
XFrameOffs := 1;
InflateRect(ARect, -1, -1);
end else XFrameOffs := 2;
YFrameOffs := XFrameOffs;
if Flat then Dec(YFrameOffs);
Value := Column.DisplayText;

IsCellFilled := False;
if GridBackgroundFilled and (Canvas.Brush.Color = FInternalColor) then
IsCellFilled := True;
if DataLink.Active and MemTableSupport
then RowHeight := RowHeights[FIntMemTable.InstantReadCurRowNum + TopDataOffset]
else RowHeight := FStdDefaultRowHeight;
// if Column.GetBarType in [ctCommon..ctKeyPickList] then
if Column.GetBarType in [ctCommon..ctKeyPickList,ctDataList] then
begin
if Column.HideDuplicates and CheckColumnDuplicateValues(Column, FIntMemTable.InstantReadCurRowNum, Value, True) then
Value := '';
MultiLine := Column.WordWrap and Column.CurLineWordWrap(RowHeight) ;
WriteCellText(Column, Canvas, ARect, True, XFrameOffs, YFrameOffs, Value,
Column.Alignment, Column.Layout, MultiLine,
Column.EndEllipsis, 0, 0, not MultiLine)
end else if Column.GetBarType = ctKeyImageList then
begin
Canvas.FillRect(ARect);
if Column.Field = nil
then KeyIndex := ColCellParamsEh.FImageIndex
else KeyIndex := Column.KeyList.IndexOf(Column.Field.Text);
if KeyIndex = -1
then KeyIndex := Column.NotInKeyListIndex;
DrawClipped(Column.ImageList, nil, Canvas, ARect, KeyIndex, 0, taCenter, ARect);
end else if Column.GetBarType = ctCheckboxes then
begin
Canvas.FillRect(ARect);
ARect1.Left := ARect.Left + iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, 0,
(ARect.Right - ARect.Left) shr 1 - DefaultCheckBoxWidth shr 1);
ARect1.Right := iif(ARect.Right - ARect.Left < DefaultCheckBoxWidth, ARect.Right,
ARect1.Left + DefaultCheckBoxWidth);
ARect1.Top := ARect.Top + iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, 0,
(ARect.Bottom - ARect.Top) shr 1 - DefaultCheckBoxHeight shr 1);
ARect1.Bottom := iif(ARect.Bottom - ARect.Top < DefaultCheckBoxHeight, ARect.Bottom,
ARect1.Top + DefaultCheckBoxHeight);

PaintButtonControl(Canvas, ARect1, Canvas.Brush.Color, bcsCheckboxEh,
0, Flat, False, True, Column.CheckboxState);
end else if Column.GetBarType = ctGraphicData then
DrawGraphicCell(Column, ARect, Canvas.Brush.Color, IsCellFilled);

end;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group