diff --git a/include/nana/gui/basis.hpp b/include/nana/gui/basis.hpp index 14114ecd..4eb95c88 100644 --- a/include/nana/gui/basis.hpp +++ b/include/nana/gui/basis.hpp @@ -1,7 +1,7 @@ /* * Basis Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at diff --git a/source/gui/basis.cpp b/source/gui/basis.cpp index 337d9291..28893fb4 100644 --- a/source/gui/basis.cpp +++ b/source/gui/basis.cpp @@ -1,6 +1,7 @@ /* * Basis Implementation - * Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) + * Nana C++ Library(http://www.nanapro.org) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at diff --git a/source/gui/drawing.cpp b/source/gui/drawing.cpp index 10fabaa7..1a13d18a 100644 --- a/source/gui/drawing.cpp +++ b/source/gui/drawing.cpp @@ -1,7 +1,7 @@ /* * A Drawing Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at diff --git a/source/gui/filebox.cpp b/source/gui/filebox.cpp index 46ca0a59..f8937e38 100644 --- a/source/gui/filebox.cpp +++ b/source/gui/filebox.cpp @@ -123,7 +123,7 @@ namespace nana { path_.create(*this); path_.splitstr(STR("/")); - path_.events().selected([this](const arg_categorize&) + path_.events().selected.connect_unignorable([this](const arg_categorize&) { auto path = path_.caption(); auto root = path.substr(0, path.find(STR('/'))); @@ -142,7 +142,7 @@ namespace nana filter_.multi_lines(false); filter_.tip_string(STR("Filter")); - filter_.events().key_release([this](const arg_keyboard&) + filter_.events().key_release.connect_unignorable([this](const arg_keyboard&) { _m_list_fs(); }); @@ -150,7 +150,7 @@ namespace nana btn_folder_.create(*this); btn_folder_.caption(STR("&New Folder")); - btn_folder_.events().click([this](const arg_mouse&) + btn_folder_.events().click.connect_unignorable([this](const arg_mouse&) { form fm(this->handle(), API::make_center(*this, 300, 35)); fm.caption(STR("Name the new folder")); @@ -161,12 +161,12 @@ namespace nana button btn(fm, nana::rectangle(170, 5, 60, 25)); btn.caption(STR("Create")); - btn.events().click(folder_creator(*this, fm, folder)); + btn.events().click.connect_unignorable(folder_creator(*this, fm, folder)); button btn_cancel(fm, nana::rectangle(235, 5, 60, 25)); btn_cancel.caption(STR("Cancel")); - btn_cancel.events().click([&fm](const arg_mouse&) + btn_cancel.events().click.connect_unignorable([&fm](const arg_mouse&) { fm.close(); }); @@ -184,8 +184,8 @@ namespace nana auto fn_sel_file = [this](const arg_mouse& arg){ _m_sel_file(arg); }; - ls_file_.events().dbl_click(fn_sel_file); - ls_file_.events().mouse_down(fn_sel_file); + ls_file_.events().dbl_click.connect_unignorable(fn_sel_file); + ls_file_.events().mouse_down.connect_unignorable(fn_sel_file); ls_file_.set_sort_compare(0, [](const nana::string& a, nana::any* fs_a, const nana::string& b, nana::any* fs_b, bool reverse) -> bool { int dira = fs_a->get()->directory ? 1 : 0; @@ -262,7 +262,7 @@ namespace nana tb_file_.create(*this); tb_file_.multi_lines(false); - tb_file_.events().key_char([this](const arg_keyboard& arg) + tb_file_.events().key_char.connect_unignorable([this](const arg_keyboard& arg) { if(arg.key == nana::keyboard::enter) _m_ok(); @@ -270,19 +270,19 @@ namespace nana cb_types_.create(*this); cb_types_.editable(false); - cb_types_.events().selected([this](const arg_combox&){ _m_list_fs(); }); + cb_types_.events().selected.connect_unignorable([this](const arg_combox&){ _m_list_fs(); }); btn_ok_.create(*this); btn_ok_.caption(STR("&OK")); - btn_ok_.events().click([this](const arg_mouse&) + btn_ok_.events().click.connect_unignorable([this](const arg_mouse&) { _m_ok(); }); btn_cancel_.create(*this); btn_cancel_.caption(STR("&Cancel")); - btn_cancel_.events().click([this](const arg_mouse&) + btn_cancel_.events().click.connect_unignorable([this](const arg_mouse&) { API::close_window(handle()); }); @@ -440,12 +440,12 @@ namespace nana } } - tree_.events().expanded([this](const arg_treebox& arg) + tree_.events().expanded.connect_unignorable([this](const arg_treebox& arg) { _m_tr_expand(arg.item, arg.operated); }); - tree_.events().selected([this](const arg_treebox& arg) + tree_.events().selected.connect_unignorable([this](const arg_treebox& arg) { if(arg.operated && (arg.item.value() == kind::filesystem)) { diff --git a/source/gui/msgbox.cpp b/source/gui/msgbox.cpp index c167f062..de3aff59 100644 --- a/source/gui/msgbox.cpp +++ b/source/gui/msgbox.cpp @@ -53,7 +53,7 @@ namespace nana place_.bind(*this); yes_.create(*this); - yes_.events().click([this](const arg_mouse& arg) + yes_.events().click.connect_unignorable([this](const arg_mouse& arg) { _m_click(arg); }); @@ -65,7 +65,7 @@ namespace nana yes_.caption(STR("Yes")); no_.create(*this); no_.caption(STR("No")); - no_.events().click([this](const arg_mouse& arg) + no_.events().click.connect_unignorable([this](const arg_mouse& arg) { _m_click(arg); }); @@ -76,7 +76,7 @@ namespace nana { cancel_.create(*this); cancel_.caption(STR("Cancel")); - cancel_.events().click([this](const arg_mouse& arg) + cancel_.events().click.connect_unignorable([this](const arg_mouse& arg) { _m_click(arg); }); @@ -482,14 +482,14 @@ namespace nana btn_ok_.create(*this); btn_ok_.i18n(i18n_eval("OK")); - btn_ok_.events().click([this]{ + btn_ok_.events().click.connect_unignorable([this]{ close(); valid_input_ = true; }); btn_cancel_.create(*this); btn_cancel_.i18n(i18n_eval("Cancel")); - btn_cancel_.events().click([this]{ + btn_cancel_.events().click.connect_unignorable([this]{ close(); }); @@ -611,13 +611,13 @@ namespace nana ss << impl->value; impl->spinbox.value(ss.str()); - impl->dock.events().resized([impl, label_px, value_px](const ::nana::arg_resized& arg) + impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized& arg) { impl->label.size({ label_px, arg.height }); impl->spinbox.size({ value_px, arg.height }); }); - impl->spinbox.events().destroy([impl] + impl->spinbox.events().destroy.connect_unignorable([impl] { impl->value = impl->spinbox.to_int(); }); @@ -698,13 +698,13 @@ namespace nana ss << impl->value; impl->spinbox.value(ss.str()); - impl->dock.events().resized([impl, label_px, value_px](const ::nana::arg_resized& arg) + impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized& arg) { impl->label.size({ label_px, arg.height }); impl->spinbox.size({ value_px, arg.height }); }); - impl->spinbox.events().destroy([impl] + impl->spinbox.events().destroy.connect_unignorable([impl] { impl->value = impl->spinbox.to_int(); }); @@ -792,7 +792,7 @@ namespace nana impl->combox.push_back(s); } - impl->dock.events().resized([impl, label_px, value_px](const ::nana::arg_resized& arg) + impl->dock.events().resized.connect_unignorable([impl, label_px, value_px](const ::nana::arg_resized& arg) { impl->label.size({ label_px, arg.height }); if (value_px) @@ -802,7 +802,7 @@ namespace nana }); auto & wdg = (value_px ? static_cast(impl->combox) : static_cast(impl->textbox)); - wdg.events().destroy([&wdg, impl] + wdg.events().destroy.connect_unignorable([&wdg, impl] { impl->value = wdg.caption(); }); @@ -906,7 +906,7 @@ namespace nana ss << date.year; impl->wdg_year.value(ss.str()); - impl->dock.events().resized([impl, label_px](const ::nana::arg_resized& arg) + impl->dock.events().resized.connect_unignorable([impl, label_px](const ::nana::arg_resized& arg) { impl->label.size({ label_px, arg.height }); auto sz = impl->wdg_month.size(); @@ -922,13 +922,13 @@ namespace nana impl->wdg_year.size(sz); }); - impl->wdg_day.events().destroy([impl] + impl->wdg_day.events().destroy.connect_unignorable([impl] { impl->day = impl->wdg_day.to_int(); impl->month = impl->wdg_month.option() + 1; }); - impl->wdg_year.events().destroy([impl] + impl->wdg_year.events().destroy.connect_unignorable([impl] { impl->year = impl->wdg_year.to_int(); }); @@ -956,8 +956,8 @@ namespace nana impl->wdg_day.value(ss.str()); }; - impl->wdg_year.events().text_changed(make_days); - impl->wdg_month.events().selected(make_days); + impl->wdg_year.events().text_changed.connect_unignorable(make_days); + impl->wdg_month.events().selected.connect_unignorable(make_days); return impl->dock; } diff --git a/source/gui/place.cpp b/source/gui/place.cpp index 42f3befd..005fd3cf 100644 --- a/source/gui/place.cpp +++ b/source/gui/place.cpp @@ -1556,7 +1556,7 @@ namespace nana splitter_.cursor(splitter_cursor_); dragger_.trigger(splitter_); - splitter_.events().mouse_down.connect([this](const arg_mouse& arg) + splitter_.events().mouse_down.connect_unignorable([this](const arg_mouse& arg) { if (false == arg.left_button) return; @@ -1584,7 +1584,7 @@ namespace nana right_pixels_ = area_right.*px_ptr; }); - splitter_.events().mouse_move.connect([this](const arg_mouse& arg) + splitter_.events().mouse_move.connect_unignorable([this](const arg_mouse& arg) { if (false == arg.left_button) return; diff --git a/source/gui/widgets/button.cpp b/source/gui/widgets/button.cpp index ef247fb6..63d8e810 100644 --- a/source/gui/widgets/button.cpp +++ b/source/gui/widgets/button.cpp @@ -1,7 +1,7 @@ /* * A Button Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -479,7 +479,7 @@ namespace nana{ namespace drawerbase void button::_m_complete_creation() { - events().shortkey.connect([this] + events().shortkey.connect_unignorable([this] { _m_shortkey(); }); diff --git a/source/gui/widgets/categorize.cpp b/source/gui/widgets/categorize.cpp index d07a356b..e891afea 100644 --- a/source/gui/widgets/categorize.cpp +++ b/source/gui/widgets/categorize.cpp @@ -1,7 +1,7 @@ /* * A Categorize Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -593,7 +593,7 @@ namespace nana r.width = r.height = 100; style_.listbox = &(form_loader()(window_, r, true)); style_.listbox->set_module(style_.module, 16); - style_.listbox->events().destroy.connect([this] + style_.listbox->events().destroy.connect_unignorable([this] { _m_list_closed(); }); diff --git a/source/gui/widgets/checkbox.cpp b/source/gui/widgets/checkbox.cpp index 0cc84e32..1a73f706 100644 --- a/source/gui/widgets/checkbox.cpp +++ b/source/gui/widgets/checkbox.cpp @@ -1,6 +1,7 @@ /* * A CheckBox Implementation - * Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) + * Nana C++ Library(http://www.nanapro.org) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -207,8 +208,8 @@ namespace checkbox element_tag el; el.uiobj = &uiobj; - el.eh_checked = uiobj.events().click.connect_front(std::bind(&radio_group::_m_checked, this, std::placeholders::_1)); - el.eh_destroy = uiobj.events().destroy.connect(std::bind(&radio_group::_m_destroy, this, std::placeholders::_1)); + el.eh_checked = uiobj.events().click.connect_unignorable(std::bind(&radio_group::_m_checked, this, std::placeholders::_1), true); + el.eh_destroy = uiobj.events().destroy.connect_unignorable(std::bind(&radio_group::_m_destroy, this, std::placeholders::_1)); ui_container_.push_back(el); } diff --git a/source/gui/widgets/combox.cpp b/source/gui/widgets/combox.cpp index 7dbc5f6d..c3c92cd9 100644 --- a/source/gui/widgets/combox.cpp +++ b/source/gui/widgets/combox.cpp @@ -240,7 +240,7 @@ namespace nana //The lister window closes by itself. I just take care about the destroy event. //The event should be destroy rather than unload. Because the unload event is invoked while //the lister is not closed, if popuping a message box, the lister will cover the message box. - state_.lister->events().destroy.connect([this] + state_.lister->events().destroy.connect_unignorable([this] { _m_lister_close_sig(); }); diff --git a/source/gui/widgets/float_listbox.cpp b/source/gui/widgets/float_listbox.cpp index d21a4692..3f569aee 100644 --- a/source/gui/widgets/float_listbox.cpp +++ b/source/gui/widgets/float_listbox.cpp @@ -1,7 +1,7 @@ /* * A float_listbox Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -242,7 +242,7 @@ namespace nana if(wd) { widget_ = wd; - wd->events().mouse_wheel.connect([this](const arg_wheel& arg){ + wd->events().mouse_wheel.connect_unignorable([this](const arg_wheel& arg){ scroll_items(arg.upwards); }); } diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 5503911a..7a85c33d 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -2020,10 +2020,10 @@ namespace nana { scroll.h.create(wd, r); API::take_active(scroll.h.handle(), false, wd); - scroll.h.events().mouse_move.connect([this](const nana::arg_mouse& arg){ + scroll.h.events().mouse_move.connect_unignorable([this](const nana::arg_mouse& arg){ _m_answer_scroll(arg); }); - scroll.h.events().mouse_up.connect([this](const nana::arg_mouse& arg){ + scroll.h.events().mouse_up.connect_unignorable([this](const nana::arg_mouse& arg){ _m_answer_scroll(arg); }); } @@ -2040,12 +2040,12 @@ namespace nana { scroll.v.create(wd, r); API::take_active(scroll.v.handle(), false, wd); - scroll.v.events().mouse_move.connect([this](const ::nana::arg_mouse& arg) + scroll.v.events().mouse_move.connect_unignorable([this](const ::nana::arg_mouse& arg) { _m_answer_scroll(arg); }); - scroll.v.events().mouse_up.connect([this](const ::nana::arg_mouse& arg) + scroll.v.events().mouse_up.connect_unignorable([this](const ::nana::arg_mouse& arg) { _m_answer_scroll(arg); }); diff --git a/source/gui/widgets/menu.cpp b/source/gui/widgets/menu.cpp index 4279264c..129cb7bc 100644 --- a/source/gui/widgets/menu.cpp +++ b/source/gui/widgets/menu.cpp @@ -741,21 +741,21 @@ namespace nana API::register_menu_window(this->handle(), !owner_menubar); } - events().destroy.connect([this]{ + events().destroy.connect_unignorable([this]{ _m_destroy(); }); - events().key_press.connect([this](const arg_keyboard& arg){ + events().key_press.connect_unignorable([this](const arg_keyboard& arg){ _m_key_down(arg); }); - events().mouse_up.connect([this]{ + events().mouse_up.connect_unignorable([this]{ pick(); }); if (want_focus_) { - event_focus_ = events().focus.connect([this](const arg_focus& arg) + event_focus_ = events().focus.connect_unignorable([this](const arg_focus& arg) { _m_focus_changed(arg); }); @@ -993,7 +993,7 @@ namespace nana void _m_make_mouse_event() { state_.mouse_pos = API::cursor_position(); - events().mouse_move.connect([this]{ + events().mouse_move.connect_unignorable([this]{ _m_mouse_event(); }); } @@ -1324,7 +1324,7 @@ namespace nana { close(); impl_->uiobj = &(form_loader()(wd, point(x, y), &(*impl_->mbuilder.renderer()))); - impl_->uiobj->events().destroy.connect([this]{ + impl_->uiobj->events().destroy.connect_unignorable([this]{ _m_destroy_menu_window(); }); impl_->uiobj->popup(impl_->mbuilder.data(), called_by_menubar); diff --git a/source/gui/widgets/toolbar.cpp b/source/gui/widgets/toolbar.cpp index a51c14cd..86baf33e 100644 --- a/source/gui/widgets/toolbar.cpp +++ b/source/gui/widgets/toolbar.cpp @@ -1,5 +1,6 @@ /* * A Toolbar Implementation + * Nana C++ Library(http://www.nanapro.org) * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. @@ -277,7 +278,7 @@ namespace nana widget_ = static_cast< ::nana::toolbar*>(&widget); widget.caption(STR("Nana Toolbar")); - impl_->event_size = widget.events().resized.connect(std::bind(&drawer::_m_owner_sized, this, std::placeholders::_1)); + impl_->event_size = widget.events().resized.connect_unignorable(std::bind(&drawer::_m_owner_sized, this, std::placeholders::_1)); }