In CGUIListBox.cpp:
Change the recalculateItemHeight() function to:
Code: Select all
void CGUIListBox::recalculateItemHeight()
{
IGUISkin* skin = Environment->getSkin();
if (!Font)
{
Font = skin->getFont();
ItemHeight = 0;
if (Font)
{
ItemHeight = Font->getDimension(L"A").Height + 4;
Font->grab();
}
}
else
ItemHeight = Font->getDimension(L"A").Height + 4;
TotalItemHeight = ItemHeight * Items.size();
ScrollBar->setMax(TotalItemHeight);
}
Code: Select all
//! Sets another skin independent font.
void CGUIListBox::setOverrideFont(IGUIFont* font)
{
if (font)
Font = font;
}
//! Sets the font which should be used as icon font. This font is set to the Irrlicht engine
//! built-in-font by default. Icons can be displayed in front of every list item.
//! An icon is a string, displayed with the icon font. When using the build-in-font of the
//! Irrlicht engine as icon font, the icon strings defined in GUIIcons.h can be used.
void CGUIListBox::setIconFont(IGUIFont* font)
{
if (IconFont)
IconFont->drop();
IconFont = font;
if (IconFont)
IconFont->grab();
}
Add function to the public declarations:
Code: Select all
//! Sets another skin independent font.
virtual void setOverrideFont(IGUIFont* font);
Add function to public declarations:
Code: Select all
//! Sets another skin independent font.
virtual void setOverrideFont(IGUIFont* font) = 0;