Recent

Author Topic: [LAMW] OnClickOptionMenuItem do not work  (Read 616 times)

Odanka

  • New Member
  • *
  • Posts: 38
[LAMW] OnClickOptionMenuItem do not work
« on: December 03, 2020, 04:17:00 am »
Hi All,
Theme AppCompat.Light.NoActionBar  I use jsToolbar as ActionBar.
Code: Pascal  [Select][+][-]
  1. procedure TAMMain.AMMainCreateOptionMenu(Sender: TObject; jObjMenu: jObject);
  2. begin
  3.   Menu.Add(jObjMenu, 100, 'Seting');
  4. end;
  5.  
  6. procedure TAMMain.AMMainClickOptionMenuItem(Sender: TObject;
  7.   jObjMenuItem: jObject; itemID: integer; itemCaption: string;
  8.   Checked: boolean);
  9. begin
  10.   ShowMessage(itemCaption); //not work
  11. end;
  12.  
  13.  
   
OnClickOptionMenuItem do not work. Any solution?
Thank you very much

jmpessoa

  • Hero Member
  • *****
  • Posts: 1729
Re: [LAMW] OnClickOptionMenuItem do not work
« Reply #1 on: December 03, 2020, 06:48:10 am »

Hi, Odanka!

Can you, please,  make reference in some "AppCompat..."  demo?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Odanka

  • New Member
  • *
  • Posts: 38
Re: [LAMW] OnClickOptionMenuItem do not work
« Reply #2 on: December 03, 2020, 07:22:15 am »
Attached use jMenu and jsToolbar component (jni folder)

juank1971

  • Jr. Member
  • **
  • Posts: 97
Re: [LAMW] OnClickOptionMenuItem do not work
« Reply #3 on: December 03, 2020, 02:55:59 pm »
Yes, coincidentally I am writing to the forum that same question.

I did some tests and I see that if you change the  project options / themes to AppCompat.Light.DarkActionBar it works
but cannot use jsToolsbar




jmpessoa

  • Hero Member
  • *****
  • Posts: 1729
Re: [LAMW] OnClickOptionMenuItem do not work
« Reply #4 on: December 03, 2020, 04:57:10 pm »
Maybe, you can use jsToolbar, but not "as ActionBar".... then you need put it on top of parent
(or other position as any component...)

yes,  AppCompat.Light.NoActionBar is the pure "material design"  guide line....
(old "menu" is out....)
« Last Edit: December 03, 2020, 05:03:01 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Odanka

  • New Member
  • *
  • Posts: 38
Re: [LAMW] OnClickOptionMenuItem do not work
« Reply #5 on: December 04, 2020, 08:18:39 am »
Thank you every one.

Odanka

  • New Member
  • *
  • Posts: 38
Re: [LAMW] OnClickOptionMenuItem do not work
« Reply #6 on: December 09, 2020, 08:05:38 am »
I try to bring back the procedure SetAsActionBar of jsToolbar in unit stoolbar and uncomment procedure SetAsActionBar(). So far I get the OnClickOptionMenu work properly.
But I don't know what the side effect of this.  :)

 

TinyPortal © 2005-2018