Fix missing includes
[centerim5.git] / cppconsui / ColorPickerDialog.cpp
blob6f3c4d0df299cf9c8096203d478fb95430c58bb5
1 /*
2 * Copyright (C) 2012 by CenterIM developers
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 this program. If not, see <http://www.gnu.org/licenses/>.
19 * */
21 /**
22 * @file
23 * ColorPickerDialog class implementation.
25 * @ingroup cppconsui
28 #include "ColorPickerDialog.h"
30 #include "gettext.h"
32 namespace CppConsUI
35 ColorPickerDialog::ColorPickerDialog(const char *title, int /*defaultvalue*/,
36 int flags)
37 : AbstractDialog(title)
39 AddButton(OK_BUTTON_TEXT, RESPONSE_OK);
41 pick = new ColorPickerPalette(0, flags);
42 pick->signal_color_selected.connect(sigc::mem_fun(this,
43 &ColorPickerDialog::OnColorSelected));
44 layout->InsertWidget(0, *pick);
46 Resize(pick->GetWidth() + 2, pick->GetHeight() + 4);
49 void ColorPickerDialog::OnColorSelected(ColorPickerPalette& /*activator*/,
50 int color_)
52 color = color_;
53 Response(RESPONSE_OK);
56 void ColorPickerDialog::EmitResponse(ResponseType response)
58 signal_response(*this, response, color);
61 } // namespace CppConsUI
63 /* vim: set tabstop=2 shiftwidth=2 textwidth=78 expandtab : */