openscenegraph
include
osgWidget
Table
Go to the documentation of this file.
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2
*
3
* This library is open source and may be redistributed and/or modified under
4
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5
* (at your option) any later version. The full license is in LICENSE file
6
* included with this distribution, and on the openscenegraph.org website.
7
*
8
* This library is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* OpenSceneGraph Public License for more details.
12
*/
13
14
// Code by: Jeremy Moles (cubicool) 2007-2008
15
16
#ifndef OSGWIDGET_TABLE
17
#define OSGWIDGET_TABLE
18
19
#include <
osgWidget/Window
>
20
21
namespace
osgWidget
{
22
23
class
OSGWIDGET_EXPORT
Table
:
public
Window
24
{
25
public
:
26
27
typedef
std::vector<point_type>
CellSizes
;
28
29
META_Object
(
osgWidget
,
Table
);
30
31
Table
(
const
std::string& =
""
,
unsigned
int
= 0,
unsigned
int
= 0);
32
Table
(
const
Table
&,
const
osg::CopyOp
&);
33
34
virtual
bool
addWidget
(
Widget
*);
35
virtual
bool
addWidget
(
Widget
*,
unsigned
int
,
unsigned
int
);
36
37
void
getRowHeights
(
CellSizes
&)
const
;
38
void
getRowMinHeights
(
CellSizes
&)
const
;
39
void
getColumnWidths
(
CellSizes
&)
const
;
40
void
getColumnMinWidths
(
CellSizes
&)
const
;
41
42
void
addHeightToRow
(
unsigned
int
,
point_type
);
43
void
addWidthToColumn
(
unsigned
int
,
point_type
);
44
45
bool
isRowVerticallyFillable
(
unsigned
int
)
const
;
46
bool
isColumnHorizontallyFillable
(
unsigned
int
)
const
;
47
48
Widget
*
getByRowCol
(
unsigned
int
row,
unsigned
int
col)
49
{
50
return
getObjects()[_calculateIndex(row, col)].get();
51
}
52
53
const
Widget
*
getByRowCol
(
unsigned
int
row,
unsigned
int
col)
const
54
{
55
return
getObjects()[_calculateIndex(row, col)].get();
56
}
57
58
protected
:
59
60
unsigned
int
_rows
;
61
unsigned
int
_cols
;
62
unsigned
int
_lastRowAdd
;
63
unsigned
int
_lastColAdd
;
64
65
unsigned
int
_calculateIndex
(
unsigned
int
,
unsigned
int
)
const
;
66
67
void
_getRows
(
CellSizes
&, Getter)
const
;
68
void
_getColumns
(
CellSizes
&, Getter)
const
;
69
70
virtual
void
_resizeImplementation
(
point_type
,
point_type
);
71
72
virtual
Sizes
_getWidthImplementation
()
const
;
73
virtual
Sizes
_getHeightImplementation
()
const
;
74
};
75
76
}
77
78
#endif
Window
osgWidget::Table
Definition
Table:24
osgWidget::Table::addWidget
virtual bool addWidget(Widget *)
osgWidget::Table::_rows
unsigned int _rows
Definition
Table:60
osgWidget::Table::addWidthToColumn
void addWidthToColumn(unsigned int, point_type)
osgWidget::Table::getByRowCol
const Widget * getByRowCol(unsigned int row, unsigned int col) const
Definition
Table:53
osgWidget::Table::_lastRowAdd
unsigned int _lastRowAdd
Definition
Table:62
osgWidget::Table::getColumnWidths
void getColumnWidths(CellSizes &) const
osgWidget::Table::getColumnMinWidths
void getColumnMinWidths(CellSizes &) const
osgWidget::Table::_cols
unsigned int _cols
Definition
Table:61
osgWidget::Table::META_Object
META_Object(osgWidget, Table)
osgWidget::Table::addWidget
virtual bool addWidget(Widget *, unsigned int, unsigned int)
osgWidget::Table::_getHeightImplementation
virtual Sizes _getHeightImplementation() const
osgWidget::Table::isColumnHorizontallyFillable
bool isColumnHorizontallyFillable(unsigned int) const
osgWidget::Table::Table
Table(const Table &, const osg::CopyOp &)
osgWidget::Table::_getWidthImplementation
virtual Sizes _getWidthImplementation() const
osgWidget::Table::getRowHeights
void getRowHeights(CellSizes &) const
osgWidget::Table::Table
Table(const std::string &="", unsigned int=0, unsigned int=0)
osgWidget::Table::addHeightToRow
void addHeightToRow(unsigned int, point_type)
osgWidget::Table::_resizeImplementation
virtual void _resizeImplementation(point_type, point_type)
osgWidget::Table::getRowMinHeights
void getRowMinHeights(CellSizes &) const
osgWidget::Table::getByRowCol
Widget * getByRowCol(unsigned int row, unsigned int col)
Definition
Table:48
osgWidget::Table::_getRows
void _getRows(CellSizes &, Getter) const
osgWidget::Table::_calculateIndex
unsigned int _calculateIndex(unsigned int, unsigned int) const
osgWidget::Table::CellSizes
std::vector< point_type > CellSizes
Definition
Table:27
osgWidget::Table::_lastColAdd
unsigned int _lastColAdd
Definition
Table:63
osgWidget::Table::isRowVerticallyFillable
bool isRowVerticallyFillable(unsigned int) const
osgWidget::Table::_getColumns
void _getColumns(CellSizes &, Getter) const
osgWidget::Widget
Definition
osgWidget/Widget:35
osgWidget::Window
Definition
Window:44
osg::CopyOp
Definition
CopyOp:41
osgWidget
Definition
Box:21
osgWidget::point_type
Point::value_type point_type
Definition
osgWidget/Types:33
OSGWIDGET_EXPORT
#define OSGWIDGET_EXPORT
Definition
osgWidget/Export:42
osgWidget::Window::Sizes
Definition
Window:49
Generated by
1.9.8