make all internal event handlers unignorable
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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<nana::float_listbox>()(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();
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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<drawerbase::menu::menu_window, false>()(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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user