You are not logged in.

OlimilO

Intermediate

  • "OlimilO" is male
  • "OlimilO" started this thread

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

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

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

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

  • "Manuel" is male

Posts: 256

Date of registration: Jul 16th 2008

Location: Erlangen, Germany

Occupation: Software Developer

Hobbies: Jabaco, game theory, text-mining

  • Send private message

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

  • "OlimilO" is male
  • "OlimilO" started this thread

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

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