From cac9f196d8b8d67044da27ff5b557c66c66233b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 7 May 2010 11:24:25 +0000 Subject: [PATCH] * Added BListItem::SetOutlineLevel() method. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36713 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/ListItem.h | 7 +++++-- src/kits/interface/ListItem.cpp | 12 ++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/headers/os/interface/ListItem.h b/headers/os/interface/ListItem.h index 89d614a65a..3f7976428a 100644 --- a/headers/os/interface/ListItem.h +++ b/headers/os/interface/ListItem.h @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009, Haiku, Inc. All rights reserved. + * Copyright 2006-2010, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef _LIST_ITEM_H @@ -9,6 +9,7 @@ #include #include + class BFont; class BList; class BMessage; @@ -44,6 +45,7 @@ public: bool IsExpanded() const; void SetExpanded(bool expanded); uint32 OutlineLevel() const; + void SetOutlineLevel(uint32 level); virtual status_t Perform(perform_code code, void* arg); @@ -83,7 +85,7 @@ private: inline float -BListItem::Top(void) const +BListItem::Top(void) const { return fTop; } @@ -99,4 +101,5 @@ BListItem::Bottom(void) const #include // to maintain source compatibility + #endif // _LIST_ITEM_H diff --git a/src/kits/interface/ListItem.cpp b/src/kits/interface/ListItem.cpp index 22d5268038..b2d9dd9d4c 100644 --- a/src/kits/interface/ListItem.cpp +++ b/src/kits/interface/ListItem.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009, Haiku, Inc. All Rights Reserved. + * Copyright 2001-2010, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -8,6 +8,7 @@ * Rene Gollent */ + #include #include @@ -65,7 +66,7 @@ BListItem::Archive(BMessage* archive, bool deep) const status_t status = BArchivable::Archive(archive, deep); if (status == B_OK && fSelected) status = archive->AddBool("_sel", true); - + if (status == B_OK && !fEnabled) status = archive->AddBool("_disable", true); @@ -181,6 +182,13 @@ BListItem::OutlineLevel() const } +void +BListItem::SetOutlineLevel(uint32 level) +{ + fLevel = level; +} + + bool BListItem::HasSubitems() const {