1 // Copyright (C) 2007 Mark Pustjens <pustjens@dds.nl>
2 // Copyright (C) 2010-2015 Petr Pavlu <setup@dagobah.cz>
4 // This file is part of CenterIM.
6 // CenterIM is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // CenterIM is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with CenterIM. If not, see <http://www.gnu.org/licenses/>.
20 /// HorizontalListBox class.
22 /// @ingroup cppconsui
24 #ifndef HORIZONTALLISTBOX_H
25 #define HORIZONTALLISTBOX_H
27 #include "AbstractListBox.h"
28 #include "VerticalLine.h"
32 /// Implementation of AbstractListBox class where widgets are placed
34 class HorizontalListBox
: public AbstractListBox
{
36 HorizontalListBox(int w
, int h
);
37 virtual ~HorizontalListBox() override
{}
40 virtual VerticalLine
*insertSeparator(std::size_t pos
) override
;
41 virtual VerticalLine
*appendSeparator() override
;
42 virtual void insertWidget(std::size_t pos
, Widget
&widget
) override
;
43 virtual void appendWidget(Widget
&widget
) override
;
45 virtual int getChildrenWidth() const { return children_width_
; };
47 sigc::signal
<void, HorizontalListBox
&, int> signal_children_width_change
;
50 /// Total width of all visible children.
53 /// Number of visible children that has their height set to AUTOSIZE.
54 int autosize_children_count_
;
57 virtual void updateArea() override
;
60 virtual void onChildMoveResize(
61 Widget
&activator
, const Rect
&oldsize
, const Rect
&newsize
) override
;
62 virtual void onChildWishSizeChange(
63 Widget
&activator
, const Size
&oldsize
, const Size
&newsize
) override
;
64 virtual void onChildVisible(Widget
&widget
, bool visible
) override
;
65 virtual void moveWidget(
66 Widget
&widget
, Widget
&position
, bool after
) override
;
68 virtual void updateChildren(
69 int children_width_change
, int autosize_children_count_change
);
72 CONSUI_DISABLE_COPY(HorizontalListBox
);
75 } // namespace CppConsUI
77 #endif // HORIZONTALLISTBOX_H
79 // vim: set tabstop=2 shiftwidth=2 textwidth=80 expandtab: