Mana
Loading...
Searching...
No Matches
container.cpp
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
23
25
27{
28 setOpaque(false);
29}
30
32{
33 while (!mWidgets.empty())
34 delete mWidgets.front();
35
36 delete mLayoutHelper;
37}
38
45
46LayoutCell &Container::place(int x, int y, gcn::Widget *wg, int w, int h)
47{
48 add(wg);
49 return getLayout().place(wg, x, y, w, h);
50}
51
53{
54 return ContainerPlacer(this, &getLayout().at(x, y));
55}
This class is a helper for adding widgets to nested tables in a window.
Definition layout.h:34
LayoutHelper * mLayoutHelper
Definition container.h:66
LayoutCell & place(int x, int y, gcn::Widget *wg, int w=1, int h=1)
Adds a widget to the container and sets it at given cell.
Definition container.cpp:46
Layout & getLayout()
Gets the layout handler for this container.
Definition container.cpp:39
ContainerPlacer getPlacer(int x, int y)
Returns a proxy for adding widgets in an inner table of the layout.
Definition container.cpp:52
~Container() override
Definition container.cpp:31
This class describes the formatting of a widget in the cell of a layout table.
Definition layout.h:159
LayoutCell & place(gcn::Widget *wg, int x, int y, int w=1, int h=1)
Definition layout.h:203
A helper class for adding a layout to a Guichan container widget.
Layout & getLayout()
Gets the layout handler.
This class is an helper for setting the position of widgets.
Definition layout.h:281