mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:56:10 +02:00
DBGrids: Improved cell hints.
git-svn-id: trunk@55207 -
This commit is contained in:
parent
b29915c159
commit
11f3b76108
@ -1517,8 +1517,9 @@ begin
|
|||||||
Result := '';
|
Result := '';
|
||||||
if (ARow < FixedRows) then
|
if (ARow < FixedRows) then
|
||||||
exit;
|
exit;
|
||||||
if Assigned(FOnGetCellHint) then begin
|
|
||||||
C := ColumnFromGridColumn(ACol) as TColumn;
|
C := ColumnFromGridColumn(ACol) as TColumn;
|
||||||
|
Result := C.Field.AsString;
|
||||||
|
if Assigned(FOnGetCellHint) then begin
|
||||||
FOnGetCellHint(self, C, Result);
|
FOnGetCellHint(self, C, Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1527,16 +1528,24 @@ end;
|
|||||||
function TCustomDBGrid.GetTruncCellHintText(aCol, aRow: Integer): string;
|
function TCustomDBGrid.GetTruncCellHintText(aCol, aRow: Integer): string;
|
||||||
var
|
var
|
||||||
F: TField;
|
F: TField;
|
||||||
|
C: TColumn;
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
if ARow < FixedRows then
|
if ARow < FixedRows then
|
||||||
exit;
|
exit;
|
||||||
F := GetFieldFromGridColumn(ACol);
|
F := GetFieldFromGridColumn(ACol);
|
||||||
if (F <> nil) then
|
if (F <> nil) then
|
||||||
|
if (F.DataType = ftMemo) then
|
||||||
|
Result := F.AsString
|
||||||
|
else
|
||||||
if (F.DataType <> ftBlob) then
|
if (F.DataType <> ftBlob) then
|
||||||
Result := F.DisplayText
|
Result := F.DisplayText
|
||||||
else
|
else
|
||||||
Result := '(blob)';
|
Result := '(blob)';
|
||||||
|
if Assigned(FOnGetCellHint) then begin
|
||||||
|
C := ColumnFromGridColumn(ACol) as TColumn;
|
||||||
|
FOnGetCellHint(self, C, Result);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// obtain the field either from a Db column or directly from dataset fields
|
// obtain the field either from a Db column or directly from dataset fields
|
||||||
|
@ -7813,6 +7813,7 @@ end;
|
|||||||
procedure TCustomGrid.CMMouseEnter(var Message: TLMessage);
|
procedure TCustomGrid.CMMouseEnter(var Message: TLMessage);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
if FCellHintPriority = chpAll then
|
||||||
FSavedHint := Hint;
|
FSavedHint := Hint;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user