You've already forked lazarus-ccr
RxFPC:RxDBGrid - fix Checkbox Layout drawing
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6133 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1171,7 +1171,7 @@ procedure RegisterRxDBGridSortEngine(RxDBGridSortEngineClass: TRxDBGridSortEngin
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses Math, rxdconst, rxstrutils, rxutils, strutils, rxdbgrid_findunit,
|
uses Math, rxdconst, rxstrutils, rxutils, strutils, rxdbgrid_findunit, Themes,
|
||||||
rxdbgrid_columsunit, RxDBGrid_PopUpFilterUnit, rxlookup, rxtooledit, LCLProc,
|
rxdbgrid_columsunit, RxDBGrid_PopUpFilterUnit, rxlookup, rxtooledit, LCLProc,
|
||||||
Clipbrd, rxfilterby, rxsortby, variants, LazUTF8;
|
Clipbrd, rxfilterby, rxsortby, variants, LazUTF8;
|
||||||
|
|
||||||
@ -4459,6 +4459,32 @@ var
|
|||||||
C: TRxColumn;
|
C: TRxColumn;
|
||||||
j, DataCol, L, R: integer;
|
j, DataCol, L, R: integer;
|
||||||
FIsMerged: Boolean;
|
FIsMerged: Boolean;
|
||||||
|
|
||||||
|
function CheckBoxHeight(const aState: TCheckboxState):integer;
|
||||||
|
const
|
||||||
|
arrtb:array[TCheckboxState] of TThemedButton = (tbCheckBoxUncheckedNormal, tbCheckBoxCheckedNormal, tbCheckBoxMixedNormal);
|
||||||
|
var
|
||||||
|
Details: TThemedElementDetails;
|
||||||
|
CSize: TSize;
|
||||||
|
ChkBitmap: TBitmap;
|
||||||
|
begin
|
||||||
|
if (TitleStyle=tsNative) and not assigned(OnUserCheckboxBitmap) then
|
||||||
|
begin
|
||||||
|
Details := ThemeServices.GetElementDetails(arrtb[AState]);
|
||||||
|
CSize := ThemeServices.GetDetailSize(Details);
|
||||||
|
//CSize.cx := MulDiv(CSize.cx, Font.PixelsPerInch, Screen.PixelsPerInch);
|
||||||
|
Result := MulDiv(CSize.cy, Font.PixelsPerInch, Screen.PixelsPerInch);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
ChkBitmap := GetImageForCheckBox(aCol, aRow, AState);
|
||||||
|
if ChkBitmap<>nil then
|
||||||
|
Result:=ChkBitmap.Height
|
||||||
|
else
|
||||||
|
Result:=DefaultRowHeight;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FIsMerged:=false;
|
FIsMerged:=false;
|
||||||
|
|
||||||
@ -4493,29 +4519,15 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
case ColumnEditorStyle(aCol, F) of
|
case ColumnEditorStyle(aCol, F) of
|
||||||
cbsCheckBoxColumn: DrawCheckBoxBitmaps(aCol, aRect, F);
|
cbsCheckBoxColumn:begin
|
||||||
|
if C.Layout = tlTop then
|
||||||
|
aRect.Bottom:=aRect.Top + CheckBoxHeight(cbChecked) + varCellPadding + 1
|
||||||
else
|
else
|
||||||
(* if F <> nil then
|
if C.Layout = tlBottom then
|
||||||
begin
|
aRect.Top:=aRect.Bottom - CheckBoxHeight(cbChecked) - varCellPadding - 1;
|
||||||
if F.dataType <> ftBlob then
|
DrawCheckBoxBitmaps(aCol, aRect, F);
|
||||||
begin
|
|
||||||
if CheckDisplayMemo(F) then
|
|
||||||
S := F.AsString
|
|
||||||
else
|
|
||||||
S := F.DisplayText;
|
|
||||||
if Assigned(C) and (C.KeyList.Count > 0) and (C.PickList.Count > 0) then
|
|
||||||
begin
|
|
||||||
J := C.KeyList.IndexOf(S);
|
|
||||||
if (J >= 0) and (J < C.PickList.Count) then
|
|
||||||
S := C.PickList[j];
|
|
||||||
end;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
S := FColumnDefValues.FBlobText;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
S := ''; *)
|
|
||||||
|
|
||||||
S:=GetFieldDisplayText(F, C);
|
S:=GetFieldDisplayText(F, C);
|
||||||
if ((rdgWordWrap in FOptionsRx) and Assigned(C) and (C.WordWrap)) or (FIsMerged) then
|
if ((rdgWordWrap in FOptionsRx) and Assigned(C) and (C.WordWrap)) or (FIsMerged) then
|
||||||
WriteTextHeader(Canvas, aRect, S, C.Alignment)
|
WriteTextHeader(Canvas, aRect, S, C.Alignment)
|
||||||
|
Reference in New Issue
Block a user