Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 14:22

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 20 Sep 2022, 20:08 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
I enabled

EhGrid.SumList.Active := True

And in the column there is

Footer.ToolTips := True

I would like to show Hint only in Footer


Attachments:
Hint Footer Grid.png
Hint Footer Grid.png [ 38.57 KiB | Viewed 1198 times ]
Top
 Profile  
 
PostPosted: 21 Sep 2022, 16:00 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

The Footer.ToolTips property is designed to display the footer text when the text does not fit in the footer cell.
In the footer, unfortunately, there are no settings for displaying the Hint, i.e. custom text.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 21 Sep 2022, 18:49 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
Is there any way or hack I can do this ?


Top
 Profile  
 
PostPosted: 21 Sep 2022, 21:46 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

I only see a modification of the grid code here.

Code:
procedure TCustomDBGridEh.CMHintShow(var Message: TCMHintShow);

....
      else if (FullFooterRowCount > 0) and
              (Cell.Y > RowCount - 1) then
....
        begin
          Footer := Column.ColumnUsedFooter(Cell.Y - RowCount - DataGrouping.Footers.VisibleItemsCount);

          //New code
          if Column.DynProps.FindDynVar('FooterHint') <> nil then
          begin
            phi := Message.HintInfo;
            phi.CursorRect := ARect;
            phi.HintStr := Column.DynProps['FooterHint'].AsString;
            Processed := True;
          end;
          //\\New code

          if not Footer.ToolTips then Exit;
          FHintFont.Assign(Footer.Font);
          Canvas.Font.Assign(FHintFont);
          WordWrap := Footer.WordWrap;
          AAlignment := Footer.Alignment;
          S := GetFooterValue(Footer, Column);
          FBackground := Footer.Color;
          GetFooterParams(RawToDataColumn(Cell.X), Cell.Y - RowCount, Column,
            Canvas.Font, FBackground, AAlignment, [], S);
        end;




The hint text is stored in the Column.DynProps with FooterHint name.
So you need to create DynProp line this:


Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  DBGridEh1.Columns[0].DynProps.CreateDynVar('FooterHint', 'Footer Hint');
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 22 Sep 2022, 11:35 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
It worked but you can leave this code already fixed there in your sources?
Otherwise every time I change my version of EhLib I will have to change the source code before installing.


Top
 Profile  
 
PostPosted: 30 Sep 2022, 10:10 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
EhLibSupport wrote:
Hello

I only see a modification of the grid code here.

Code:
procedure TCustomDBGridEh.CMHintShow(var Message: TCMHintShow);

....
      else if (FullFooterRowCount > 0) and
              (Cell.Y > RowCount - 1) then
....
        begin
          Footer := Column.ColumnUsedFooter(Cell.Y - RowCount - DataGrouping.Footers.VisibleItemsCount);

          //New code
          if Column.DynProps.FindDynVar('FooterHint') <> nil then
          begin
            phi := Message.HintInfo;
            phi.CursorRect := ARect;
            phi.HintStr := Column.DynProps['FooterHint'].AsString;
            Processed := True;
          end;
          //\\New code

          if not Footer.ToolTips then Exit;
          FHintFont.Assign(Footer.Font);
          Canvas.Font.Assign(FHintFont);
          WordWrap := Footer.WordWrap;
          AAlignment := Footer.Alignment;
          S := GetFooterValue(Footer, Column);
          FBackground := Footer.Color;
          GetFooterParams(RawToDataColumn(Cell.X), Cell.Y - RowCount, Column,
            Canvas.Font, FBackground, AAlignment, [], S);
        end;




The hint text is stored in the Column.DynProps with FooterHint name.
So you need to create DynProp line this:


Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  DBGridEh1.Columns[0].DynProps.CreateDynVar('FooterHint', 'Footer Hint');
end;



It worked but you can leave this code already fixed there in your sources?
Otherwise every time I change my version of EhLib I will have to change the source code before installing.


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 57 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