Small bugfixes in the CGUIListBox

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13214 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx 2013-07-14 01:01:56 +00:00
parent b44f547057
commit 2d0d407d7f
4 changed files with 16 additions and 18 deletions

View File

@ -2,7 +2,7 @@
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CGUIListBox.h" #include "guiengine/widgets/CGUIListBox.h"
#include "IGUISkin.h" #include "IGUISkin.h"
#include "IGUIEnvironment.h" #include "IGUIEnvironment.h"
@ -390,7 +390,9 @@ bool CGUIListBox::OnEvent(const SEvent& event)
{ {
if (event.GUIEvent.Caller == this) if (event.GUIEvent.Caller == this)
Selecting = false; Selecting = false;
break;
} }
default: default:
break; break;
} }

View File

@ -2,8 +2,8 @@
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_GUI_LIST_BOX_H_INCLUDED__ #ifndef HEADER_CGUILISTBOX_HPP
#define __C_GUI_LIST_BOX_H_INCLUDED__ #define HEADER_CGUILISTBOX_HPP
#include "IrrCompileConfig.h" #include "IrrCompileConfig.h"
@ -22,7 +22,7 @@ namespace gui
{ {
public: public:
//! constructor //! constructor
CGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, CGUIListBox(IGUIEnvironment* environment, IGUIElement* parent,
s32 id, core::rect<s32> rectangle, bool clip=true, s32 id, core::rect<s32> rectangle, bool clip=true,
bool drawBack=false, bool moveOverSelect=false); bool drawBack=false, bool moveOverSelect=false);

View File

@ -17,15 +17,14 @@
#include "guiengine/widgets/list_widget.hpp" #include "guiengine/widgets/list_widget.hpp"
#include "guiengine/widgets/CGUIListBox.h"
#include "guiengine/CGUISpriteBank.h" #include "guiengine/CGUISpriteBank.h"
#include "guiengine/engine.hpp" #include "guiengine/engine.hpp"
#include "io/file_manager.hpp" #include "io/file_manager.hpp"
#include <IGUIElement.h> #include <IGUIElement.h>
#include <IGUISkin.h> #include <IGUISkin.h>
#include <CGUIEnvironment.h> #include <IGUIEnvironment.h>
#include "IGUIFontBitmap.h" #include "IGUIFontBitmap.h"
#include <sstream> #include <sstream>
@ -95,9 +94,9 @@ void ListWidget::add()
IGUISkin * current_skin = GUIEngine::getGUIEnv()->getSkin(); IGUISkin * current_skin = GUIEngine::getGUIEnv()->getSkin();
IGUIFont * current_font = GUIEngine::getGUIEnv()->getBuiltInFont(); IGUIFont * current_font = GUIEngine::getGUIEnv()->getBuiltInFont();
IGUIListBox* m_list_box = new CGUIListBox( IGUIListBox * list_box = new CGUIListBox(
GUIEngine::getGUIEnv(), GUIEngine::getGUIEnv(),
m_parent ? m_parent : (CGUIEnvironment *)GUIEngine::getGUIEnv(), m_parent ? m_parent : GUIEngine::getGUIEnv()->getRootGUIElement(),
getNewID(), getNewID(),
widget_size, widget_size,
true, true,
@ -106,19 +105,19 @@ void ListWidget::add()
if (current_skin && current_skin->getSpriteBank()) if (current_skin && current_skin->getSpriteBank())
{ {
m_list_box->setSpriteBank(current_skin->getSpriteBank()); list_box->setSpriteBank(current_skin->getSpriteBank());
} }
else if (current_font && current_font->getType() == EGFT_BITMAP) else if (current_font && current_font->getType() == EGFT_BITMAP)
{ {
m_list_box->setSpriteBank( ((IGUIFontBitmap*)current_font)->getSpriteBank()); list_box->setSpriteBank( ((IGUIFontBitmap*)current_font)->getSpriteBank());
} }
m_list_box->drop(); list_box->drop();
m_list_box->setAutoScrollEnabled(false); list_box->setAutoScrollEnabled(false);
m_element = m_list_box; m_element = list_box;
m_element->setTabOrder( m_list_box->getID() ); m_element->setTabOrder( list_box->getID() );
if (m_header.size() > 0) if (m_header.size() > 0)
{ {

View File

@ -27,7 +27,6 @@
#include "utils/leak_check.hpp" #include "utils/leak_check.hpp"
#include "utils/ptr_vector.hpp" #include "utils/ptr_vector.hpp"
#include "IGUIElement.h" #include "IGUIElement.h"
#include "guiengine/widgets/CGUIListBox.h"
namespace irr { namespace gui { class STKModifiedSpriteBank; } } namespace irr { namespace gui { class STKModifiedSpriteBank; } }
@ -89,8 +88,6 @@ namespace GUIEngine
IListWidgetHeaderListener* m_listener; IListWidgetHeaderListener* m_listener;
irr::gui::IGUIListBox * m_list_box;
public: public:
LEAK_CHECK() LEAK_CHECK()