* Added ItemAt() method that accepts column and row.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40154 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-01-08 16:14:13 +00:00
parent f6d3241dac
commit 24a77ea0be
2 changed files with 21 additions and 6 deletions
+5 -1
View File
@@ -1,10 +1,11 @@
/* /*
* Copyright 2006-2010, Haiku, Inc. All rights reserved. * Copyright 2006-2011, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _GRID_LAYOUT_H #ifndef _GRID_LAYOUT_H
#define _GRID_LAYOUT_H #define _GRID_LAYOUT_H
#include <TwoDimensionalLayout.h> #include <TwoDimensionalLayout.h>
@@ -44,6 +45,8 @@ public:
float MaxRowHeight(int32 row) const; float MaxRowHeight(int32 row) const;
void SetMaxRowHeight(int32 row, float height); void SetMaxRowHeight(int32 row, float height);
BLayoutItem* ItemAt(int32 column, int32 row) const;
virtual BLayoutItem* AddView(BView* child); virtual BLayoutItem* AddView(BView* child);
virtual BLayoutItem* AddView(int32 index, BView* child); virtual BLayoutItem* AddView(int32 index, BView* child);
virtual BLayoutItem* AddView(BView* child, int32 column, int32 row, virtual BLayoutItem* AddView(BView* child, int32 column, int32 row,
@@ -105,4 +108,5 @@ private:
int32 fMultiRowItems; int32 fMultiRowItems;
}; };
#endif // _GRID_LAYOUT_H #endif // _GRID_LAYOUT_H
+12 -1
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010, Haiku Inc. * Copyright 2010-2011, Haiku Inc.
* Copyright 2006, Ingo Weinhold <[email protected]>. * Copyright 2006, Ingo Weinhold <[email protected]>.
* All rights reserved. Distributed under the terms of the MIT License. * All rights reserved. Distributed under the terms of the MIT License.
*/ */
@@ -372,6 +372,17 @@ BGridLayout::SetMaxRowHeight(int32 row, float height)
} }
BLayoutItem*
BGridLayout::ItemAt(int32 column, int32 row) const
{
if (column < 0 || column >= CountColumns()
|| row < 0 || row >= CountRows())
return NULL;
return fGrid[column][row];
}
BLayoutItem* BLayoutItem*
BGridLayout::AddView(BView* child) BGridLayout::AddView(BView* child)
{ {