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