View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002048 | JEDI VCL | 00 JVCL Components | public | 2004-08-11 00:53 | 2004-08-25 04:24 |
Reporter | anonymous | Assigned To | AHUser | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0002048: TJvCustomcalcEdit (and descendants) crashes with large fonts | ||||
Description | TJvCustomcalcEdit (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" | ||||
Tags | No tags attached. | ||||
|
Change your debug settings to include debug DCU's and rebuild the project. Trace into the ScaleBy call to see were it goes wrong. |
|
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; |
|
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. |
|
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. |
|
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 |
|
I have commented the code in question. |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-08-11 00:53 | anonymous | New Issue | |
2004-08-11 01:20 |
|
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 |