× CodeTyphon Cross-Build Development, discussions and problems

Question Android compiling

  • Fer Castro
  • Fer Castro's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #10629 by Fer Castro
Android compiling was created by Fer Castro
Hello

I am testing android CP Compiling and I get the following erros:

Ecustomdrawnwsforms_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);

I have only one main form, no more components. Any clue?

Thanks in advance and best regards!!

GFCG

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #10630 by Matis A.
Replied by Matis A. on topic Android compiling
Please, your CT version ?

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Fer Castro
  • Fer Castro's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #10631 by Fer Castro
Replied by Fer Castro on topic Android compiling
FPC 3.1.1

Revision SVN 54036

CodeTyphon Studio 6.00

Release date: 30-Jan-2017


Thanks and Regarads!!

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #10632 by Matis A.
Replied by Matis A. on topic Android compiling
Please,
replace at
C:\codetyphon\typhon\lcl\interfaces\customdrawn\ or
/usr/local/codetyphon/lcl/interfaces/customdrawn/

2 fix files from attach zip

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Fer Castro
  • Fer Castro's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #10633 by Fer Castro
Replied by Fer Castro on topic Android compiling
Files updated, and the result:


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: 4
customdrawnproc.pas(89,17) Warning: An inherited method is hidden by "constructor Create;"
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(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


Regards!!

Please Log in or Create an account to join the conversation.

  • Fer Castro
  • Fer Castro's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #10652 by Fer Castro
Replied by Fer Castro on topic Android compiling
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_android
class 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

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 8 months ago #10653 by Sternas Stefanos
Replied by Sternas Stefanos on topic Android compiling
Sir
you must wait for CT 6.10 release
we fix this problem

PilotLogic Architect and Core Programmer
The following user(s) said Thank You: Fer Castro

Please Log in or Create an account to join the conversation.

  • Fer Castro
  • Fer Castro's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #10655 by Fer Castro
Replied by Fer Castro on topic Android compiling
Sternas

Thanks a lot for your quick response.

Regards!!

Fer

Please Log in or Create an account to join the conversation.