Update list of wide characters
[centerim5.git] / cppconsui / Panel.h
blob26038092a9f07f2438495c91012e092c410c0bbe
1 // Copyright (C) 2007 Mark Pustjens <pustjens@dds.nl>
2 // Copyright (C) 2010-2015 Petr Pavlu <setup@dagobah.cz>
3 //
4 // This file is part of CenterIM.
5 //
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/>.
19 /// @file
20 /// Panel class.
21 ///
22 /// @ingroup cppconsui
24 #ifndef PANEL_H
25 #define PANEL_H
27 #include "Widget.h"
29 namespace CppConsUI {
31 /// A widget representing a rectangular border with an optional caption on the
32 /// top border line.
33 class Panel : public Widget {
34 public:
35 Panel(int w, int h, const char *text = nullptr);
36 virtual ~Panel() override;
38 // Widget
39 virtual int draw(Curses::ViewPort area, Error &error) override;
41 /// Sets a caption text.
42 virtual void setTitle(const char *new_title);
44 /// Returns a caption text.
45 virtual const char *getTitle() const { return title_; };
47 protected:
48 /// Caption text.
49 char *title_;
51 /// On-screen caption width.
52 int title_width_;
54 private:
55 CONSUI_DISABLE_COPY(Panel);
58 } // namespace CppConsUI
60 #endif // PANEL_H
62 // vim: set tabstop=2 shiftwidth=2 textwidth=80 expandtab: