Hello
I am trying to compile a simple applicaation for android, and I get error in the following functions:
customdrawnobject_win.inc
function Java_com_pascal_lclproject_LCLActivity_LCLOnConfigurationChanged(
env:PJNIEnv; this:jobject; ANewDPI, ANewWidth: jint): jint; cdecl;
var
lForm: TCDNonNativeForm;
lOldDPI, lNewDPI, lOldFormWidth, lNewFormWidth: Integer;
i: Integer;
begin
for i := 0 to GetFormCount()-1 do
begin
lForm := GetForm(i);
if lForm.LayoutAutoAdjusted then lOldDPI := Screen.PixelsPerInch
else lOldDPI := lForm.LCLForm.DesignTimePPI;
lNewDPI := ANewDPI;
lOldFormWidth := lForm.LCLForm.Width;
lNewFormWidth := ANewWidth;
DebugLn(Format('[LCLOnConfigurationChanged] i=%d lOldDPI=%d lNewDPI=%d lOldFormWidth=%d lNewFormWidth=%d',
[i, lOldDPI, lNewDPI, lOldFormWidth, lNewFormWidth]));
//-- GFCG. The following function rises error
lForm.LCLForm.AutoAdjustLayout(lapAutoAdjustWithoutHorizontalScrolling,
lOldDPI, lNewDPI, lOldFormWidth, lNewFormWidth);
end;
// Update the font size
CDWidgetset.DefaultFontAndroidSize := Round(16 * (ANewDPI / 125));
end;
customdrawnwsforms_androidclass procedure TCDWSCustomForm.ShowHide(const AWinControl: TWinControl);
var
lForm: TCDNonNativeForm;
begin
{$ifdef VerboseCDForms}
DebugLn(Format(':>[TCDWSCustomForm.ShowHide] AWinControl=%x Handle=%x',
[PtrInt(AWinControl), PtrInt(AWinControl.Handle)]));
{$endif}
lForm := TCDNonNativeForm(AWinControl.Handle);
if AWinControl.Visible then
begin
{$ifdef VerboseCDForms}
DebugLn(':<[TCDWSCustomForm.ShowHide] Showed');
{$endif}
ShowForm(lForm);
// if this is the first time we are showing the form adjust its layout
if not lForm.LayoutAutoAdjusted then
begin
DebugLn(Format('[TCDWSCustomForm.ShowHide] First form layout adjustment '
+ 'lOldDPI=%d lNewDPI=%d lOldFormWidth=%d lNewFormWidth=%d',
[lForm.LCLForm.DesignTimePPI, Screen.PixelsPerInch, lForm.LCLForm.Width, Screen.Width]));
lForm.LayoutAutoAdjusted := True;
//-- GFCG. The following code rises error
lForm.LCLForm.AutoAdjustLayout(lapAutoAdjustWithoutHorizontalScrolling,
lForm.LCLForm.DesignTimePPI,
Screen.PixelsPerInch, lForm.LCLForm.Width, Screen.Width);
LCLIntf.InvalidateRect(HWND(lForm), nil, False);
// if necessary adjust the form coordinates
if not (lForm.LCLForm.BorderStyle in [bsDialog, bsNone]) then
begin
lForm.LCLForm.Left := 0;
lForm.LCLForm.Top := 0;
end;
end;
end
else
begin
HideForm(lForm);
{$ifdef VerboseCDForms}
DebugLn(':<[TCDWSCustomForm.ShowHide] Hided');
{$endif}
end;
end;
I replaced the files you sent me before but after that I can't compile. Also I copy the messages I get when I try to compile.
Compile checks, Sugerencias: 2
Note: package LCL 6.0.1: passing compiler option -g twice with different values
Note: package LCL 6.0.1: passing compiler option -gl twice with different values
Compile package LCL 6.0.1: Código de salida 1, Errores: 2, Advertencias: 3, Sugerencias: 1
customdrawnwsforms_android.inc(1,2) Warning: Illegal compiler directive "$MAINFORM"
customdrawnwsforms_android.inc(6,32) Warning: Function result does not seem to be set
customdrawnwsforms_android.inc(25,3) Hint: Local absolutevar "AForm" is not used
customdrawnwsforms_android.inc(103,65) Error: Wrong number of parameters specified for call to "AutoAdjustLayout"
wincontrol.inc(3838,23) Error: Found declaration: AutoAdjustLayout(TLayoutAdjustmentPolicy;const LongInt;const LongInt;const LongInt;const LongInt;const Boolean);
customdrawnwsforms_android.inc(140,24) Warning: Comment level 2 found
Hope You can help me. Regards!!
Fer