Commit b37ff9f6 authored by cutealien's avatar cutealien

CGUIComboBox now updates selection-list when font changes while it's open (thx...

CGUIComboBox now updates selection-list when font changes while it's open (thx @ rubixcuber for bugreport)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5099 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6fc71dfd
--------------------------
Changes in 1.9 (not yet released)
- CGUIComboBox now updates selection-list when font changes while it's open (thx @ rubixcuber for bugreport)
- CAnimatedMeshSceneNode::setMesh does now set the animation speed again to that of the mesh (had been changed in 1.7, but not for obvious reasons)
- .x meshloader regards now AnimTicksPerSecond (thx @qian for a test-model and bugreport)
- Interface getMeshType moved from IAnimatedMesh up to IMesh.
......
......@@ -24,7 +24,8 @@ CGUIComboBox::CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent,
s32 id, core::rect<s32> rectangle)
: IGUIComboBox(environment, parent, id, rectangle),
ListButton(0), SelectedText(0), ListBox(0), LastFocus(0),
Selected(-1), HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_CENTER), MaxSelectionRows(5), HasFocus(false)
Selected(-1), HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_CENTER), MaxSelectionRows(5), HasFocus(false),
ActiveFont(0)
{
#ifdef _DEBUG
setDebugName("CGUIComboBox");
......@@ -384,6 +385,16 @@ void CGUIComboBox::draw()
return;
IGUISkin* skin = Environment->getSkin();
// font changed while the listbox is open?
if ( ActiveFont != skin->getFont() && ListBox )
{
// close and re-open to use new font-size
openCloseMenu();
openCloseMenu();
}
IGUIElement *currentFocus = Environment->getFocus();
if (currentFocus != LastFocus)
{
......@@ -441,9 +452,9 @@ void CGUIComboBox::openCloseMenu()
if (h == 0)
h = 1;
IGUIFont* font = skin->getFont();
if (font)
h *= (font->getDimension(L"A").Height + 4);
ActiveFont = skin->getFont();
if (ActiveFont)
h *= (ActiveFont->getDimension(L"A").Height + 4);
// open list box
core::rect<s32> r(0, AbsoluteRect.getHeight(),
......
......@@ -105,6 +105,7 @@ namespace gui
EGUI_ALIGNMENT HAlign, VAlign;
u32 MaxSelectionRows;
bool HasFocus;
IGUIFont* ActiveFont;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment