From: DaveG <da...@us...> - 2006-03-17 10:40:06
|
Update of /cvsroot/planeshift/planeshift/src/common/paws In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1773/src/common/paws Modified Files: pawstree.cpp Log Message: committing patch from okeuday to fix expanding/collapsing of sub-branches and a crash from giving branches descriptions Index: pawstree.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/paws/pawstree.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** pawstree.cpp 1 Mar 2006 17:51:31 -0000 1.35 --- pawstree.cpp 17 Mar 2006 10:39:58 -0000 1.36 *************** *** 884,891 **** if (target != NULL) { ! if (target->IsCollapsed()) ! target->Expand(); ! else ! target->Collapse(); } } --- 884,897 ---- if (target != NULL) { ! // has the currently processed node collapse/expand sign ? ! bool hasCollSign = target->IsCollapsable() && ! (target->GetFirstChild() != NULL); ! if (hasCollSign) ! { ! if (target->IsCollapsed()) ! target->Expand(); ! else ! target->Collapse(); ! } } } *************** *** 895,909 **** void pawsStdTreeDecorator::GetCollapseSignFrame(pawsTreeNode * node, csRect & rect) { ! pawsImage * currSign; ! csRect nodeFrame; ! ! if (node->IsCollapsed()) ! currSign = expandImage; ! else ! currSign = collImage; ! if (currSign == NULL) ! return; ! ! nodeFrame = node->ScreenFrame(); rect.SetPos(nodeFrame.xmin - collSpacing - 2, nodeFrame.ymin + nodeFrame.Height()/2 - 4); --- 901,905 ---- void pawsStdTreeDecorator::GetCollapseSignFrame(pawsTreeNode * node, csRect & rect) { ! csRect nodeFrame = node->ScreenFrame(); rect.SetPos(nodeFrame.xmin - collSpacing - 2, nodeFrame.ymin + nodeFrame.Height()/2 - 4); *************** *** 917,923 **** ! GetCollapseSignFrame(subtreeRoot, signFrame); ! if (signFrame.Contains(x, y)) ! return subtreeRoot; child = subtreeRoot->GetFirstChild(); --- 913,925 ---- ! // has the currently processed node collapse/expand sign ? ! bool hasCollSign = subtreeRoot->IsCollapsable() && ! (subtreeRoot->GetFirstChild() != NULL); ! if (hasCollSign) ! { ! GetCollapseSignFrame(subtreeRoot, signFrame); ! if (signFrame.Contains(x, y)) ! return subtreeRoot; ! } child = subtreeRoot->GetFirstChild(); |