Recent

Author Topic: ListView elements delimiting  (Read 2037 times)

zebu1er

  • New Member
  • *
  • Posts: 12
ListView elements delimiting
« on: August 22, 2019, 07:37:49 pm »
Hi,
At design time the jListView shows with separating lines between items, but at runtime the items come indistinct. The event OnDrawItemBackground may have helped to set-up an alternated background colour but it only colours the text background and not the whole item...
To circumvent that problem I thought of drawing lines (or alternated background) using a JCanvas with onAfterDispatchDraw event, but I've no idea how to process !
Could someone inspire me ?
Thanks.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: ListView elements delimiting
« Reply #1 on: August 23, 2019, 02:09:38 am »

Hi, zebu1er!

Can you put here some draft picture showing what you want to achieve?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

zebu1er

  • New Member
  • *
  • Posts: 12
Re: ListView elements delimiting
« Reply #2 on: August 23, 2019, 03:41:21 pm »
Here are the attachments :
- natural : How it looks at execution time
- event-colored : How it looked using the event OnDrawItemBackground
- line-separated : How it may look according the component Lazarus toolbar icon
- alternate-colored : How I hoped the OnDrawItemBackground to behave

ADiV

  • Jr. Member
  • **
  • Posts: 90
    • ADiV Software
Re: ListView elements delimiting
« Reply #3 on: August 26, 2019, 12:05:42 pm »
You can also use "lvItems.SetDrawAlphaBackground(0);" to define the color of the transparency and adjust it if desired or set it to 0 which will be the same as the desired color but will lose the functionality of the OnClick and OnLongClick visual feedback.
« Last Edit: August 26, 2019, 12:07:52 pm by TR3E »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: ListView elements delimiting
« Reply #4 on: August 26, 2019, 07:13:35 pm »

Ok!

There is a minor jListView improvement!

Please, update LAMW from the github
 
and try  the demo "AppListViewDemo5"


Thanks!

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

AFFRIZA 亜風実

  • Full Member
  • ***
  • Posts: 144
Re: ListView elements delimiting
« Reply #5 on: August 27, 2019, 06:23:53 am »
Please, update LAMW from the github
Nice feature ;D Next, maybe about adding a text item with a pattern.
Like this one maybe?
Kyoukai Framework: https://github.com/afuriza/kyoukai_framework

Dukung kemerdekaan Donetsk dan Lugansk! Tidak membalas profil berbendera biru-kuning apalagi ber-Bandera.

zebu1er

  • New Member
  • *
  • Posts: 12
Re: ListView elements delimiting
« Reply #6 on: September 02, 2019, 07:40:29 pm »
Hi JM,
I've just found your message.
The example looks cool, I'm going to use it in my project !
Thanks a lot for your work !

zebu1er

  • New Member
  • *
  • Posts: 12
Re: ListView elements delimiting
« Reply #7 on: September 03, 2019, 10:00:33 am »
I've tested it with success.
Again, Thanks !

 

TinyPortal © 2005-2018