Thursday, May 17th 2012, 4:57pm UTC+2

You are not logged in.

  • Login
  • Register

OlimilO

Intermediate

Posts: 277

Location: Germany

Occupation: software engineer

1

Wednesday, March 11th 2009, 5:05pm

ListBox.ListIcon ?

Hello,

the ListBox-control has the property ListIcon.
Has anybody tried this?
I assume that it should be possible to give an icon to an item.
But i did not manage to do this.
any ideas?

greetings

OlimilO

A1880

Intermediate

Posts: 500

Location: Hanover, Germany

Occupation: Software Engineer

2

Wednesday, March 11th 2009, 9:25pm

DefaultListCellRenderer and Icon Support

Hi,
I have tried it with GIF and JPG icon graphics, but without success.

Google gets you a lot of hits under "DefaultListCellRenderer Icon".
I've got the impression that the Jabaco framework has no icon support in the ListCellRenderer yet.
But I'm not sure.

Ciao

A1880

Manuel

Administrator

Posts: 255

Location: Erlangen, Germany

Occupation: Software Developer

3

Wednesday, March 11th 2009, 11:14pm

Quoted

I've got the impression that the Jabaco framework has no icon support in the ListCellRenderer yet.
But I'm not sure.
I think it's a small bug in ListCellData.getComponent. Adding "tmpLabel.setIcon(getIcon())" before "tmpLabel.setText(Text)" should solve your problem (haven't the right environment for testing at the moment). Most of the administration-tasks will be done next few days and I can offer you SVN-snapshots.

OlimilO

Intermediate

Posts: 277

Location: Germany

Occupation: software engineer

4

Monday, March 23rd 2009, 10:32pm

ListBox.AddItem New ListCellData(string, Icon)

After a short look into the Jabaco-FX now I have solved the problem. It was so easy and the solution was already there in front of my eyes. The procedure ListBox.AddItem has the following overloading:

Jabaco Source

1
List1.AddItem(Item As ListCellData) '2 v 6


and the ListCellData-Object has the following constructor:

Jabaco Source

1
New ListCellData(refText As String, refIcon As IResource) '3 v 4


so adding entries with Icons to a ListBox is pretty easy:

Jabaco Source

1
List1.AddItem(New ListCellData("Text of first entry", Resources.MyIconPng))


greetings

OlimilO

Rate this thread
WoltLab Burning Board