Lazarus

Programming => Operating Systems => Android => Topic started by: Robert Gilland on April 09, 2019, 03:45:26 pm

Title: LAMW and Custom Drawing jListView Items
Post by: Robert Gilland on April 09, 2019, 03:45:26 pm
I have been looking without any success for something that will allow me to custom draw a listview item.

Or maybe another Component I could use to do this?

An event like:

jListView.OnCustomDrawListViewItem( index : Integer; canvas :TCanvas  ).

Then I could place all my elements where I need them to be like:

Canvas.DrawBitMap( 0,0, 10, 10, MyRetrievedBitMap )

Canvas.DrawText( 10,0,0,0, "Some Text')


etc
Title: Re: LAMW and Custom Drawing jListView Items
Post by: howardpc on April 09, 2019, 04:11:39 pm
I'm not familiar with jListView.
However, the bog-standard LCL TListView offers three 'custom' events, you can choose which one might meet your needs (they have differing parameter signatures):
Title: Re: LAMW and Custom Drawing jListView Items
Post by: Robert Gilland on April 09, 2019, 11:53:50 pm
jListView is part of the LAMW Library, built for mobile Apps on Android, which have to deal with rotating screens.
Title: Re: LAMW and Custom Drawing jListView Items
Post by: jmpessoa on April 09, 2019, 11:59:46 pm

Hi, Robert.

What [jListView] text layout you nedd?

some hint:    left(center|centerbelow)right

the tags '(' and '|' will layout your text!
Title: Re: LAMW and Custom Drawing jListView Items
Post by: Robert Gilland on April 10, 2019, 12:17:06 am
Well the current jListview requirement is a simple <Image>.png| Long Description Text

But I foresee further jListViews will need maybe jGridView as they deal with Product data and therefore maybe multiple objects arranged in one List Item.
Title: Re: LAMW and Custom Drawing jListView Items
Post by: Robert Gilland on April 10, 2019, 01:41:33 am
Also, what sets the height of a jListItem of jListVIew? No setting I choose seems to do anything.
Title: Re: LAMW and Custom Drawing jListView Items
Post by: jmpessoa on April 10, 2019, 06:58:44 am
Quote
what sets the height of a jListItem of jListVIew...?

You can try properties:  "ItemPaddingBottom" and "ItemPaddingTop"
TinyPortal © 2005-2018