[no bug] ListBox Selected Element Question

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
gavinj64738
Posts: 11
Joined: Sat Jun 21, 2008 4:10 am

[no bug] ListBox Selected Element Question

Post by gavinj64738 »

Hi Guys,

Ive got a quick question that somebody could possibly help me out with.

Image
Ive made the list box rediculously large to be sure there is no wrapping (although i didnt think it had any)

As you can see from the screenshot the problem im having is

1> the location of the selected item in the listbox is offset from the item text.

2> the offset from the first list box item seems to be broken and beyond the boarder of the list box even though there is no scroll bar on it.


The code ive used to create this is..

Code: Select all

guiLBNavComp = env->addListBox(core::rect<s32>(10,340,400,560),0,105,true);
And implemented each time the map changes in iteration like this

Code: Select all

wchar_t tmp[20];
swprintf(tmp, 20, L"%S\n",GameBody::GameBodys[i]->name);
GameBody::GameBodys[i]->guiid = guiLBNavComp->addItem(tmp);
printf("Adding %s with id %i\n", GameBody::GameBodys[i]->name, GameBody::GameBodys[i]->guiid);
guiLBNavComp->setItemOverrideColor(guiLBNavComp->getItemCount()-1,video::SColor(255,0,200,100));
Any pointers to list box and list box item formatting would be appreciated.
gavinj64738
Posts: 11
Joined: Sat Jun 21, 2008 4:10 am

Cmon

Post by gavinj64738 »

Okay, this is my second post here.. and so far not even a single smart arse reply to either of them.. ppl get annoyed when some1 asks a stupid question and feel they need to insult them.. i dunno if this is a stupid question or not.. but if its not.. how bout a suggestion.. i dont care about right or wrong.. im stuck.. how bout any ideas guys ;p
psychophoniac
Posts: 101
Joined: Wed Dec 03, 2008 5:33 pm
Location: ger

Post by psychophoniac »

try another fonttype (theres a fontmaker tool in the /tools folder) and maybe another size.
this helped me out when i had this problem.
i love skateboarding!
gavinj64738
Posts: 11
Joined: Sat Jun 21, 2008 4:10 am

Post by gavinj64738 »

Great thanks.. yep. .ive tried the default font as well as several others and no luck so far.. is there an offset setting that works like a stylesheets or somthing?
robertgarand
Posts: 69
Joined: Fri Feb 22, 2008 6:47 pm
Location: montreal
Contact:

HI Gavin

Post by robertgarand »

Your question is not stupid, in fact, I looked in yhe class definition and I really don't understand how you get this bad result.
There is not a single font size parameter...

Have you tried to change the alignment parameters ?

Regards,
Robert.
If it can't be writen, it can't exist
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Ouch, looks like a bug in either the font or the list box.
What font are you using, and can you upload it somewhere for testing?
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
gavinj64738
Posts: 11
Joined: Sat Jun 21, 2008 4:10 am

Re: HI Gavin

Post by gavinj64738 »

robertgarand wrote:Your question is not stupid, in fact, I looked in yhe class definition and I really don't understand how you get this bad result.
There is not a single font size parameter...

Have you tried to change the alignment parameters ?

Regards,
Robert.
Ive had another look at this problem and after not looking at it for a while, it made the error very clear to me..

swprintf(tmp, 20, L"%S\n",GameBody::GameBodys->name);

Notice the \n in the swprintf. The line feed as messing up the alignment.

Definately not a bug, many thanks for the assistance.
Sundar
Posts: 84
Joined: Mon Jun 05, 2006 11:05 am

Post by Sundar »

Thanks

i was having this issue and starting to get worried. This post has saved me some headache. Thanks
Post Reply