Update list of wide characters
[centerim5.git] / cppconsui / TextEntry.cpp
blob1eec83159a188dbdef0f66e6965c3e4b12f60f39
1 // Copyright (C) 2010-2015 Petr Pavlu <setup@dagobah.cz>
2 //
3 // This file is part of CenterIM.
4 //
5 // CenterIM is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // CenterIM is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with CenterIM. If not, see <http://www.gnu.org/licenses/>.
18 /// @file
19 /// TextEntry class implementation
20 ///
21 /// @ingroup cppconsui
23 #include "TextEntry.h"
25 #include "Container.h"
27 namespace CppConsUI {
29 TextEntry::TextEntry(int w, int h, const char *text_, int flags_)
30 : TextEdit(w, h, text_, flags_, true, false)
32 declareBindables();
35 TextEntry::TextEntry(const char *text_, int flags_)
36 : TextEdit(AUTOSIZE, 1, text_, flags_, true, false)
38 declareBindables();
41 void TextEntry::actionActivate()
43 if (parent_ != nullptr)
44 parent_->moveFocus(Container::FOCUS_NEXT);
47 void TextEntry::declareBindables()
49 // Non text editing bindables.
50 declareBindable("textentry", "activate",
51 sigc::mem_fun(this, &TextEntry::actionActivate),
52 InputProcessor::BINDABLE_NORMAL);
55 } // namespace CppConsUI
57 // vim: set tabstop=2 shiftwidth=2 textwidth=80 expandtab: