'canvas does not allow drawing'
'canvas does not allow drawing'
I have just upgraded TsiLang from 5.3.2 to 6.0 in Delphi 5.
All of my previously written applications give a 'canvas does not allow drawing' error message upon compilation.
In a new blank application, dropping a siLangCombo onto the form gives the same error.
Any help would be appreciated.
All of my previously written applications give a 'canvas does not allow drawing' error message upon compilation.
In a new blank application, dropping a siLangCombo onto the form gives the same error.
Any help would be appreciated.
Open siLangCombo unit and replace TsiLangCombo.MeasureItem() with the following code (as temporary fix):
We will investigate the case (this wrong behavior only under Delphi 4 and 5) and will implement the permanent fix.
Thank you for information!
Code: Select all
procedure TsiLangCombo.MeasureItem(Index: Integer; var Height: Integer);
begin
inherited;
end;
Thank you for information!
Best regards,
Igor Siticov.
Igor Siticov.
The following modifications needed:
We will re-create builds on web site asap. Thank you for reporting!
Code: Select all
procedure TsiLangCombo.MeasureItem(Index: Integer; var Height: Integer);
var
{$IFNDEF DELPHI6}
CC: TControlCanvas;
{$ENDIF}
I: Integer;
begin
if Assigned(OnMeasureItem) then
OnMeasureItem(Self, Index, Height)
else
begin
{$IFNDEF DELPHI6}
I := Height;
CC := TControlCanvas.Create;
try
CC.Control := Self;
if CC.Handle <> 0 then
I := CC.TextHeight('H') + 3;
finally
CC.Free;
end;
{$ELSE}
I := Canvas.TextHeight('H') + 3;
{$ENDIF}
if I > Height then
Height := I;
end;
end;
Best regards,
Igor Siticov.
Igor Siticov.
Still having trouble with the siLangCombo component in Delphi 5.
In design mode, double-clicking used to give the property editor, but now gives the 'canvas does not allow drawing' error.
The error eventually disappears after repeated clicking of the OK button and then gives the property editor.
I have repeated this behaviour occur using a blank form containing only a siLangDispatcher component and a siLangCombo component.
Any help would be appreciated.
In design mode, double-clicking used to give the property editor, but now gives the 'canvas does not allow drawing' error.
The error eventually disappears after repeated clicking of the OK button and then gives the property editor.
I have repeated this behaviour occur using a blank form containing only a siLangDispatcher component and a siLangCombo component.
Any help would be appreciated.
I have now downloaded the updated version.
Still gives the same effect:
On double-clicking the siComboBox during design-time, it gives the 'canvas does not allow drawing' error. After clicking the ok button of the error message a number of times, the language settings box finally appears.
Regards
Philip
Still gives the same effect:
On double-clicking the siComboBox during design-time, it gives the 'canvas does not allow drawing' error. After clicking the ok button of the error message a number of times, the language settings box finally appears.
Regards
Philip
Updated builds will be available for download during next days. Meantime you can fix this manually on your side:
1. Open _siComboPropEd.pas unit
2. Modify procedure TfrmSiLangComboEditor.cbFlagsMeasureItem as following:
3. Re-build TsiLang package.
Sorry for any inconvenience.
1. Open _siComboPropEd.pas unit
2. Modify procedure TfrmSiLangComboEditor.cbFlagsMeasureItem as following:
Code: Select all
procedure TfrmSiLangComboEditor.cbFlagsMeasureItem(Control: TWinControl;
Index: Integer; var Height: Integer);
begin
try
Height := cbFlags.Canvas.TextHeight('H') + 4;
except
end;
end;
Sorry for any inconvenience.
Best regards,
Igor Siticov.
Igor Siticov.