Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Ribbon Controls    [ Add a report in this area ]  
Report #:  72775   Status: Reported
ScreenTip Footer don't follow control's BiDiMode
Project:  Delphi Build #:  12.0.3210.17555
Version:    12.1 Submitted By:   Hichem BOUKSANI
Report Type:  Minor failure / Design problem Date Reported:  4/5/2009 1:32:19 PM
Severity:    Serious / Highly visible problem Last Updated: 4/6/2009 2:20:27 AM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 10
Description
ScreenTip Footer don't follow control's BiDiMode
Steps to Reproduce:
Open ScreenTipDemo
Set BiDiMode of frmMain to bdRightToLeft
Run
Move mouse on Change Font button for example
Workarounds
In ScreenTips.pas
procedure TScreenTipsWindow.DrawFooter;
var
  LRect: TRect;
  LTextHeight: Integer;
  LTextWidth: Integer;
  AL: Integer; // Hichem
begin
  // draw the footer
  if TScreenTipItem(FActiveItem).ShowFooter then
  begin
    // draw divider between footer and body
    Canvas.Pen.Width := 1;
    Canvas.Pen.Color := clGray;
    Canvas.MoveTo((cSpacing div 2) + 1, ClientRect.Bottom - cFooterHeight - cFooterLineHeight);
    Canvas.LineTo(ClientRect.Right - (cSpacing div 2) - 1, ClientRect.Bottom - cFooterHeight - cFooterLineHeight);
    Canvas.Pen.Color := clWhite;
    Canvas.MoveTo(cSpacing div 2, ClientRect.Bottom - cFooterHeight - 1);
    Canvas.LineTo(ClientRect.Right - (cSpacing div 2), ClientRect.Bottom - cFooterHeight - 1);

    // Hichem
    if HintControl.BiDiMode = bdLeftToRight then
    begin
      Canvas.Draw(cSpacing, ClientRect.Bottom - cFooterHeight + CenterY(FHelpBitmap.Height,
        cFooterHeight), FHelpBitmap);
      AL := DT_LEFT;
    end
    else
    begin
      Canvas.Draw(ClientRect.Right - cSpacing - FHelpBitmap.Width,
        ClientRect.Bottom - cFooterHeight + CenterY(FHelpBitmap.Height, cFooterHeight),
        FHelpBitmap);
      AL := DT_RIGHT;
    end;

    // draw footer text
    LRect := ClientRect;
    LRect.Bottom := LRect.Top;
    Canvas.Font.Style := [fsBold];
    Canvas.Font.Color := clWindowText;
    DrawText(Canvas.Handle, FFooter, -1, LRect, AL or DT_CALCRECT);
    LTextHeight := LRect.Bottom - LRect.Top;
    LRect.Top := ClientRect.Bottom - cFooterHeight + CenterY(LTextHeight, cFooterHeight);
    LTextWidth := Canvas.TextWidth(FFooter);
    // draw footer image
    if FHelpBitmap <> nil then
      if HintControl.BiDiMode = bdLeftToRight then // Hichem
        LRect.Left := cSpacing + FHelpBitmap.Width + cSpacing
      else
        LRect.Right := ClientRect.Right - cSpacing * 2 - FHelpBitmap.Width
    else
      if HintControl.BiDiMode = bdLeftToRight then // Hichem
      begin
        LRect.Left := cSpacing + cSpacing;
        LRect.Right := LRect.Left + LTextWidth;
      end;
    LRect.Bottom := LRect.Top + LTextHeight;

    DrawText(Canvas.Handle, FFooter, -1, LRect, AL);
  end;
end;
Attachment
None
Comments

None

Server Response from: ETNACODE01