Commit 602d5c1f authored by hybrid's avatar hybrid

Fix mousewheel response for whole fileopen dialog.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@929 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 39fc2a42
...@@ -25,7 +25,8 @@ const s32 FOD_HEIGHT = 250; ...@@ -25,7 +25,8 @@ const s32 FOD_HEIGHT = 250;
//! constructor //! constructor
CGUIFileOpenDialog::CGUIFileOpenDialog(const wchar_t* title, IGUIEnvironment* environment, IGUIElement* parent, s32 id) CGUIFileOpenDialog::CGUIFileOpenDialog(const wchar_t* title,
IGUIEnvironment* environment, IGUIElement* parent, s32 id)
: IGUIFileOpenDialog(environment, parent, id, : IGUIFileOpenDialog(environment, parent, id,
core::rect<s32>((parent->getAbsolutePosition().getWidth()-FOD_WIDTH)/2, core::rect<s32>((parent->getAbsolutePosition().getWidth()-FOD_WIDTH)/2,
(parent->getAbsolutePosition().getHeight()-FOD_HEIGHT)/2, (parent->getAbsolutePosition().getHeight()-FOD_HEIGHT)/2,
...@@ -99,7 +100,6 @@ CGUIFileOpenDialog::CGUIFileOpenDialog(const wchar_t* title, IGUIEnvironment* en ...@@ -99,7 +100,6 @@ CGUIFileOpenDialog::CGUIFileOpenDialog(const wchar_t* title, IGUIEnvironment* en
} }
//! destructor //! destructor
CGUIFileOpenDialog::~CGUIFileOpenDialog() CGUIFileOpenDialog::~CGUIFileOpenDialog()
{ {
...@@ -133,7 +133,6 @@ const wchar_t* CGUIFileOpenDialog::getFilename() ...@@ -133,7 +133,6 @@ const wchar_t* CGUIFileOpenDialog::getFilename()
} }
//! called if an event happened. //! called if an event happened.
bool CGUIFileOpenDialog::OnEvent(SEvent event) bool CGUIFileOpenDialog::OnEvent(SEvent event)
{ {
...@@ -199,6 +198,8 @@ bool CGUIFileOpenDialog::OnEvent(SEvent event) ...@@ -199,6 +198,8 @@ bool CGUIFileOpenDialog::OnEvent(SEvent event)
case EET_MOUSE_INPUT_EVENT: case EET_MOUSE_INPUT_EVENT:
switch(event.MouseInput.Event) switch(event.MouseInput.Event)
{ {
case EMIE_MOUSE_WHEEL:
return FileBox->OnEvent(event);
case EMIE_LMOUSE_PRESSED_DOWN: case EMIE_LMOUSE_PRESSED_DOWN:
DragStart.X = event.MouseInput.X; DragStart.X = event.MouseInput.X;
DragStart.Y = event.MouseInput.Y; DragStart.Y = event.MouseInput.Y;
...@@ -253,8 +254,9 @@ void CGUIFileOpenDialog::draw() ...@@ -253,8 +254,9 @@ void CGUIFileOpenDialog::draw()
IGUIFont* font = skin->getFont(EGDF_WINDOW); IGUIFont* font = skin->getFont(EGDF_WINDOW);
if (font) if (font)
font->draw(Text.c_str(), rect, skin->getColor(EGDC_ACTIVE_CAPTION), false, true, font->draw(Text.c_str(), rect,
&AbsoluteClippingRect); skin->getColor(EGDC_ACTIVE_CAPTION),
false, true, &AbsoluteClippingRect);
} }
IGUIElement::draw(); IGUIElement::draw();
......
...@@ -34,7 +34,7 @@ CGUIListBox::CGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, ...@@ -34,7 +34,7 @@ CGUIListBox::CGUIListBox(IGUIEnvironment* environment, IGUIElement* parent,
#endif #endif
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
s32 s = skin->getSize(EGDS_SCROLLBAR_SIZE); const s32 s = skin->getSize(EGDS_SCROLLBAR_SIZE);
ScrollBar = new CGUIScrollBar(false, Environment, this, 0, ScrollBar = new CGUIScrollBar(false, Environment, this, 0,
core::rect<s32>(RelativeRect.getWidth() - s, 0, RelativeRect.getWidth(), RelativeRect.getHeight()), core::rect<s32>(RelativeRect.getWidth() - s, 0, RelativeRect.getWidth(), RelativeRect.getHeight()),
...@@ -72,7 +72,6 @@ CGUIListBox::~CGUIListBox() ...@@ -72,7 +72,6 @@ CGUIListBox::~CGUIListBox()
} }
//! returns amount of list items //! returns amount of list items
s32 CGUIListBox::getItemCount() s32 CGUIListBox::getItemCount()
{ {
...@@ -80,36 +79,37 @@ s32 CGUIListBox::getItemCount() ...@@ -80,36 +79,37 @@ s32 CGUIListBox::getItemCount()
} }
//! returns string of a list item. the may be a value from 0 to itemCount-1 //! returns string of a list item. the may be a value from 0 to itemCount-1
const wchar_t* CGUIListBox::getListItem(s32 id) const wchar_t* CGUIListBox::getListItem(s32 id)
{ {
if (id<0 || id>((s32)Items.size())-1) if ((u32)id>=Items.size())
return 0; return 0;
return Items[id].text.c_str(); return Items[id].text.c_str();
} }
//! Returns the icon of an item //! Returns the icon of an item
s32 CGUIListBox::getIcon(s32 id) const s32 CGUIListBox::getIcon(s32 id) const
{ {
if (id<0 || id>((s32)Items.size())-1) if ((u32)id>=Items.size())
return -1; return -1;
return Items[id].icon; return Items[id].icon;
} }
//! adds an list item, returns id of item //! adds a list item, returns id of item
s32 CGUIListBox::addItem(const wchar_t* text) s32 CGUIListBox::addItem(const wchar_t* text)
{ {
return addItem(text, -1); return addItem(text, -1);
} }
//! adds an list item, returns id of item
//! adds a list item, returns id of item
void CGUIListBox::removeItem(s32 id) void CGUIListBox::removeItem(s32 id)
{ {
if (id < 0 || id >= (s32)Items.size()) if ((u32)id >= Items.size())
return; return;
if (Selected==id) if (Selected==id)
...@@ -128,8 +128,6 @@ void CGUIListBox::removeItem(s32 id) ...@@ -128,8 +128,6 @@ void CGUIListBox::removeItem(s32 id)
} }
//! clears the list //! clears the list
void CGUIListBox::clear() void CGUIListBox::clear()
{ {
...@@ -144,7 +142,6 @@ void CGUIListBox::clear() ...@@ -144,7 +142,6 @@ void CGUIListBox::clear()
} }
void CGUIListBox::recalculateItemHeight() void CGUIListBox::recalculateItemHeight()
{ {
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
...@@ -167,15 +164,13 @@ void CGUIListBox::recalculateItemHeight() ...@@ -167,15 +164,13 @@ void CGUIListBox::recalculateItemHeight()
TotalItemHeight = ItemHeight * Items.size(); TotalItemHeight = ItemHeight * Items.size();
ScrollBar->setMax(TotalItemHeight - AbsoluteRect.getHeight()); ScrollBar->setMax(TotalItemHeight - AbsoluteRect.getHeight());
if( TotalItemHeight <= AbsoluteRect.getHeight() ) if ( TotalItemHeight <= AbsoluteRect.getHeight() )
ScrollBar->setVisible(false); ScrollBar->setVisible(false);
else else
ScrollBar->setVisible(true); ScrollBar->setVisible(true);
} }
//! returns id of selected item. returns -1 if no item is selected. //! returns id of selected item. returns -1 if no item is selected.
s32 CGUIListBox::getSelected() s32 CGUIListBox::getSelected()
{ {
...@@ -183,11 +178,10 @@ s32 CGUIListBox::getSelected() ...@@ -183,11 +178,10 @@ s32 CGUIListBox::getSelected()
} }
//! sets the selected item. Set this to -1 if no item should be selected //! sets the selected item. Set this to -1 if no item should be selected
void CGUIListBox::setSelected(s32 id) void CGUIListBox::setSelected(s32 id)
{ {
if (id<0 || id>((s32)Items.size())-1) if ((u32)id>=Items.size())
Selected = -1; Selected = -1;
else else
Selected = id; Selected = id;
...@@ -198,7 +192,6 @@ void CGUIListBox::setSelected(s32 id) ...@@ -198,7 +192,6 @@ void CGUIListBox::setSelected(s32 id)
} }
//! called if an event happened. //! called if an event happened.
bool CGUIListBox::OnEvent(SEvent event) bool CGUIListBox::OnEvent(SEvent event)
{ {
...@@ -296,7 +289,6 @@ bool CGUIListBox::OnEvent(SEvent event) ...@@ -296,7 +289,6 @@ bool CGUIListBox::OnEvent(SEvent event)
// find the selected item, starting at the current selection // find the selected item, starting at the current selection
s32 start = Selected; s32 start = Selected;
s32 current = start+1;
// dont change selection if the key buffer matches the current item // dont change selection if the key buffer matches the current item
if (Selected > -1 && KeyBuffer.size() > 1) if (Selected > -1 && KeyBuffer.size() > 1)
{ {
...@@ -305,7 +297,8 @@ bool CGUIListBox::OnEvent(SEvent event) ...@@ -305,7 +297,8 @@ bool CGUIListBox::OnEvent(SEvent event)
return true; return true;
} }
while (current < (s32)Items.size()) s32 current;
for (current = start+1; current < (s32)Items.size(); ++current)
{ {
if (Items[current].text.size() >= KeyBuffer.size()) if (Items[current].text.size() >= KeyBuffer.size())
{ {
...@@ -324,10 +317,8 @@ bool CGUIListBox::OnEvent(SEvent event) ...@@ -324,10 +317,8 @@ bool CGUIListBox::OnEvent(SEvent event)
return true; return true;
} }
} }
current++;
} }
current = 0; for (current = 0; current <= start; ++current)
while (current <= start)
{ {
if (Items[current].text.size() >= KeyBuffer.size()) if (Items[current].text.size() >= KeyBuffer.size())
{ {
...@@ -347,7 +338,6 @@ bool CGUIListBox::OnEvent(SEvent event) ...@@ -347,7 +338,6 @@ bool CGUIListBox::OnEvent(SEvent event)
return true; return true;
} }
} }
current++;
} }
return true; return true;
...@@ -370,6 +360,7 @@ bool CGUIListBox::OnEvent(SEvent event) ...@@ -370,6 +360,7 @@ bool CGUIListBox::OnEvent(SEvent event)
break; break;
} }
break; break;
case EET_MOUSE_INPUT_EVENT: case EET_MOUSE_INPUT_EVENT:
{ {
core::position2d<s32> p(event.MouseInput.X, event.MouseInput.Y); core::position2d<s32> p(event.MouseInput.X, event.MouseInput.Y);
...@@ -412,9 +403,11 @@ bool CGUIListBox::OnEvent(SEvent event) ...@@ -412,9 +403,11 @@ bool CGUIListBox::OnEvent(SEvent event)
} }
} }
break; break;
case EET_LOG_TEXT_EVENT:
case EET_USER_EVENT:
break;
} }
return Parent ? Parent->OnEvent(event) : false; return Parent ? Parent->OnEvent(event) : false;
} }
...@@ -447,6 +440,7 @@ void CGUIListBox::selectNew(s32 ypos, bool onlyHover) ...@@ -447,6 +440,7 @@ void CGUIListBox::selectNew(s32 ypos, bool onlyHover)
} }
} }
//! Update the position and size of the listbox, and update the scrollbar //! Update the position and size of the listbox, and update the scrollbar
void CGUIListBox::updateAbsolutePosition() void CGUIListBox::updateAbsolutePosition()
{ {
...@@ -455,6 +449,7 @@ void CGUIListBox::updateAbsolutePosition() ...@@ -455,6 +449,7 @@ void CGUIListBox::updateAbsolutePosition()
recalculateItemHeight(); recalculateItemHeight();
} }
//! draws the element and its children //! draws the element and its children
void CGUIListBox::draw() void CGUIListBox::draw()
{ {
...@@ -529,7 +524,6 @@ void CGUIListBox::draw() ...@@ -529,7 +524,6 @@ void CGUIListBox::draw()
hasItemOverrideColor(i, EGUI_LBC_ICON) ? getItemOverrideColor(i, EGUI_LBC_ICON) : getItemDefaultColor(EGUI_LBC_ICON), hasItemOverrideColor(i, EGUI_LBC_ICON) ? getItemOverrideColor(i, EGUI_LBC_ICON) : getItemDefaultColor(EGUI_LBC_ICON),
0 , (i==Selected) ? os::Timer::getTime() : 0, false, true); 0 , (i==Selected) ? os::Timer::getTime() : 0, false, true);
} }
} }
textRect.UpperLeftCorner.X += ItemsIconWidth+3; textRect.UpperLeftCorner.X += ItemsIconWidth+3;
...@@ -559,7 +553,6 @@ void CGUIListBox::draw() ...@@ -559,7 +553,6 @@ void CGUIListBox::draw()
} }
//! adds an list item with an icon //! adds an list item with an icon
s32 CGUIListBox::addItem(const wchar_t* text, s32 icon) s32 CGUIListBox::addItem(const wchar_t* text, s32 icon)
{ {
...@@ -584,12 +577,14 @@ void CGUIListBox::setSpriteBank(IGUISpriteBank* bank) ...@@ -584,12 +577,14 @@ void CGUIListBox::setSpriteBank(IGUISpriteBank* bank)
if (IconBank) if (IconBank)
IconBank->grab(); IconBank->grab();
} }
void CGUIListBox::recalculateScrollPos() void CGUIListBox::recalculateScrollPos()
{ {
if (!AutoScroll) if (!AutoScroll)
return; return;
s32 selPos = (Selected == -1 ? TotalItemHeight : Selected * ItemHeight) - ScrollBar->getPos(); const s32 selPos = (Selected == -1 ? TotalItemHeight : Selected * ItemHeight) - ScrollBar->getPos();
if (selPos < 0) if (selPos < 0)
{ {
...@@ -602,17 +597,20 @@ void CGUIListBox::recalculateScrollPos() ...@@ -602,17 +597,20 @@ void CGUIListBox::recalculateScrollPos()
} }
} }
void CGUIListBox::setAutoScrollEnabled(bool scroll) void CGUIListBox::setAutoScrollEnabled(bool scroll)
{ {
AutoScroll = scroll; AutoScroll = scroll;
} }
bool CGUIListBox::isAutoScrollEnabled() bool CGUIListBox::isAutoScrollEnabled()
{ {
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return AutoScroll; return AutoScroll;
} }
bool CGUIListBox::getSerializationLabels(EGUI_LISTBOX_COLOR colorType, core::stringc & useColorLabel, core::stringc & colorLabel) bool CGUIListBox::getSerializationLabels(EGUI_LISTBOX_COLOR colorType, core::stringc & useColorLabel, core::stringc & colorLabel)
{ {
switch ( colorType ) switch ( colorType )
...@@ -639,6 +637,7 @@ bool CGUIListBox::getSerializationLabels(EGUI_LISTBOX_COLOR colorType, core::str ...@@ -639,6 +637,7 @@ bool CGUIListBox::getSerializationLabels(EGUI_LISTBOX_COLOR colorType, core::str
return true; return true;
} }
//! Writes attributes of the element. //! Writes attributes of the element.
void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0)
{ {
...@@ -650,12 +649,10 @@ void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWr ...@@ -650,12 +649,10 @@ void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWr
out->addBool ("AutoScroll", AutoScroll); out->addBool ("AutoScroll", AutoScroll);
out->addInt("ItemCount", Items.size()); out->addInt("ItemCount", Items.size());
u32 i; for (u32 i=0;i<Items.size(); ++i)
for (i=0;i<Items.size(); ++i)
{ {
core::stringc label; core::stringc label("text");
label += i;
label = "text"; label += i;
out->addString(label.c_str(), Items[i].text.c_str() ); out->addString(label.c_str(), Items[i].text.c_str() );
for ( s32 c=0; c < (s32)EGUI_LBC_COUNT; ++c ) for ( s32 c=0; c < (s32)EGUI_LBC_COUNT; ++c )
...@@ -678,6 +675,7 @@ void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWr ...@@ -678,6 +675,7 @@ void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWr
} }
} }
//! Reads attributes of the element //! Reads attributes of the element
void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{ {
...@@ -689,18 +687,18 @@ void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadW ...@@ -689,18 +687,18 @@ void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadW
IGUIListBox::deserializeAttributes(in,options); IGUIListBox::deserializeAttributes(in,options);
s32 count = in->getAttributeAsInt("ItemCount"); const s32 count = in->getAttributeAsInt("ItemCount");
for (s32 i=0; i<(s32)count; ++i) for (s32 i=0; i<count; ++i)
{ {
core::stringc label; core::stringc label("text");
ListItem item; ListItem item;
label = "text"; label += i; label += i;
item.text = in->getAttributeAsStringW(label.c_str()); item.text = in->getAttributeAsStringW(label.c_str());
addItem(item.text.c_str(), item.icon); addItem(item.text.c_str(), item.icon);
for ( s32 c=0; c < (s32)EGUI_LBC_COUNT; ++c ) for ( u32 c=0; c < EGUI_LBC_COUNT; ++c )
{ {
core::stringc useColorLabel, colorLabel; core::stringc useColorLabel, colorLabel;
if ( !getSerializationLabels((EGUI_LISTBOX_COLOR)c, useColorLabel, colorLabel) ) if ( !getSerializationLabels((EGUI_LISTBOX_COLOR)c, useColorLabel, colorLabel) )
...@@ -716,6 +714,7 @@ void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadW ...@@ -716,6 +714,7 @@ void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadW
} }
} }
void CGUIListBox::recalculateItemWidth(s32 icon) void CGUIListBox::recalculateItemWidth(s32 icon)
{ {
if (IconBank && icon > -1 && if (IconBank && icon > -1 &&
...@@ -732,9 +731,10 @@ void CGUIListBox::recalculateItemWidth(s32 icon) ...@@ -732,9 +731,10 @@ void CGUIListBox::recalculateItemWidth(s32 icon)
} }
} }
void CGUIListBox::setItem(s32 index, const wchar_t* text, s32 icon) void CGUIListBox::setItem(s32 index, const wchar_t* text, s32 icon)
{ {
if ( index < 0 || index >= (s32)Items.size() ) if ( (u32)index >= Items.size() )
return; return;
Items[index].text = text; Items[index].text = text;
...@@ -744,6 +744,7 @@ void CGUIListBox::setItem(s32 index, const wchar_t* text, s32 icon) ...@@ -744,6 +744,7 @@ void CGUIListBox::setItem(s32 index, const wchar_t* text, s32 icon)
recalculateItemWidth(icon); recalculateItemWidth(icon);
} }
//! Insert the item at the given index //! Insert the item at the given index
//! Return the index on success or -1 on failure. //! Return the index on success or -1 on failure.
s32 CGUIListBox::insertItem(s32 index, const wchar_t* text, s32 icon) s32 CGUIListBox::insertItem(s32 index, const wchar_t* text, s32 icon)
...@@ -761,9 +762,10 @@ s32 CGUIListBox::insertItem(s32 index, const wchar_t* text, s32 icon) ...@@ -761,9 +762,10 @@ s32 CGUIListBox::insertItem(s32 index, const wchar_t* text, s32 icon)
return index; return index;
} }
void CGUIListBox::swapItems(s32 index1, s32 index2) void CGUIListBox::swapItems(s32 index1, s32 index2)
{ {
if ( index1 < 0 || index2 < 0 || index1 >= (s32)Items.size() || index2 >= (s32)Items.size() ) if ( (u32)index1 >= Items.size() || (u32)index2 >= Items.size() )
return; return;
ListItem dummmy = Items[index1]; ListItem dummmy = Items[index1];
...@@ -771,56 +773,63 @@ void CGUIListBox::swapItems(s32 index1, s32 index2) ...@@ -771,56 +773,63 @@ void CGUIListBox::swapItems(s32 index1, s32 index2)
Items[index2] = dummmy; Items[index2] = dummmy;
} }
void CGUIListBox::setItemOverrideColor(s32 index, const video::SColor &color) void CGUIListBox::setItemOverrideColor(s32 index, const video::SColor &color)
{ {
for ( s32 c=0; c < (s32)EGUI_LBC_COUNT; ++c ) for ( u32 c=0; c < EGUI_LBC_COUNT; ++c )
{ {
Items[index].OverrideColors[c].Use = true; Items[index].OverrideColors[c].Use = true;
Items[index].OverrideColors[c].Color = color; Items[index].OverrideColors[c].Color = color;
} }
} }
void CGUIListBox::setItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color) void CGUIListBox::setItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color)
{ {
if ( index < 0 || index >= (s32)Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT ) if ( (u32)index >= Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT )
return; return;
Items[index].OverrideColors[colorType].Use = true; Items[index].OverrideColors[colorType].Use = true;
Items[index].OverrideColors[colorType].Color = color; Items[index].OverrideColors[colorType].Color = color;
} }
void CGUIListBox::clearItemOverrideColor(s32 index) void CGUIListBox::clearItemOverrideColor(s32 index)
{ {
for (s32 c=0; c < (s32)EGUI_LBC_COUNT; ++c ) for (u32 c=0; c < (u32)EGUI_LBC_COUNT; ++c )
{ {
Items[index].OverrideColors[c].Use = false; Items[index].OverrideColors[c].Use = false;
} }
} }
void CGUIListBox::clearItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType) void CGUIListBox::clearItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType)
{ {
if ( index < 0 || index >= (s32)Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT ) if ( (u32)index >= Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT )
return; return;
Items[index].OverrideColors[colorType].Use = false; Items[index].OverrideColors[colorType].Use = false;
} }
bool CGUIListBox::hasItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType) bool CGUIListBox::hasItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType)
{ {
if ( index < 0 || index >= (s32)Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT ) if ( (u32)index >= Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT )
return false; return false;
return Items[index].OverrideColors[colorType].Use; return Items[index].OverrideColors[colorType].Use;
} }
video::SColor CGUIListBox::getItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType) video::SColor CGUIListBox::getItemOverrideColor(s32 index, EGUI_LISTBOX_COLOR colorType)
{ {
if ( index < 0 || index >= (s32)Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT ) if ( (u32)index >= Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT )
return video::SColor(); return video::SColor();
return Items[index].OverrideColors[colorType].Color; return Items[index].OverrideColors[colorType].Color;
} }
video::SColor CGUIListBox::getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) video::SColor CGUIListBox::getItemDefaultColor(EGUI_LISTBOX_COLOR colorType)
{ {
IGUISkin* skin = Environment->getSkin(); IGUISkin* skin = Environment->getSkin();
...@@ -847,3 +856,4 @@ video::SColor CGUIListBox::getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) ...@@ -847,3 +856,4 @@ video::SColor CGUIListBox::getItemDefaultColor(EGUI_LISTBOX_COLOR colorType)
} // end namespace irr } // end namespace irr
#endif // _IRR_COMPILE_WITH_GUI_ #endif // _IRR_COMPILE_WITH_GUI_
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