mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 12:37:23 +01:00
Small improvement to lcl-android
git-svn-id: trunk@31732 -
This commit is contained in:
parent
3819207b32
commit
53de325aa6
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5200,6 +5200,7 @@ lcl/interfaces/android/Makefile svneol=native#text/pascal
|
||||
lcl/interfaces/android/Makefile.compiled svneol=native#text/pascal
|
||||
lcl/interfaces/android/Makefile.fpc svneol=native#text/text
|
||||
lcl/interfaces/android/alllclintfunits.pas svneol=native#text/pascal
|
||||
lcl/interfaces/android/android_all.pas svneol=native#text/pascal
|
||||
lcl/interfaces/android/androidint.pas svneol=native#text/pascal
|
||||
lcl/interfaces/android/androidobject.inc svneol=native#text/pascal
|
||||
lcl/interfaces/android/androidprivate.pas svneol=native#text/pascal
|
||||
|
||||
70
lcl/interfaces/android/android_all.pas
Normal file
70
lcl/interfaces/android/android_all.pas
Normal file
@ -0,0 +1,70 @@
|
||||
unit ;
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
TCompoundButton = class(TButton)
|
||||
public
|
||||
function isChecked(): Boolean;
|
||||
function performClick(): Boolean;
|
||||
procedure setChecked(checked: Boolean);
|
||||
procedure toggle();
|
||||
end;
|
||||
|
||||
TCheckBox = class(TCompoundButton)
|
||||
public
|
||||
constructor Create();
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
// TCompoundButton
|
||||
amkUI_TCompoundButton_isChecked = $00101000;
|
||||
amkUI_TCompoundButton_performClick = $00101001;
|
||||
amkUI_TCompoundButton_setChecked = $00101002;
|
||||
amkUI_TCompoundButton_toggle = $00101003;
|
||||
// TCheckBox
|
||||
amkUI_TCheckBox_Create = $00102000;
|
||||
|
||||
function TCompoundButton.isChecked(): Boolean;
|
||||
begin
|
||||
vAndroidPipesComm.SendByte(ShortInt(amkUICommand));
|
||||
vAndroidPipesComm.SendInt(amkUI_TCompoundButton_isChecked);
|
||||
vAndroidPipesComm.SendInt(Index); // Self, Java Pointer
|
||||
Result := Boolean(vAndroidPipesComm.WaitForIntReturn());
|
||||
end;
|
||||
|
||||
function TCompoundButton.performClick(): Boolean;
|
||||
begin
|
||||
vAndroidPipesComm.SendByte(ShortInt(amkUICommand));
|
||||
vAndroidPipesComm.SendInt(amkUI_TCompoundButton_performClick);
|
||||
vAndroidPipesComm.SendInt(Index); // Self, Java Pointer
|
||||
Result := Boolean(vAndroidPipesComm.WaitForIntReturn());
|
||||
end;
|
||||
|
||||
procedure TCompoundButton.setChecked(checked: Boolean);
|
||||
begin
|
||||
vAndroidPipesComm.SendByte(ShortInt(amkUICommand));
|
||||
vAndroidPipesComm.SendInt(amkUI_TCompoundButton_setChecked);
|
||||
vAndroidPipesComm.SendInt(Index); // Self, Java Pointer
|
||||
vAndroidPipesComm.SendInt(Integer(checked));
|
||||
vAndroidPipesComm.WaitForReturn();
|
||||
end;
|
||||
|
||||
procedure TCompoundButton.toggle();
|
||||
begin
|
||||
vAndroidPipesComm.SendByte(ShortInt(amkUICommand));
|
||||
vAndroidPipesComm.SendInt(amkUI_TCompoundButton_toggle);
|
||||
vAndroidPipesComm.SendInt(Index); // Self, Java Pointer
|
||||
vAndroidPipesComm.WaitForReturn();
|
||||
end;
|
||||
|
||||
constructor TCheckBox.Create();
|
||||
begin
|
||||
vAndroidPipesComm.SendByte(ShortInt(amkUICommand));
|
||||
vAndroidPipesComm.SendInt(amkUI_TCheckBox_Create);
|
||||
Index := vAndroidPipesComm.WaitForIntReturn();
|
||||
end;
|
||||
|
||||
end.
|
||||
@ -27,7 +27,7 @@ interface
|
||||
|
||||
uses
|
||||
// libs
|
||||
// MacOSAll,
|
||||
android_all,
|
||||
// wdgetset
|
||||
WSLCLClasses, LCLClasses,
|
||||
// LCL + RTL
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<Package Version="3">
|
||||
<Package Version="4">
|
||||
<Name Value="LCL"/>
|
||||
<AddToProjectUsesSection Value="False"/>
|
||||
<Author Value="Lazarus"/>
|
||||
<CompilerOptions>
|
||||
<Version Value="10"/>
|
||||
@ -110,7 +109,7 @@ end;"/>
|
||||
<License Value="modified LGPL-2
|
||||
"/>
|
||||
<Version Major="1" Release="1"/>
|
||||
<Files Count="335">
|
||||
<Files Count="336">
|
||||
<Item1>
|
||||
<Filename Value="android/androidint.pas"/>
|
||||
<AddToUsesPkgSection Value="False"/>
|
||||
@ -1673,6 +1672,10 @@ end;"/>
|
||||
<AddToUsesPkgSection Value="False"/>
|
||||
<UnitName Value="cocoawsbuttons"/>
|
||||
</Item335>
|
||||
<Item336>
|
||||
<Filename Value="android/alllclintfunits.pas"/>
|
||||
<UnitName Value="alllclintfunits"/>
|
||||
</Item336>
|
||||
</Files>
|
||||
<LazDoc Paths="../../docs/xml/lcl"/>
|
||||
<i18n>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user