Recent

Author Topic: [SOLVED] Weird behaviour adding jListview item with brackets  (Read 819 times)

jluixjurado

  • New Member
  • *
  • Posts: 21
[SOLVED] Weird behaviour adding jListview item with brackets
« on: October 05, 2022, 06:25:19 pm »
Hi there!

I've just found a extrange behaviour when adding an item to a jListview which contains brackets. You can reproduce it using, for instance, the AppDemo1 inside Listview Module.

If you add an item with the text 'hello(there' the component only displays 'there'
If you add an item with the text 'hello)there' it only displays hello
If you add an item with the text 'hello(t)here' the output is 't' (and, to my astonishment, flipping the positions of the image and the checkbox controls inside the item!!!)

Is it a bug or a hidden (to me) feature?
« Last Edit: October 12, 2022, 10:55:43 am by jluixjurado »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Weird behaviour adding jListview item with brackets
« Reply #1 on: October 06, 2022, 10:37:19 pm »
Hi, jluixjurado!


"("   and  ")"   are defaults left/right  item text delimiter/separator ....


example:

'Hello(Android)World'    will produce:


Hello                   Android               World
   
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jluixjurado

  • New Member
  • *
  • Posts: 21
Re: Weird behaviour adding jListview item with brackets
« Reply #2 on: October 06, 2022, 11:51:42 pm »
Hi, jmpessoa! Thanks for your answer.

I didn't know about those left/right delimiter properties (and I can't find them in the jListView Object Inspector Window) and, what most struck me was the change of position between the row image and the control when using both ( and ). I would like to disable the default parenthesis behaviour, but I can't sort out how.

BTW: Have been you able to read my last post in this topic (https://forum.lazarus.freepascal.org/index.php/topic,60560.0.html)? I think there could be a problem with the new INSERT method you added to jListview a week ago. If you don't have time to fix it I would like to help but I need a bit of advice because I'm not sure how things behave in LAMW (altough I have some experience in Pascal and Android Java)

Thanks again!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Weird behaviour adding jListview item with brackets
« Reply #3 on: October 08, 2022, 06:19:13 pm »
Quote
I would like to disable the default parenthesis behavior, but I can't sort out how....

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  2. begin
  3.    jListView1.SetLeftDelimiter('[');
  4.    jListView1.SetRightDelimiter(']');
  5. end;
  6.  

Quote
I'm not sure how things behave in LAMW (altough I have some experience in Pascal and Android Java ...)

Good!

You are welcome!

I can help you about how LAMW code works!


Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jluixjurado

  • New Member
  • *
  • Posts: 21
Re: Weird behaviour adding jListview item with brackets
« Reply #4 on: October 12, 2022, 10:55:16 am »
Oh!

I hadn't noticed those methods!

Thank you very much!

 

TinyPortal © 2005-2018