Filled in a few functions

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2899 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-03-12 14:56:20 +00:00
parent 59a15bb433
commit ad41204bbc
+35
View File
@@ -159,26 +159,55 @@ bool BView::RemoveChild(BView *child)
int32 BView::CountChildren() const int32 BView::CountChildren() const
{ {
int32 count=0;
if(BView *child=first_child)
{
while (child)
{
count++;
child=child->next_sibling;
}
}
} }
BView *BView::ChildAt(int32 index) const BView *BView::ChildAt(int32 index) const
{ {
int32 count=0;
if(BView *child=first_child)
{
while (child)
{
count++;
child=child->next_sibling;
if(count==index)
return child;
}
}
return NULL;
} }
BView *BView::NextSibling() const BView *BView::NextSibling() const
{ {
return next_sibling;
} }
BView *BView::PreviousSibling() const BView *BView::PreviousSibling() const
{ {
return prev_sibling;
} }
bool BView::RemoveSelf() bool BView::RemoveSelf()
{ {
if(!parent)
return false;
parent->RemoveChild(this);
return true;
} }
BWindow *BView::Window() const BWindow *BView::Window() const
{ {
return owner;
} }
void BView::Draw(BRect updateRect) void BView::Draw(BRect updateRect)
@@ -255,14 +284,19 @@ BView *BView::FindView(const char *name) const
BView *BView::Parent() const BView *BView::Parent() const
{ {
return parent;
} }
BRect BView::Bounds() const BRect BView::Bounds() const
{ {
BRect bounds=fCachedBounds;
bounds.OffsetTo(0,0);
return bounds;
} }
BRect BView::Frame() const BRect BView::Frame() const
{ {
return fCachedBounds;
} }
void BView::ConvertToScreen(BPoint* pt) const void BView::ConvertToScreen(BPoint* pt) const
@@ -831,6 +865,7 @@ void BView::Hide()
bool BView::IsHidden() const bool BView::IsHidden() const
{ {
return (fShowLevel==0)?false:true;
} }
bool BView::IsHidden(const BView* looking_from) const bool BView::IsHidden(const BView* looking_from) const