You've already forked lazarus-ccr
android: Uses the new logging mechanism
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1879 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -72,7 +72,10 @@ public class AndroidAll
|
|||||||
static final int amkUI_TViewGroup_LayoutParams_Create_0 = 0x00109000;
|
static final int amkUI_TViewGroup_LayoutParams_Create_0 = 0x00109000;
|
||||||
// View
|
// View
|
||||||
static final int amkUI_TView_setLayoutParams_0 = 0x0010A000;
|
static final int amkUI_TView_setLayoutParams_0 = 0x0010A000;
|
||||||
static final int amkUI_TView_setVisibility_1 = 0x0010A001;
|
static final int amkUI_TView_setOnClickListener_1 = 0x0010A001;
|
||||||
|
static final int amkUI_TView_OnClickListener_Start_2 = 0x0010A002;
|
||||||
|
static final int amkUI_TView_OnClickListener_Finished_3 = 0x0010A003;
|
||||||
|
static final int amkUI_TView_setVisibility_4 = 0x0010A004;
|
||||||
// ViewGroup
|
// ViewGroup
|
||||||
static final int amkUI_TViewGroup_addView_0 = 0x0010B000;
|
static final int amkUI_TViewGroup_addView_0 = 0x0010B000;
|
||||||
static final int amkUI_TViewGroup_addView_1 = 0x0010B001;
|
static final int amkUI_TViewGroup_addView_1 = 0x0010B001;
|
||||||
@ -88,12 +91,9 @@ public class AndroidAll
|
|||||||
static final int amkUI_TAbsoluteLayout_LayoutParams_Create_0 = 0x0010E000;
|
static final int amkUI_TAbsoluteLayout_LayoutParams_Create_0 = 0x0010E000;
|
||||||
// TextView
|
// TextView
|
||||||
static final int amkUI_TTextView_Create_0 = 0x0010F000;
|
static final int amkUI_TTextView_Create_0 = 0x0010F000;
|
||||||
static final int amkUI_TTextView_setText_1 = 0x0010F001;
|
static final int amkUI_TTextView_getText_1 = 0x0010F001;
|
||||||
static final int amkUI_TTextView_setOnClickListener_2 = 0x0010F002;
|
static final int amkUI_TTextView_setText_2 = 0x0010F002;
|
||||||
static final int amkUI_TTextView_OnClickListener_Start_3 = 0x0010F003;
|
static final int amkUI_TTextView_setTextSize_3 = 0x0010F003;
|
||||||
static final int amkUI_TTextView_OnClickListener_Finished_4 = 0x0010F004;
|
|
||||||
static final int amkUI_TTextView_setTextSize_5 = 0x0010F005;
|
|
||||||
static final int amkUI_TTextView_getText_6 = 0x0010F006;
|
|
||||||
// EditText
|
// EditText
|
||||||
static final int amkUI_TEditText_Create_0 = 0x00110000;
|
static final int amkUI_TEditText_Create_0 = 0x00110000;
|
||||||
// Button
|
// Button
|
||||||
@ -498,9 +498,36 @@ public class AndroidAll
|
|||||||
param_self_View.setLayoutParams(lViewGroup_LayoutParams_1);
|
param_self_View.setLayoutParams(lViewGroup_LayoutParams_1);
|
||||||
MyAndroidPipesComm.SendResult();
|
MyAndroidPipesComm.SendResult();
|
||||||
break;
|
break;
|
||||||
|
// callbacksetter void setOnClickListener($View.OnClickListener l)
|
||||||
|
case amkUI_TView_setOnClickListener_1:
|
||||||
|
DebugOut("amkUI_TView_setOnClickListener_1");
|
||||||
|
// Self
|
||||||
|
lInt = MyAndroidPipesComm.GetInt();
|
||||||
|
param_self_View = (View) ViewElements.get(lInt);
|
||||||
|
// params
|
||||||
|
lPascalPointer = MyAndroidPipesComm.GetInt();
|
||||||
|
ViewElementsTags.set(lInt, new Integer(lPascalPointer));
|
||||||
|
|
||||||
|
// Run the code
|
||||||
|
param_self_View.setOnClickListener( new View.OnClickListener()
|
||||||
|
{
|
||||||
|
public void onClick(View v)
|
||||||
|
{
|
||||||
|
// Perform action
|
||||||
|
DebugOut("START View.OnClickListener");
|
||||||
|
MyAndroidPipesComm.SendMessage(AndroidPipesComm.amkUICommand, amkUI_TView_OnClickListener_Start_2);
|
||||||
|
Integer lTag = (Integer) ViewElementsTags.get(ViewElements.indexOf(v));
|
||||||
|
MyAndroidPipesComm.SendInt(lTag.intValue());
|
||||||
|
MyAndroidPipesComm.WaitForPascalMessage(AndroidPipesComm.amkUICommand, amkUI_TView_OnClickListener_Finished_3);
|
||||||
|
DebugOut("END View.OnClickListener");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
MyAndroidPipesComm.SendResult();
|
||||||
|
break;
|
||||||
// method void setVisibility(int visibility);
|
// method void setVisibility(int visibility);
|
||||||
case amkUI_TView_setVisibility_1:
|
case amkUI_TView_setVisibility_4:
|
||||||
DebugOut("amkUI_TView_setVisibility_1");
|
DebugOut("amkUI_TView_setVisibility_4");
|
||||||
// Self
|
// Self
|
||||||
lInt = MyAndroidPipesComm.GetInt();
|
lInt = MyAndroidPipesComm.GetInt();
|
||||||
param_self_View = (View) ViewElements.get(lInt);
|
param_self_View = (View) ViewElements.get(lInt);
|
||||||
@ -629,9 +656,20 @@ public class AndroidAll
|
|||||||
ViewElementsTags.add(null);
|
ViewElementsTags.add(null);
|
||||||
MyAndroidPipesComm.SendIntResult(ViewElements.size() - 1);
|
MyAndroidPipesComm.SendIntResult(ViewElements.size() - 1);
|
||||||
break;
|
break;
|
||||||
|
// method CharSequence getText()
|
||||||
|
case amkUI_TTextView_getText_1:
|
||||||
|
DebugOut("amkUI_TTextView_getText_1");
|
||||||
|
// Self
|
||||||
|
lInt = MyAndroidPipesComm.GetInt();
|
||||||
|
param_self_TextView = (TextView) ViewElements.get(lInt);
|
||||||
|
// params
|
||||||
|
//
|
||||||
|
lResult_CharSequence = param_self_TextView.getText();
|
||||||
|
MyAndroidPipesComm.SendStringResult(lResult_CharSequence);
|
||||||
|
break;
|
||||||
// method void setText(CharSequence AText);
|
// method void setText(CharSequence AText);
|
||||||
case amkUI_TTextView_setText_1:
|
case amkUI_TTextView_setText_2:
|
||||||
DebugOut("amkUI_TTextView_setText_1");
|
DebugOut("amkUI_TTextView_setText_2");
|
||||||
// Self
|
// Self
|
||||||
lInt = MyAndroidPipesComm.GetInt();
|
lInt = MyAndroidPipesComm.GetInt();
|
||||||
param_self_TextView = (TextView) ViewElements.get(lInt);
|
param_self_TextView = (TextView) ViewElements.get(lInt);
|
||||||
@ -642,36 +680,9 @@ public class AndroidAll
|
|||||||
param_self_TextView.setText(lCharSequence_1);
|
param_self_TextView.setText(lCharSequence_1);
|
||||||
MyAndroidPipesComm.SendResult();
|
MyAndroidPipesComm.SendResult();
|
||||||
break;
|
break;
|
||||||
// callbacksetter void setOnClickListener($View.OnClickListener l)
|
|
||||||
case amkUI_TTextView_setOnClickListener_2:
|
|
||||||
DebugOut("amkUI_TTextView_setOnClickListener_2");
|
|
||||||
// Self
|
|
||||||
lInt = MyAndroidPipesComm.GetInt();
|
|
||||||
param_self_TextView = (TextView) ViewElements.get(lInt);
|
|
||||||
// params
|
|
||||||
lPascalPointer = MyAndroidPipesComm.GetInt();
|
|
||||||
ViewElementsTags.set(lInt, new Integer(lPascalPointer));
|
|
||||||
|
|
||||||
// Run the code
|
|
||||||
param_self_TextView.setOnClickListener( new View.OnClickListener()
|
|
||||||
{
|
|
||||||
public void onClick(View v)
|
|
||||||
{
|
|
||||||
// Perform action
|
|
||||||
DebugOut("START View.OnClickListener");
|
|
||||||
MyAndroidPipesComm.SendMessage(AndroidPipesComm.amkUICommand, amkUI_TTextView_OnClickListener_Start_3);
|
|
||||||
Integer lTag = (Integer) ViewElementsTags.get(ViewElements.indexOf(v));
|
|
||||||
MyAndroidPipesComm.SendInt(lTag.intValue());
|
|
||||||
MyAndroidPipesComm.WaitForPascalMessage(AndroidPipesComm.amkUICommand, amkUI_TTextView_OnClickListener_Finished_4);
|
|
||||||
DebugOut("END View.OnClickListener");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
MyAndroidPipesComm.SendResult();
|
|
||||||
break;
|
|
||||||
// method void setTextSize(int unit_; float size);
|
// method void setTextSize(int unit_; float size);
|
||||||
case amkUI_TTextView_setTextSize_5:
|
case amkUI_TTextView_setTextSize_3:
|
||||||
DebugOut("amkUI_TTextView_setTextSize_5");
|
DebugOut("amkUI_TTextView_setTextSize_3");
|
||||||
// Self
|
// Self
|
||||||
lInt = MyAndroidPipesComm.GetInt();
|
lInt = MyAndroidPipesComm.GetInt();
|
||||||
param_self_TextView = (TextView) ViewElements.get(lInt);
|
param_self_TextView = (TextView) ViewElements.get(lInt);
|
||||||
@ -684,17 +695,6 @@ public class AndroidAll
|
|||||||
param_self_TextView.setTextSize(lint_1, lfloat_2);
|
param_self_TextView.setTextSize(lint_1, lfloat_2);
|
||||||
MyAndroidPipesComm.SendResult();
|
MyAndroidPipesComm.SendResult();
|
||||||
break;
|
break;
|
||||||
// method CharSequence getText()
|
|
||||||
case amkUI_TTextView_getText_6:
|
|
||||||
DebugOut("amkUI_TTextView_getText_6");
|
|
||||||
// Self
|
|
||||||
lInt = MyAndroidPipesComm.GetInt();
|
|
||||||
param_self_TextView = (TextView) ViewElements.get(lInt);
|
|
||||||
// params
|
|
||||||
//
|
|
||||||
lResult_CharSequence = param_self_TextView.getText();
|
|
||||||
MyAndroidPipesComm.SendStringResult(lResult_CharSequence);
|
|
||||||
break;
|
|
||||||
case amkUI_TEditText_Create_0:
|
case amkUI_TEditText_Create_0:
|
||||||
DebugOut("amkUI_TEditText_Create_0");
|
DebugOut("amkUI_TEditText_Create_0");
|
||||||
ViewElements.add(new EditText(activity));
|
ViewElements.add(new EditText(activity));
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
object Form2: TForm2
|
object Form2: TForm2
|
||||||
Left = 181
|
Left = 181
|
||||||
Height = 240
|
Height = 276
|
||||||
Top = 137
|
Top = 137
|
||||||
Width = 320
|
Width = 320
|
||||||
Caption = 'Form2'
|
Caption = 'Form2'
|
||||||
ClientHeight = 240
|
ClientHeight = 276
|
||||||
ClientWidth = 320
|
ClientWidth = 320
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '0.9.31'
|
||||||
object Button1: TButton
|
object Button1: TButton
|
||||||
Left = 33
|
Left = 33
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 35
|
Top = 48
|
||||||
Width = 87
|
Width = 87
|
||||||
Caption = 'Button1'
|
Caption = 'Button1'
|
||||||
OnClick = Button1Click
|
OnClick = Button1Click
|
||||||
@ -19,7 +19,7 @@ object Form2: TForm2
|
|||||||
object CheckBox1: TCheckBox
|
object CheckBox1: TCheckBox
|
||||||
Left = 33
|
Left = 33
|
||||||
Height = 21
|
Height = 21
|
||||||
Top = 88
|
Top = 101
|
||||||
Width = 94
|
Width = 94
|
||||||
Caption = 'CheckBox1'
|
Caption = 'CheckBox1'
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -27,7 +27,7 @@ object Form2: TForm2
|
|||||||
object Edit1: TEdit
|
object Edit1: TEdit
|
||||||
Left = 33
|
Left = 33
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 144
|
Top = 157
|
||||||
Width = 99
|
Width = 99
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
Text = 'Edit1'
|
Text = 'Edit1'
|
||||||
@ -35,7 +35,7 @@ object Form2: TForm2
|
|||||||
object StaticText1: TStaticText
|
object StaticText1: TStaticText
|
||||||
Left = 147
|
Left = 147
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 36
|
Top = 49
|
||||||
Width = 65
|
Width = 65
|
||||||
Caption = 'StaticText1'
|
Caption = 'StaticText1'
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
@ -43,7 +43,7 @@ object Form2: TForm2
|
|||||||
object ComboBox1: TComboBox
|
object ComboBox1: TComboBox
|
||||||
Left = 136
|
Left = 136
|
||||||
Height = 27
|
Height = 27
|
||||||
Top = 88
|
Top = 101
|
||||||
Width = 112
|
Width = 112
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
@ -57,7 +57,7 @@ object Form2: TForm2
|
|||||||
object Edit2: TEdit
|
object Edit2: TEdit
|
||||||
Left = 147
|
Left = 147
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 144
|
Top = 157
|
||||||
Width = 80
|
Width = 80
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
Text = 'Edit2'
|
Text = 'Edit2'
|
||||||
@ -65,7 +65,7 @@ object Form2: TForm2
|
|||||||
object Button2: TButton
|
object Button2: TButton
|
||||||
Left = 35
|
Left = 35
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 186
|
Top = 199
|
||||||
Width = 75
|
Width = 75
|
||||||
Caption = 'InputBox'
|
Caption = 'InputBox'
|
||||||
OnClick = Button2Click
|
OnClick = Button2Click
|
||||||
|
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
StdCtrls;
|
StdCtrls, DbCtrls, ExtCtrls, InterfaceBase;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -33,10 +33,6 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$ifdef LCLAndroid}
|
|
||||||
uses androidpipescomm;
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
{ TForm2 }
|
{ TForm2 }
|
||||||
|
|
||||||
procedure TForm2.Button1Click(Sender: TObject);
|
procedure TForm2.Button1Click(Sender: TObject);
|
||||||
@ -47,19 +43,13 @@ begin
|
|||||||
if CheckBox1.Checked then lChecked := 'True'
|
if CheckBox1.Checked then lChecked := 'True'
|
||||||
else lChecked := 'False';
|
else lChecked := 'False';
|
||||||
|
|
||||||
{$ifdef LCLAndroid}
|
WidgetSet.DebugLogLn('3');
|
||||||
vAndroidPipesComm.Log('3');
|
|
||||||
{$endif}
|
|
||||||
lEdit1Text := Edit1.Text;
|
lEdit1Text := Edit1.Text;
|
||||||
|
|
||||||
{$ifdef LCLAndroid}
|
WidgetSet.DebugLogLn('4');
|
||||||
vAndroidPipesComm.Log('4');
|
|
||||||
{$endif}
|
|
||||||
lComboBox := IntToStr(ComboBox1.ItemIndex);
|
lComboBox := IntToStr(ComboBox1.ItemIndex);
|
||||||
|
|
||||||
{$ifdef LCLAndroid}
|
WidgetSet.DebugLogLn('5');
|
||||||
vAndroidPipesComm.Log('5');
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
Edit2.Text :=
|
Edit2.Text :=
|
||||||
'Edit1.Text='+lEdit1Text+LineEnding+
|
'Edit1.Text='+lEdit1Text+LineEnding+
|
||||||
@ -72,13 +62,9 @@ end;
|
|||||||
|
|
||||||
procedure TForm2.Button2Click(Sender: TObject);
|
procedure TForm2.Button2Click(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
{$ifdef LCLAndroid}
|
WidgetSet.DebugLogLn('TForm2.Button2Click');
|
||||||
vAndroidPipesComm.Log('TForm2.Button2Click');
|
|
||||||
{$endif}
|
|
||||||
InputBox('Caption', 'Prompt', 'Default');
|
InputBox('Caption', 'Prompt', 'Default');
|
||||||
{$ifdef LCLAndroid}
|
WidgetSet.DebugLogLn('TForm2.Button2Click 2');
|
||||||
vAndroidPipesComm.Log('TForm2.Button2Click');
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
Reference in New Issue
Block a user