patch by Rene Gollent:

* BListItems now store the top offset of the frame within the parent BListView.
* This allows binary searching the clicked item.
* ItemFrame() is now a cheap call.
* Fixed several bugs in the sorting code of BOutlineListView which lead to
  crashes of client applications.
* Implemented previously unimplemented functions in BOutlineListView.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24092 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-02-24 14:15:28 +00:00
parent 6213408838
commit fef3930499
5 changed files with 172 additions and 91 deletions
+19 -4
View File
@@ -18,7 +18,8 @@ class BView;
class BListItem : public BArchivable {
public:
BListItem(uint32 outlineLevel = 0, bool expanded = true);
BListItem(uint32 outlineLevel = 0,
bool expanded = true);
BListItem(BMessage* archive);
virtual ~BListItem();
@@ -47,7 +48,7 @@ class BListItem : public BArchivable {
private:
friend class BOutlineListView;
friend class BListView;
bool HasSubitems() const;
virtual void _ReservedListItem1();
@@ -58,9 +59,11 @@ class BListItem : public BArchivable {
bool IsItemVisible() const;
void SetItemVisible(bool visible);
inline float Top() const;
inline float Bottom() const;
void SetTop(float top);
private:
uint32 _reserved[1];
float fTop;
BList* fTemporaryList;
float fWidth;
float fHeight;
@@ -72,6 +75,18 @@ class BListItem : public BArchivable {
bool fVisible : 1;
};
inline float
BListItem::Top(void) const
{
return fTop;
}
inline float
BListItem::Bottom(void) const
{
return (fTop + ceilf(fHeight) - 1.0);
}
#include <StringItem.h>
// to maintain source compatibility