Forum > Android-JVM
androidr15.inc add property and TButton
(1/1)
zeljkoc:
androidr15.inc
add property component
AVView, AWTextView and AWEditText
add component TButton = class(AWButton)
inicijalize component TButton
uses StdCtrl;
https://github.com/zeljkoc/pandroid/tree/master/units/pascal
StdCtrls.pas
...
procedure btonClick(aView: AVView);
function btonLongClick(para1: AVView): jboolean;
end;
var bt: TButton;
begin
bt := TButton.Create(Self);
bt.id ;= 1;
bt.text := JLString('Ok');
bt.onClickListener := @btonClick;
bt.onClickLongListener := @btonLongClick;
...
zeljkoc:
Example TButton and TEditText
https://github.com/zeljkoc/pandroid/tree/master/example/StdCtrls
StdCtrl.apk
bt:= TButton.create(Self);
bt.ID := 1;
bt.Text := JLString('OK');
bt.onClickListener := @btClickListener;
bt.OnLongClickListener := @BtLongClickListener;
layout.addView(bt);
et:= TEditText.create(Self);
et.Text := JLString('eeee');
et.onChangeText := @etChangeText;
layout.addView(et);
zeljkoc:
Add component
TCheckBox
procedure cbCheckCange (para1: AWCompoundButton; para2: jboolean);
cb:= TCheckBox.create(Self);
cb.Text := JLString('CheckBox');
cb.onCheckedChangedListener := @cbCheckCange;
layout.addView(cb);
zeljkoc:
add
TRadioGroup and TRadioButton
rg:= TRadioGroup.create(Self);
rg.Orientation := 0;
layout.addView(rg);
rb:= TRadioButton.create(self);
rb.Text := JLString('RadioButton');
rb.onCheckedChangedListener := @cbCheckCange;
rg.addView(rb);
rb:= TRadioButton.create(self);
rb.Text := JLString('RadioButton');
rb.onCheckedChangedListener := @cbCheckCange;
rg.addView(rb);
zeljkoc:
add unit DB;
https://github.com/zeljkoc/pandroid/blob/master/units/pascal/DB.pas
var
Fields: TFieldDef;
Fields:= TFieldDef.create;
Fields.AddField(JLString('Ime'), ftString);
Fields.AddField(JLString('Prezime'), ftString);
Fields.Value[1].AsHex := JLString('FF');
et.Text := Fields.Value[1].AsString;
Navigation
[0] Message Index