View Issue Details

IDProjectCategoryView StatusLast Update
0002048JEDI VCL00 JVCL Componentspublic2004-08-25 04:24
ReporteranonymousAssigned ToAHUser 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0002048: TJvCustomcalcEdit (and descendants) crashes with large fonts
DescriptionTJvCustomcalcEdit (and descendants) crashes with large fonts. The problem is in CreatePopupCalculator at Result.ScaleBy(Screen.PixelsPerInch, 96).
Creating object at runtime I have "Control '' has no parent window"
TagsNo tags attached.

Activities

user72

2004-08-11 01:20

  ~0004988

Change your debug settings to include debug DCU's and rebuild the project. Trace into the ScaleBy call to see were it goes wrong.

yuri

2004-08-17 07:33

reporter   ~0005007

I have the same problems with JvDBCalcEdit (I receive "Access violation ..." error). The problem appear when a control call CreatePopupCalculator function.
In line (1)(see below) ScaleBy force creating a Handle for the control (TJvPopupCalculator) and for the parent control (JvDBCalcEdit).
When the Handle for TJvDBCalcEdit is creating, TJvDBCalcEdit control try to access FDataLink properties,
but the function CreatePopupCalculator was called from the constructor of TJvCustomcalcEdit and FDataLink for TJvDBCalcEdit still not created.
I think there is no need in lines (0)-(4) at all.

function CreatePopupCalculator(AOwner: TComponent
  {$IFDEF VCL}; ABiDiMode: TBiDiMode = bdLeftToRight {$ENDIF VCL}): TWinControl;
begin
  Result := TJvPopupCalculator.Create(AOwner);
  {$IFDEF VCL}
(0)if (AOwner <> nil) and not (csDesigning in AOwner.ComponentState) and
    (Screen.PixelsPerInch <> 96) then
  begin { scale to screen res }
(1) Result.ScaleBy(Screen.PixelsPerInch, 96);
    { The ScaleBy method does not scale the font well, so set the
      font back to the original info. }
(2) TJvPopupCalculator(Result).FCalcPanel.ParentFont := True;
(3) SetDefaultFont(TJvPopupCalculator(Result).Font, clPopup);
(4) Result.BiDiMode := ABiDiMode;
  end;
  {$ENDIF VCL}
end;

Daniel Simon

2004-08-20 11:12

reporter   ~0005042

We have a similar problem. Our application does not crash but the popup is not displayed correctly, cutting part of the buttons. I can send a image if it is needed.

AHUser

2004-08-20 12:10

developer   ~0005045

That is what I have seen, too. ScaleBy does not enter the "ClientWidth/ClientHeight :=" if statement. I don't know why. So I leave it to someone else to fix this.

yuri

2004-08-25 01:34

reporter   ~0005086

If current CreatePopupCalculator function replace with the follow
==begin==
function CreatePopupCalculator(AOwner: TComponent): TWinControl;
begin
  Result := TJvPopupCalculator.Create(AOwner);
end;
==end==
then everything work fine, the popup is displayed correctly (not cutting part of the buttons) and no crashes

AHUser

2004-08-25 04:24

developer   ~0005089

I have commented the code in question.

Issue History

Date Modified Username Field Change
2004-08-11 00:53 anonymous New Issue
2004-08-11 01:20 user72 Note Added: 0004988
2004-08-17 07:33 yuri Note Added: 0005007
2004-08-20 11:12 Daniel Simon Note Added: 0005042
2004-08-20 12:10 AHUser Note Added: 0005045
2004-08-25 01:34 yuri Note Added: 0005086
2004-08-25 04:24 AHUser Status new => resolved
2004-08-25 04:24 AHUser Resolution open => fixed
2004-08-25 04:24 AHUser Assigned To => AHUser
2004-08-25 04:24 AHUser Note Added: 0005089