Commit 29f6ca00 authored by cutealien's avatar cutealien

In IGUITreeView "clearChilds" and "hasChilds" deprecated for "clearChildren"...

In IGUITreeView "clearChilds" and "hasChilds" deprecated for "clearChildren" and "hasChildren" (thx @Greenya for noticing)
Same childs => children in a few places in documenatation and variables.
Removed a compile warning in CCubeSceneNode.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3330 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c00c459b
- In IGUITreeView "clearChilds" and "hasChilds" deprecated for "clearChildren" and "hasChildren" (thx @Greenya for noticing)
- add dimension2d::operator-
- add CGUIEditBox::getOverrideColor and CGUIEditBox::isOverrideColorEnabled
- Add logging level ELL_DEBUG - Add logging level ELL_DEBUG
- Add parameter DisplayAdapter to creation params to allow selecting the card when more than one card is in the system. - Add parameter DisplayAdapter to creation params to allow selecting the card when more than one card is in the system.
......
...@@ -805,7 +805,7 @@ void CQuake3EventHandler::CreateGUI() ...@@ -805,7 +805,7 @@ void CQuake3EventHandler::CreateGUI()
gui.SceneTree = env->addTreeView( rect<s32>( dim.Width - 400, dim.Height - 380, dim.Width - 5, dim.Height - 40 ), gui.SceneTree = env->addTreeView( rect<s32>( dim.Width - 400, dim.Height - 380, dim.Width - 5, dim.Height - 40 ),
gui.Window, -1, true, true, false ); gui.Window, -1, true, true, false );
gui.SceneTree->setToolTipText ( L"Show the current Scenegraph" ); gui.SceneTree->setToolTipText ( L"Show the current Scenegraph" );
gui.SceneTree->getRoot()->clearChilds(); gui.SceneTree->getRoot()->clearChildren();
addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() );
...@@ -1288,7 +1288,7 @@ void CQuake3EventHandler::SetGUIActive( s32 command) ...@@ -1288,7 +1288,7 @@ void CQuake3EventHandler::SetGUIActive( s32 command)
gui.SceneTree && Game->Device->getGUIEnvironment()->getFocus() != gui.SceneTree gui.SceneTree && Game->Device->getGUIEnvironment()->getFocus() != gui.SceneTree
) )
{ {
gui.SceneTree->getRoot()->clearChilds(); gui.SceneTree->getRoot()->clearChildren();
addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() );
} }
......
...@@ -22,56 +22,70 @@ namespace gui ...@@ -22,56 +22,70 @@ namespace gui
public: public:
//! returns the owner (tree view) of this node //! returns the owner (tree view) of this node
virtual IGUITreeView* getOwner() const = 0; virtual IGUITreeView* getOwner() const = 0;
//! Returns the parent node of this node. //! Returns the parent node of this node.
/** For the root node this will return 0. */ /** For the root node this will return 0. */
virtual IGUITreeViewNode* getParent() const = 0; virtual IGUITreeViewNode* getParent() const = 0;
//! returns the text of the node //! returns the text of the node
virtual const wchar_t* getText() const = 0; virtual const wchar_t* getText() const = 0;
//! sets the text of the node //! sets the text of the node
virtual void setText( const wchar_t* text ) = 0; virtual void setText( const wchar_t* text ) = 0;
//! returns the icon text of the node //! returns the icon text of the node
virtual const wchar_t* getIcon() const = 0; virtual const wchar_t* getIcon() const = 0;
//! sets the icon text of the node //! sets the icon text of the node
virtual void setIcon( const wchar_t* icon ) = 0; virtual void setIcon( const wchar_t* icon ) = 0;
//! returns the image index of the node //! returns the image index of the node
virtual u32 getImageIndex() const = 0; virtual u32 getImageIndex() const = 0;
//! sets the image index of the node //! sets the image index of the node
virtual void setImageIndex( u32 imageIndex ) = 0; virtual void setImageIndex( u32 imageIndex ) = 0;
//! returns the image index of the node //! returns the image index of the node
virtual u32 getSelectedImageIndex() const = 0; virtual u32 getSelectedImageIndex() const = 0;
//! sets the image index of the node //! sets the image index of the node
virtual void setSelectedImageIndex( u32 imageIndex ) = 0; virtual void setSelectedImageIndex( u32 imageIndex ) = 0;
//! returns the user data (void*) of this node //! returns the user data (void*) of this node
virtual void* getData() const = 0; virtual void* getData() const = 0;
//! sets the user data (void*) of this node //! sets the user data (void*) of this node
virtual void setData( void* data ) = 0; virtual void setData( void* data ) = 0;
//! returns the user data2 (IReferenceCounted) of this node //! returns the user data2 (IReferenceCounted) of this node
virtual IReferenceCounted* getData2() const = 0; virtual IReferenceCounted* getData2() const = 0;
//! sets the user data2 (IReferenceCounted) of this node //! sets the user data2 (IReferenceCounted) of this node
virtual void setData2( IReferenceCounted* data ) = 0; virtual void setData2( IReferenceCounted* data ) = 0;
//! returns the child item count //! returns the child item count
virtual u32 getChildCount() const = 0; virtual u32 getChildCount() const = 0;
//! removes all childs (recursive) from this node //! removes all children (recursive) from this node
virtual void clearChilds() = 0; virtual void clearChildren() = 0;
//! removes all children (recursive) from this node
/** \deprecated Deprecated in 1.8, use clearChildren() instead. */
_IRR_DEPRECATED_ void clearChilds()
{
return clearChildren();
}
//! returns true if this node has child nodes
virtual bool hasChildren() const = 0;
//! returns true if this node has child nodes //! returns true if this node has child nodes
virtual bool hasChilds() const = 0; /** \deprecated Deprecated in 1.8, use hasChildren() instead. */
_IRR_DEPRECATED_ bool hasChilds() const
{
return hasChildren();
}
//! Adds a new node behind the last child node. //! Adds a new node behind the last child node.
/** \param text text of the new node /** \param text text of the new node
\param icon icon text of the new node \param icon icon text of the new node
...@@ -133,13 +147,13 @@ namespace gui ...@@ -133,13 +147,13 @@ namespace gui
const wchar_t* text, const wchar_t* icon = 0, const wchar_t* text, const wchar_t* icon = 0,
s32 imageIndex=-1, s32 selectedImageIndex=-1, s32 imageIndex=-1, s32 selectedImageIndex=-1,
void* data=0, IReferenceCounted* data2=0) = 0; void* data=0, IReferenceCounted* data2=0) = 0;
//! Return the first child node from this node. //! Return the first child node from this node.
/** \return The first child node or 0 if this node has no childs. */ /** \return The first child node or 0 if this node has no children. */
virtual IGUITreeViewNode* getFirstChild() const = 0; virtual IGUITreeViewNode* getFirstChild() const = 0;
//! Return the last child node from this node. //! Return the last child node from this node.
/** \return The last child node or 0 if this node has no childs. */ /** \return The last child node or 0 if this node has no children. */
virtual IGUITreeViewNode* getLastChild() const = 0; virtual IGUITreeViewNode* getLastChild() const = 0;
//! Returns the previous sibling node from this node. //! Returns the previous sibling node from this node.
...@@ -162,7 +176,7 @@ namespace gui ...@@ -162,7 +176,7 @@ namespace gui
//! Deletes a child node. //! Deletes a child node.
/** \return Returns true if the node was found as a child and is deleted. */ /** \return Returns true if the node was found as a child and is deleted. */
virtual bool deleteChild( IGUITreeViewNode* child ) = 0; virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
//! Moves a child node one position up. //! Moves a child node one position up.
/** \return True if the node was found as achild node and was not already the first child. */ /** \return True if the node was found as achild node and was not already the first child. */
virtual bool moveChildUp( IGUITreeViewNode* child ) = 0; virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
...@@ -171,30 +185,30 @@ namespace gui ...@@ -171,30 +185,30 @@ namespace gui
/** \return True if the node was found as achild node and was not already the last child. */ /** \return True if the node was found as achild node and was not already the last child. */
virtual bool moveChildDown( IGUITreeViewNode* child ) = 0; virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
//! Returns true if the node is expanded (childs are visible). //! Returns true if the node is expanded (children are visible).
virtual bool getExpanded() const = 0; virtual bool getExpanded() const = 0;
//! Sets if the node is expanded. //! Sets if the node is expanded.
virtual void setExpanded( bool expanded ) = 0; virtual void setExpanded( bool expanded ) = 0;
//! Returns true if the node is currently selected. //! Returns true if the node is currently selected.
virtual bool getSelected() const = 0; virtual bool getSelected() const = 0;
//! Sets this node as selected. //! Sets this node as selected.
virtual void setSelected( bool selected ) = 0; virtual void setSelected( bool selected ) = 0;
//! Returns true if this node is the root node. //! Returns true if this node is the root node.
virtual bool isRoot() const = 0; virtual bool isRoot() const = 0;
//! Returns the level of this node. //! Returns the level of this node.
/** The root node has level 0. Direct childs of the root has level 1 ... */ /** The root node has level 0. Direct children of the root has level 1 ... */
virtual s32 getLevel() const = 0; virtual s32 getLevel() const = 0;
//! Returns true if this node is visible (all parents are expanded). //! Returns true if this node is visible (all parents are expanded).
virtual bool isVisible() const = 0; virtual bool isVisible() const = 0;
}; };
//! Default tree view GUI element. //! Default tree view GUI element.
/** Displays a windows like tree buttons to expand/collaps the child /** Displays a windows like tree buttons to expand/collaps the child
nodes of an node and optional tree lines. Each node consits of an nodes of an node and optional tree lines. Each node consits of an
...@@ -215,7 +229,7 @@ namespace gui ...@@ -215,7 +229,7 @@ namespace gui
//! returns true if the tree lines are visible //! returns true if the tree lines are visible
virtual bool getLinesVisible() const = 0; virtual bool getLinesVisible() const = 0;
//! sets if the tree lines are visible //! sets if the tree lines are visible
/** \param visible true for visible, false for invisible */ /** \param visible true for visible, false for invisible */
virtual void setLinesVisible( bool visible ) = 0; virtual void setLinesVisible( bool visible ) = 0;
...@@ -228,20 +242,20 @@ namespace gui ...@@ -228,20 +242,20 @@ namespace gui
strings defined in GUIIcons.h can be used. strings defined in GUIIcons.h can be used.
*/ */
virtual void setIconFont( IGUIFont* font ) = 0; virtual void setIconFont( IGUIFont* font ) = 0;
//! Sets the image list which should be used for the image and selected image of every node. //! Sets the image list which should be used for the image and selected image of every node.
/** The default is 0 (no images). */ /** The default is 0 (no images). */
virtual void setImageList( IGUIImageList* imageList ) = 0; virtual void setImageList( IGUIImageList* imageList ) = 0;
//! Returns the image list which is used for the nodes. //! Returns the image list which is used for the nodes.
virtual IGUIImageList* getImageList() const = 0; virtual IGUIImageList* getImageList() const = 0;
//! Sets if the image is left of the icon. Default is true. //! Sets if the image is left of the icon. Default is true.
virtual void setImageLeftOfIcon( bool bLeftOf ) = 0; virtual void setImageLeftOfIcon( bool bLeftOf ) = 0;
//! Returns if the Image is left of the icon. Default is true. //! Returns if the Image is left of the icon. Default is true.
virtual bool getImageLeftOfIcon() const = 0; virtual bool getImageLeftOfIcon() const = 0;
//! Returns the node which is associated to the last event. //! Returns the node which is associated to the last event.
/** This pointer is only valid inside the OnEvent call! */ /** This pointer is only valid inside the OnEvent call! */
virtual IGUITreeViewNode* getLastEventNode() const = 0; virtual IGUITreeViewNode* getLastEventNode() const = 0;
......
...@@ -260,7 +260,7 @@ namespace ...@@ -260,7 +260,7 @@ namespace
//! prefab for a container scene node //! prefab for a container scene node
//! Collects other prefabs and instantiates them upon instantiation //! Collects other prefabs and instantiates them upon instantiation
//! Uses a dummy scene node to return the childs as one scene node //! Uses a dummy scene node to return the children as one scene node
class CScenePrefab : public CPrefab class CScenePrefab : public CPrefab
{ {
public: public:
...@@ -279,7 +279,7 @@ namespace ...@@ -279,7 +279,7 @@ namespace
os::Printer::log("COLLADA: Constructing scene instance", Id.c_str()); os::Printer::log("COLLADA: Constructing scene instance", Id.c_str());
#endif #endif
if (Childs.size()==0) if (Children.size()==0)
return 0; return 0;
scene::IDummyTransformationSceneNode* s = mgr->addDummyTransformationSceneNode(parent); scene::IDummyTransformationSceneNode* s = mgr->addDummyTransformationSceneNode(parent);
...@@ -295,14 +295,14 @@ namespace ...@@ -295,14 +295,14 @@ namespace
} }
os::Printer::log("COLLADA: Transformation", t.c_str()); os::Printer::log("COLLADA: Transformation", t.c_str());
for (u32 i=0; i<Childs.size(); ++i) for (u32 i=0; i<Children.size(); ++i)
Childs[i]->addInstance(s, mgr); Children[i]->addInstance(s, mgr);
} }
return s; return s;
} }
core::array<IColladaPrefab*> Childs; core::array<IColladaPrefab*> Children;
core::matrix4 Transformation; core::matrix4 Transformation;
}; };
...@@ -737,7 +737,7 @@ void CColladaFileLoader::readNodeSection(io::IXMLReaderUTF8* reader, scene::ISce ...@@ -737,7 +737,7 @@ void CColladaFileLoader::readNodeSection(io::IXMLReaderUTF8* reader, scene::ISce
if (p) if (p)
{ {
nodeprefab = new CScenePrefab(readId(reader)); nodeprefab = new CScenePrefab(readId(reader));
p->Childs.push_back(nodeprefab); p->Children.push_back(nodeprefab);
Prefabs.push_back(nodeprefab); // in order to delete them later on Prefabs.push_back(nodeprefab); // in order to delete them later on
} }
...@@ -1132,7 +1132,7 @@ void CColladaFileLoader::instantiateNode(scene::ISceneNode* parent, ...@@ -1132,7 +1132,7 @@ void CColladaFileLoader::instantiateNode(scene::ISceneNode* parent,
if (url == "" || url == Prefabs[i]->getId()) if (url == "" || url == Prefabs[i]->getId())
{ {
if (p) if (p)
p->Childs.push_back(Prefabs[i]); p->Children.push_back(Prefabs[i]);
else else
if (CreateInstances) if (CreateInstances)
{ {
...@@ -1153,7 +1153,7 @@ void CColladaFileLoader::instantiateNode(scene::ISceneNode* parent, ...@@ -1153,7 +1153,7 @@ void CColladaFileLoader::instantiateNode(scene::ISceneNode* parent,
if (instanceGeometryName==type) if (instanceGeometryName==type)
{ {
Prefabs.push_back(new CGeometryPrefab(url)); Prefabs.push_back(new CGeometryPrefab(url));
p->Childs.push_back(Prefabs.getLast()); p->Children.push_back(Prefabs.getLast());
} }
} }
} }
...@@ -1661,7 +1661,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader) ...@@ -1661,7 +1661,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
core::array<SSource> sources; core::array<SSource> sources;
bool okToReadArray = false; bool okToReadArray = false;
// handles geometry node and the mesh childs in this loop // handles geometry node and the mesh children in this loop
// read sources with arrays and accessor for each mesh // read sources with arrays and accessor for each mesh
if (!reader->isEmptyElement()) if (!reader->isEmptyElement())
while(reader->read()) while(reader->read())
......
...@@ -214,7 +214,7 @@ private: ...@@ -214,7 +214,7 @@ private:
void readAssetSection(io::IXMLReaderUTF8* reader); void readAssetSection(io::IXMLReaderUTF8* reader);
//! reads a <node> section and its content //! reads a <node> section and its content
//! if a prefab pointer is passed the nodes are created as scene prefabs childs of that prefab //! if a prefab pointer is passed the nodes are created as scene prefabs children of that prefab
void readNodeSection(io::IXMLReaderUTF8* reader, scene::ISceneNode* parent, CScenePrefab* p=0); void readNodeSection(io::IXMLReaderUTF8* reader, scene::ISceneNode* parent, CScenePrefab* p=0);
//! reads a <lookat> element and its content and creates a matrix from it //! reads a <lookat> element and its content and creates a matrix from it
......
...@@ -64,7 +64,6 @@ void CCubeSceneNode::render() ...@@ -64,7 +64,6 @@ void CCubeSceneNode::render()
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
// for debug purposes only: // for debug purposes only:
bool renderMeshes = true;
video::SMaterial mat = Mesh->getMeshBuffer(0)->getMaterial(); video::SMaterial mat = Mesh->getMeshBuffer(0)->getMaterial();
// overwrite half transparency // overwrite half transparency
......
...@@ -32,9 +32,9 @@ CGUIModalScreen::CGUIModalScreen(IGUIEnvironment* environment, IGUIElement* pare ...@@ -32,9 +32,9 @@ CGUIModalScreen::CGUIModalScreen(IGUIEnvironment* environment, IGUIElement* pare
bool CGUIModalScreen::canTakeFocus(IGUIElement* target) const bool CGUIModalScreen::canTakeFocus(IGUIElement* target) const
{ {
return (target && ((const IGUIElement*)target == this // this element can take it return (target && ((const IGUIElement*)target == this // this element can take it
|| isMyChild(target) // own childs also || isMyChild(target) // own children also
|| (target->getType() == EGUIET_MODAL_SCREEN )// other modals also fine || (target->getType() == EGUIET_MODAL_SCREEN )// other modals also fine
|| (target->getParent() && target->getParent()->getType() == EGUIET_MODAL_SCREEN ))) // childs of other modals will do || (target->getParent() && target->getParent()->getType() == EGUIET_MODAL_SCREEN ))) // children of other modals will do
; ;
} }
......
...@@ -34,7 +34,7 @@ CGUITreeViewNode::~CGUITreeViewNode() ...@@ -34,7 +34,7 @@ CGUITreeViewNode::~CGUITreeViewNode()
setSelected( false ); setSelected( false );
} }
clearChilds(); clearChildren();
if( Data2 ) if( Data2 )
{ {
...@@ -62,15 +62,15 @@ void CGUITreeViewNode::setIcon( const wchar_t* icon ) ...@@ -62,15 +62,15 @@ void CGUITreeViewNode::setIcon( const wchar_t* icon )
Icon = icon; Icon = icon;
} }
void CGUITreeViewNode::clearChilds() void CGUITreeViewNode::clearChildren()
{ {
core::list<CGUITreeViewNode*>::Iterator it; core::list<CGUITreeViewNode*>::Iterator it;
for( it = Childs.begin(); it != Childs.end(); it++ ) for( it = Children.begin(); it != Children.end(); it++ )
{ {
( *it )->drop(); ( *it )->drop();
} }
Childs.clear(); Children.clear();
} }
IGUITreeViewNode* CGUITreeViewNode::addChildBack( IGUITreeViewNode* CGUITreeViewNode::addChildBack(
...@@ -83,7 +83,7 @@ IGUITreeViewNode* CGUITreeViewNode::addChildBack( ...@@ -83,7 +83,7 @@ IGUITreeViewNode* CGUITreeViewNode::addChildBack(
{ {
CGUITreeViewNode* newChild = new CGUITreeViewNode( Owner, this ); CGUITreeViewNode* newChild = new CGUITreeViewNode( Owner, this );
Childs.push_back( newChild ); Children.push_back( newChild );
newChild->Text = text; newChild->Text = text;
newChild->Icon = icon; newChild->Icon = icon;
newChild->ImageIndex = imageIndex; newChild->ImageIndex = imageIndex;
...@@ -107,7 +107,7 @@ IGUITreeViewNode* CGUITreeViewNode::addChildFront( ...@@ -107,7 +107,7 @@ IGUITreeViewNode* CGUITreeViewNode::addChildFront(
{ {
CGUITreeViewNode* newChild = new CGUITreeViewNode( Owner, this ); CGUITreeViewNode* newChild = new CGUITreeViewNode( Owner, this );
Childs.push_front( newChild ); Children.push_front( newChild );
newChild->Text = text; newChild->Text = text;
newChild->Icon = icon; newChild->Icon = icon;
newChild->ImageIndex = imageIndex; newChild->ImageIndex = imageIndex;
...@@ -133,7 +133,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildAfter( ...@@ -133,7 +133,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildAfter(
core::list<CGUITreeViewNode*>::Iterator itOther; core::list<CGUITreeViewNode*>::Iterator itOther;
CGUITreeViewNode* newChild = 0; CGUITreeViewNode* newChild = 0;
for( itOther = Childs.begin(); itOther != Childs.end(); itOther++ ) for( itOther = Children.begin(); itOther != Children.end(); itOther++ )
{ {
if( other == *itOther ) if( other == *itOther )
{ {
...@@ -148,7 +148,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildAfter( ...@@ -148,7 +148,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildAfter(
{ {
data2->grab(); data2->grab();
} }
Childs.insert_after( itOther, newChild ); Children.insert_after( itOther, newChild );
break; break;
} }
} }
...@@ -167,7 +167,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildBefore( ...@@ -167,7 +167,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildBefore(
core::list<CGUITreeViewNode*>::Iterator itOther; core::list<CGUITreeViewNode*>::Iterator itOther;
CGUITreeViewNode* newChild = 0; CGUITreeViewNode* newChild = 0;
for( itOther = Childs.begin(); itOther != Childs.end(); itOther++ ) for( itOther = Children.begin(); itOther != Children.end(); itOther++ )
{ {
if( other == *itOther ) if( other == *itOther )
{ {
...@@ -182,7 +182,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildBefore( ...@@ -182,7 +182,7 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildBefore(
{ {
data2->grab(); data2->grab();
} }
Childs.insert_before( itOther, newChild ); Children.insert_before( itOther, newChild );
break; break;
} }
} }
...@@ -191,25 +191,25 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildBefore( ...@@ -191,25 +191,25 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildBefore(
IGUITreeViewNode* CGUITreeViewNode::getFirstChild() const IGUITreeViewNode* CGUITreeViewNode::getFirstChild() const
{ {
if( Childs.empty() ) if( Children.empty() )
{ {
return 0; return 0;
} }
else else
{ {
return *( Childs.begin() ); return *( Children.begin() );
} }
} }
IGUITreeViewNode* CGUITreeViewNode::getLastChild() const IGUITreeViewNode* CGUITreeViewNode::getLastChild() const
{ {
if( Childs.empty() ) if( Children.empty() )
{ {
return 0; return 0;
} }
else else
{ {
return *( Childs.getLast() ); return *( Children.getLast() );
} }
} }
...@@ -221,11 +221,11 @@ IGUITreeViewNode* CGUITreeViewNode::getPrevSibling() const ...@@ -221,11 +221,11 @@ IGUITreeViewNode* CGUITreeViewNode::getPrevSibling() const
if( Parent ) if( Parent )
{ {
for( itThis = Parent->Childs.begin(); itThis != Parent->Childs.end(); itThis++ ) for( itThis = Parent->Children.begin(); itThis != Parent->Children.end(); itThis++ )
{ {
if( this == *itThis ) if( this == *itThis )
{ {
if( itThis != Parent->Childs.begin() ) if( itThis != Parent->Children.begin() )
{ {
other = *itOther; other = *itOther;
} }
...@@ -244,11 +244,11 @@ IGUITreeViewNode* CGUITreeViewNode::getNextSibling() const ...@@ -244,11 +244,11 @@ IGUITreeViewNode* CGUITreeViewNode::getNextSibling() const
if( Parent ) if( Parent )
{ {
for( itThis = Parent->Childs.begin(); itThis != Parent->Childs.end(); itThis++ ) for( itThis = Parent->Children.begin(); itThis != Parent->Children.end(); itThis++ )
{ {
if( this == *itThis ) if( this == *itThis )
{ {
if( itThis != Parent->Childs.getLast() ) if( itThis != Parent->Children.getLast() )
{ {
other = *( ++itThis ); other = *( ++itThis );
} }
...@@ -266,7 +266,7 @@ IGUITreeViewNode* CGUITreeViewNode::getNextVisible() const ...@@ -266,7 +266,7 @@ IGUITreeViewNode* CGUITreeViewNode::getNextVisible() const
node = const_cast<CGUITreeViewNode*>( this ); node = const_cast<CGUITreeViewNode*>( this );
if( node->getExpanded() && node->hasChilds() ) if( node->getExpanded() && node->hasChildren() )
{ {
next = node->getFirstChild(); next = node->getFirstChild();
} }
...@@ -291,12 +291,12 @@ bool CGUITreeViewNode::deleteChild( IGUITreeViewNode* child ) ...@@ -291,12 +291,12 @@ bool CGUITreeViewNode::deleteChild( IGUITreeViewNode* child )
core::list<CGUITreeViewNode*>::Iterator itChild; core::list<CGUITreeViewNode*>::Iterator itChild;
bool deleted = false; bool deleted = false;
for( itChild = Childs.begin(); itChild != Childs.end(); itChild++ ) for( itChild = Children.begin(); itChild != Children.end(); itChild++ )
{ {
if( child == *itChild ) if( child == *itChild )
{ {
child->drop(); child->drop();
Childs.erase( itChild ); Children.erase( itChild );
deleted = true; deleted = true;
break; break;
} }
...@@ -311,11 +311,11 @@ bool CGUITreeViewNode::moveChildUp( IGUITreeViewNode* child ) ...@@ -311,11 +311,11 @@ bool CGUITreeViewNode::moveChildUp( IGUITreeViewNode* child )
CGUITreeViewNode* nodeTmp; CGUITreeViewNode* nodeTmp;
bool moved = false; bool moved = false;
for( itChild = Childs.begin(); itChild != Childs.end(); itChild++ ) for( itChild = Children.begin(); itChild != Children.end(); itChild++ )
{ {
if( child == *itChild ) if( child == *itChild )
{ {
if( itChild != Childs.begin() ) if( itChild != Children.begin() )
{ {
nodeTmp = *itChild; nodeTmp = *itChild;
*itChild = *itOther; *itChild = *itOther;
...@@ -336,11 +336,11 @@ bool CGUITreeViewNode::moveChildDown( IGUITreeViewNode* child ) ...@@ -336,11 +336,11 @@ bool CGUITreeViewNode::moveChildDown( IGUITreeViewNode* child )
CGUITreeViewNode* nodeTmp; CGUITreeViewNode* nodeTmp;
bool moved = false; bool moved = false;
for( itChild = Childs.begin(); itChild != Childs.end(); itChild++ ) for( itChild = Children.begin(); itChild != Children.end(); itChild++ )
{ {
if( child == *itChild ) if( child == *itChild )
{ {
if( itChild != Childs.getLast() ) if( itChild != Children.getLast() )
{ {
itOther = itChild; itOther = itChild;
++itOther; ++itOther;
...@@ -731,7 +731,7 @@ void CGUITreeView::mouseAction( s32 xpos, s32 ypos, bool onlyHover /*= false*/ ) ...@@ -731,7 +731,7 @@ void CGUITreeView::mouseAction( s32 xpos, s32 ypos, bool onlyHover /*= false*/ )
if( hitNode && !onlyHover if( hitNode && !onlyHover
&& xpos < hitNode->getLevel() * IndentWidth && xpos < hitNode->getLevel() * IndentWidth
&& xpos > ( hitNode->getLevel() - 1 ) * IndentWidth && xpos > ( hitNode->getLevel() - 1 ) * IndentWidth
&& hitNode->hasChilds() ) && hitNode->hasChildren() )
{ {
hitNode->setExpanded( !hitNode->getExpanded() ); hitNode->setExpanded( !hitNode->getExpanded() );
...@@ -873,7 +873,7 @@ void CGUITreeView::draw() ...@@ -873,7 +873,7 @@ void CGUITreeView::draw()
driver->draw2DRectangle( skin->getColor( EGDC_HIGH_LIGHT ), frameRect, &clientClip ); driver->draw2DRectangle( skin->getColor( EGDC_HIGH_LIGHT ), frameRect, &clientClip );
} }
if( node->hasChilds() ) if( node->hasChildren() )
{ {
core::rect<s32> rc; core::rect<s32> rc;
core::rect<s32> expanderRect; core::rect<s32> expanderRect;
...@@ -984,7 +984,7 @@ void CGUITreeView::draw() ...@@ -984,7 +984,7 @@ void CGUITreeView::draw()
// horizontal line // horizontal line
rc.UpperLeftCorner.X = frameRect.UpperLeftCorner.X - IndentWidth - ( IndentWidth >> 1 ) - 1; rc.UpperLeftCorner.X = frameRect.UpperLeftCorner.X - IndentWidth - ( IndentWidth >> 1 ) - 1;
rc.UpperLeftCorner.Y = frameRect.UpperLeftCorner.Y + ( ( frameRect.getHeight() ) >> 1 ); rc.UpperLeftCorner.Y = frameRect.UpperLeftCorner.Y + ( ( frameRect.getHeight() ) >> 1 );
if( node->hasChilds() ) if( node->hasChildren() )
{ {
rc.LowerRightCorner.X = frameRect.UpperLeftCorner.X - IndentWidth; rc.LowerRightCorner.X = frameRect.UpperLeftCorner.X - IndentWidth;
} }
......
...@@ -21,62 +21,62 @@ namespace gui ...@@ -21,62 +21,62 @@ namespace gui
class CGUITreeViewNode : public IGUITreeViewNode class CGUITreeViewNode : public IGUITreeViewNode
{ {
friend class CGUITreeView; friend class CGUITreeView;
public: public:
//! constructor //! constructor
CGUITreeViewNode( CGUITreeView* owner, CGUITreeViewNode* parent ); CGUITreeViewNode( CGUITreeView* owner, CGUITreeViewNode* parent );
//! destructor //! destructor
~CGUITreeViewNode(); ~CGUITreeViewNode();
//! returns the owner (tree view) of this node //! returns the owner (tree view) of this node
virtual IGUITreeView* getOwner() const; virtual IGUITreeView* getOwner() const;
//! Returns the parent node of this node. //! Returns the parent node of this node.
virtual IGUITreeViewNode* getParent() const; virtual IGUITreeViewNode* getParent() const;
//! returns the text of the node //! returns the text of the node
virtual const wchar_t* getText() const virtual const wchar_t* getText() const
{ return Text.c_str(); } { return Text.c_str(); }
//! sets the text of the node //! sets the text of the node
virtual void setText( const wchar_t* text ); virtual void setText( const wchar_t* text );
//! returns the icon text of the node //! returns the icon text of the node
virtual const wchar_t* getIcon() const virtual const wchar_t* getIcon() const
{ return Icon.c_str(); } { return Icon.c_str(); }
//! sets the icon text of the node //! sets the icon text of the node
virtual void setIcon( const wchar_t* icon ); virtual void setIcon( const wchar_t* icon );
//! returns the image index of the node //! returns the image index of the node
virtual u32 getImageIndex() const virtual u32 getImageIndex() const
{ return ImageIndex; } { return ImageIndex; }
//! sets the image index of the node //! sets the image index of the node
virtual void setImageIndex( u32 imageIndex ) virtual void setImageIndex( u32 imageIndex )
{ ImageIndex = imageIndex; } { ImageIndex = imageIndex; }
//! returns the image index of the node //! returns the image index of the node
virtual u32 getSelectedImageIndex() const virtual u32 getSelectedImageIndex() const
{ return SelectedImageIndex; } { return SelectedImageIndex; }
//! sets the image index of the node //! sets the image index of the node
virtual void setSelectedImageIndex( u32 imageIndex ) virtual void setSelectedImageIndex( u32 imageIndex )
{ SelectedImageIndex = imageIndex; } { SelectedImageIndex = imageIndex; }
//! returns the user data (void*) of this node //! returns the user data (void*) of this node
virtual void* getData() const virtual void* getData() const
{ return Data; } { return Data; }
//! sets the user data (void*) of this node //! sets the user data (void*) of this node
virtual void setData( void* data ) virtual void setData( void* data )
{ Data = data; } { Data = data; }
//! returns the user data2 (IReferenceCounted) of this node //! returns the user data2 (IReferenceCounted) of this node
virtual IReferenceCounted* getData2() const virtual IReferenceCounted* getData2() const
{ return Data2; } { return Data2; }
//! sets the user data2 (IReferenceCounted) of this node //! sets the user data2 (IReferenceCounted) of this node
virtual void setData2( IReferenceCounted* data ) virtual void setData2( IReferenceCounted* data )
{ {
...@@ -90,18 +90,18 @@ namespace gui ...@@ -90,18 +90,18 @@ namespace gui
Data2->grab(); Data2->grab();
} }
} }
//! returns the child item count //! returns the child item count
virtual u32 getChildCount() const virtual u32 getChildCount() const
{ return Childs.getSize(); } { return Children.getSize(); }
//! removes all childs (recursive) from this node //! removes all children (recursive) from this node
virtual void clearChilds(); virtual void clearChildren();
//! returns true if this node has child nodes //! returns true if this node has child nodes
virtual bool hasChilds() const virtual bool hasChildren() const
{ return !Childs.empty(); } { return !Children.empty(); }
//! Adds a new node behind the last child node. //! Adds a new node behind the last child node.
//! \param text text of the new node //! \param text text of the new node
//! \param icon icon text of the new node //! \param icon icon text of the new node
...@@ -111,9 +111,9 @@ namespace gui ...@@ -111,9 +111,9 @@ namespace gui
//! \param data2 user data2 (IReferenceCounted*) of the new node //! \param data2 user data2 (IReferenceCounted*) of the new node
//! \return //! \return
//! returns the new node //! returns the new node
virtual IGUITreeViewNode* addChildBack( virtual IGUITreeViewNode* addChildBack(
const wchar_t* text, const wchar_t* text,
const wchar_t* icon = 0, const wchar_t* icon = 0,
s32 imageIndex = -1, s32 imageIndex = -1,
s32 selectedImageIndex = -1, s32 selectedImageIndex = -1,
void* data = 0, void* data = 0,
...@@ -128,15 +128,15 @@ namespace gui ...@@ -128,15 +128,15 @@ namespace gui
//! \param data2 user data2 (IReferenceCounted*) of the new node //! \param data2 user data2 (IReferenceCounted*) of the new node
//! \return //! \return
//! returns the new node //! returns the new node
virtual IGUITreeViewNode* addChildFront( virtual IGUITreeViewNode* addChildFront(
const wchar_t* text, const wchar_t* text,
const wchar_t* icon = 0, const wchar_t* icon = 0,
s32 imageIndex = -1, s32 imageIndex = -1,
s32 selectedImageIndex = -1, s32 selectedImageIndex = -1,
void* data = 0, void* data = 0,
IReferenceCounted* data2 = 0 ); IReferenceCounted* data2 = 0 );
//! Adds a new node behind the other node. //! Adds a new node behind the other node.
//! The other node has also te be a child node from this node. //! The other node has also te be a child node from this node.
//! \param text text of the new node //! \param text text of the new node
//! \param icon icon text of the new node //! \param icon icon text of the new node
...@@ -146,16 +146,16 @@ namespace gui ...@@ -146,16 +146,16 @@ namespace gui
//! \param data2 user data2 (IReferenceCounted*) of the new node //! \param data2 user data2 (IReferenceCounted*) of the new node
//! \return //! \return
//! returns the new node or 0 if other is no child node from this //! returns the new node or 0 if other is no child node from this
virtual IGUITreeViewNode* insertChildAfter( virtual IGUITreeViewNode* insertChildAfter(
IGUITreeViewNode* other, IGUITreeViewNode* other,
const wchar_t* text, const wchar_t* text,
const wchar_t* icon = 0, const wchar_t* icon = 0,
s32 imageIndex = -1, s32 imageIndex = -1,
s32 selectedImageIndex = -1, s32 selectedImageIndex = -1,
void* data = 0, void* data = 0,
IReferenceCounted* data2 = 0 ); IReferenceCounted* data2 = 0 );
//! Adds a new node before the other node. //! Adds a new node before the other node.
//! The other node has also te be a child node from this node. //! The other node has also te be a child node from this node.
//! \param text text of the new node //! \param text text of the new node
//! \param icon icon text of the new node //! \param icon icon text of the new node
...@@ -165,10 +165,10 @@ namespace gui ...@@ -165,10 +165,10 @@ namespace gui
//! \param data2 user data2 (IReferenceCounted*) of the new node //! \param data2 user data2 (IReferenceCounted*) of the new node
//! \return //! \return
//! returns the new node or 0 if other is no child node from this //! returns the new node or 0 if other is no child node from this
virtual IGUITreeViewNode* insertChildBefore( virtual IGUITreeViewNode* insertChildBefore(
IGUITreeViewNode* other, IGUITreeViewNode* other,
const wchar_t* text, const wchar_t* text,
const wchar_t* icon = 0, const wchar_t* icon = 0,
s32 imageIndex = -1, s32 imageIndex = -1,
s32 selectedImageIndex = -1, s32 selectedImageIndex = -1,
void* data = 0, void* data = 0,
...@@ -197,31 +197,31 @@ namespace gui ...@@ -197,31 +197,31 @@ namespace gui
//! Moves a child node one position down. //! Moves a child node one position down.
virtual bool moveChildDown( IGUITreeViewNode* child ); virtual bool moveChildDown( IGUITreeViewNode* child );
//! Returns true if the node is expanded (childs are visible). //! Returns true if the node is expanded (children are visible).
virtual bool getExpanded() const virtual bool getExpanded() const
{ return Expanded; } { return Expanded; }
//! Sets if the node is expanded. //! Sets if the node is expanded.
virtual void setExpanded( bool expanded ); virtual void setExpanded( bool expanded );
//! Returns true if the node is currently selected. //! Returns true if the node is currently selected.
virtual bool getSelected() const; virtual bool getSelected() const;
//! Sets this node as selected. //! Sets this node as selected.
virtual void setSelected( bool selected ); virtual void setSelected( bool selected );
//! Returns true if this node is the root node. //! Returns true if this node is the root node.
virtual bool isRoot() const; virtual bool isRoot() const;
//! Returns the level of this node. //! Returns the level of this node.
virtual s32 getLevel() const; virtual s32 getLevel() const;
//! Returns true if this node is visible (all parents are expanded). //! Returns true if this node is visible (all parents are expanded).
virtual bool isVisible() const; virtual bool isVisible() const;
private: private:
CGUITreeView* Owner; CGUITreeView* Owner;
CGUITreeViewNode* Parent; CGUITreeViewNode* Parent;
core::stringw Text; core::stringw Text;
...@@ -231,7 +231,7 @@ namespace gui ...@@ -231,7 +231,7 @@ namespace gui
void* Data; void* Data;
IReferenceCounted* Data2; IReferenceCounted* Data2;
bool Expanded; bool Expanded;
core::list<CGUITreeViewNode*> Childs; core::list<CGUITreeViewNode*> Children;
}; };
...@@ -239,10 +239,10 @@ namespace gui ...@@ -239,10 +239,10 @@ namespace gui
class CGUITreeView : public IGUITreeView class CGUITreeView : public IGUITreeView
{ {
friend class CGUITreeViewNode; friend class CGUITreeViewNode;
public: public:
//! constructor //! constructor
CGUITreeView( IGUIEnvironment* environment, IGUIElement* parent, CGUITreeView( 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 scrollBarVertical = true, bool scrollBarHorizontal = true ); bool drawBack = false, bool scrollBarVertical = true, bool scrollBarHorizontal = true );
...@@ -280,15 +280,15 @@ namespace gui ...@@ -280,15 +280,15 @@ namespace gui
//! Sets the image list which should be used for the image and selected image of every node. //! Sets the image list which should be used for the image and selected image of every node.
//! The default is 0 (no images). //! The default is 0 (no images).
virtual void setImageList( IGUIImageList* imageList ); virtual void setImageList( IGUIImageList* imageList );
//! Returns the image list which is used for the nodes. //! Returns the image list which is used for the nodes.
virtual IGUIImageList* getImageList() const virtual IGUIImageList* getImageList() const
{ return ImageList; } { return ImageList; }
//! Sets if the image is left of the icon. Default is true. //! Sets if the image is left of the icon. Default is true.
virtual void setImageLeftOfIcon( bool bLeftOf ) virtual void setImageLeftOfIcon( bool bLeftOf )
{ ImageLeftOfIcon = bLeftOf; } { ImageLeftOfIcon = bLeftOf; }
//! Returns if the Image is left of the icon. Default is true. //! Returns if the Image is left of the icon. Default is true.
virtual bool getImageLeftOfIcon() const virtual bool getImageLeftOfIcon() const
{ return ImageLeftOfIcon; } { return ImageLeftOfIcon; }
...@@ -300,7 +300,7 @@ namespace gui ...@@ -300,7 +300,7 @@ namespace gui
private: private:
//! calculates the heigth of an node and of all visible nodes. //! calculates the heigth of an node and of all visible nodes.
void recalculateItemHeight(); void recalculateItemHeight();
//! executes an mouse action (like selectNew of CGUIListBox) //! executes an mouse action (like selectNew of CGUIListBox)
void mouseAction( s32 xpos, s32 ypos, bool onlyHover = false ); void mouseAction( s32 xpos, s32 ypos, bool onlyHover = false );
......
...@@ -329,7 +329,7 @@ private: ...@@ -329,7 +329,7 @@ private:
return; return;
#if defined (OCTREE_PARENTTEST ) #if defined (OCTREE_PARENTTEST )
if ( r == core::ISREL3D_CLIPPED ) if ( r == core::ISREL3D_CLIPPED )
parentTest = 1; // must still check childs parentTest = 1; // must still check children
#endif #endif
} }
} }
......
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