--- Irrlicht.old/include/IGUIListBox.h 26 Sep 2004 13:44:23 -0000 1.1 +++ Irrlicht/include/IGUIListBox.h 22 Nov 2004 13:50:15 -0000 1.7 @@ -58,6 +58,11 @@ //! sets the selected item. Set this to -1 if no item should be selected virtual void setSelected(s32 id) = 0; + + // override font patch by tyn + //! Sets another skin independent font. + virtual void setOverrideFont(IGUIFont* font) = 0; + }; --- Irrlicht.old/CGUIListBox.cpp 26 Sep 2004 13:43:56 -0000 1.1 +++ Irrlicht/CGUIListBox.cpp 22 Nov 2004 13:50:15 -0000 1.10 @@ -103,26 +103,25 @@ recalculateItemHeight(); } - - +// changed for override font patch by tyn void CGUIListBox::recalculateItemHeight() { IGUISkin* skin = Environment->getSkin(); - if (Font != skin->getFont()) + if (!Font) { - if (Font) - Font->drop(); - 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 - AbsoluteRect.getHeight()); @@ -364,6 +363,14 @@ IconFont->grab(); } + +// override font patch by tyn +//! Sets another skin independent font. +void CGUIListBox::setOverrideFont(IGUIFont* font) +{ + if (font) + Font = font; +} --- Irrlicht.old/CGUIListBox.h 26 Sep 2004 13:44:27 -0000 1.1 +++ Irrlicht/CGUIListBox.h 22 Nov 2004 13:50:15 -0000 1.7 @@ -66,6 +66,10 @@ //! Irrlicht engine as icon font, the icon strings defined in GUIIcons.h can be used. virtual void setIconFont(IGUIFont* font); + // override font patch by tyn + //! Sets another skin independent font. + virtual void setOverrideFont(IGUIFont* font); + private: struct ListItem