haiku/src/libs/alm/RowColumnManager.h
Clemens Zeidler ef93b55df4 - Areas with same tabs are put in a column/row automtically. Move preferred size constraint from Area to the column/row. This avoids a "spring" effect of the
quadratic solver if multiple Areas are in the same column/row.
- Replace GetString by ToString.
- some clean up



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-14 00:24:12 +00:00

56 lines
1.1 KiB
C++

/*
* Copyright 2011, Haiku, Inc. All rights reserved.
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#ifndef ROW_COLUMN_MANAGER_H
#define ROW_COLUMN_MANAGER_H
#include "Area.h"
#include "Column.h"
#include "LinearSpec.h"
#include "Row.h"
#include "Tab.h"
namespace BALM {
class RowColumnManager {
public:
RowColumnManager(LinearSpec* spec);
~RowColumnManager();
void AddArea(Area* area);
void RemoveArea(Area* area);
void UpdateConstraints();
void TabsChanged(Area* area);
Row* CreateRow(YTab* top, YTab* bottom);
Column* CreateColumn(XTab* left, XTab* right);
private:
Row* _FindRowFor(Area* area);
Column* _FindColumnFor(Area* area);
double _PreferredHeight(Row* row,
double& weight);
double _PreferredWidth(Column* column,
double& weight);
void _UpdateConstraints(Row* row);
void _UpdateConstraints(Column* column);
BObjectList<Row> fRows;
BObjectList<Column> fColumns;
LinearSpec* fLinearSpec;
};
} // namespace BALM
#endif // ROW_COLUMN_MANAGER_H