Recent

Author Topic: androidr15.inc add property and TButton  (Read 4620 times)

zeljkoc

  • Full Member
  • ***
  • Posts: 100
    • Zeljko Cvijanovic
androidr15.inc add property and TButton
« on: November 17, 2016, 11:34:15 pm »
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;
...


 



« Last Edit: November 18, 2016, 08:08:03 am by zeljkoc »

zeljkoc

  • Full Member
  • ***
  • Posts: 100
    • Zeljko Cvijanovic
Re: androidr15.inc add property and TButton
« Reply #1 on: November 23, 2016, 05:05:06 pm »
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

  • Full Member
  • ***
  • Posts: 100
    • Zeljko Cvijanovic
Re: androidr15.inc add property and TButton
« Reply #2 on: November 25, 2016, 06:25:04 pm »
Add component
TCheckBox

 procedure cbCheckCange (para1: AWCompoundButton; para2: jboolean); 

    cb:= TCheckBox.create(Self);
    cb.Text := JLString('CheckBox');
    cb.onCheckedChangedListener := @cbCheckCange;
  layout.addView(cb);


zeljkoc

  • Full Member
  • ***
  • Posts: 100
    • Zeljko Cvijanovic
Re: androidr15.inc add property and TButton
« Reply #3 on: November 26, 2016, 05:07:22 pm »
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

  • Full Member
  • ***
  • Posts: 100
    • Zeljko Cvijanovic
Re: androidr15.inc add property and TButton
« Reply #4 on: December 04, 2016, 04:48:01 pm »
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;

« Last Edit: December 05, 2016, 05:48:49 am by zeljkoc »