add event stop_propagation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* A Bedrock Platform-Independent 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
|
||||
@@ -25,6 +25,20 @@
|
||||
|
||||
namespace nana
|
||||
{
|
||||
//class event_arg
|
||||
event_arg::~event_arg(){}
|
||||
|
||||
void event_arg::stop_propagation() const
|
||||
{
|
||||
stop_propagation_ = true;
|
||||
}
|
||||
|
||||
bool event_arg::propagation_stopped() const
|
||||
{
|
||||
return stop_propagation_;
|
||||
}
|
||||
//end class event_arg
|
||||
|
||||
namespace detail
|
||||
{
|
||||
void events_operation_register(event_handle evt)
|
||||
@@ -130,7 +144,7 @@ namespace nana
|
||||
return pi_data_->scheme.create(std::move(factory));
|
||||
}
|
||||
|
||||
void bedrock::_m_emit_core(event_code evt_code, core_window_t* wd, bool draw_only, const ::nana::detail::event_arg_interface& event_arg)
|
||||
void bedrock::_m_emit_core(event_code evt_code, core_window_t* wd, bool draw_only, const ::nana::event_arg& event_arg)
|
||||
{
|
||||
switch (evt_code)
|
||||
{
|
||||
|
||||
@@ -381,10 +381,10 @@ namespace detail
|
||||
{
|
||||
if(evt_code != arg.evt_code)
|
||||
throw std::runtime_error("Nana.bedrock: Invalid event arg.");
|
||||
return emit(evt_code, wd, static_cast<const ::nana::detail::event_arg_interface&>(arg), ask_update, thrd);
|
||||
return emit(evt_code, wd, static_cast<const ::nana::event_arg&>(arg), ask_update, thrd);
|
||||
}
|
||||
|
||||
bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::detail::event_arg_interface& arg, bool ask_update, thread_context* thrd)
|
||||
bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, bool ask_update, thread_context* thrd)
|
||||
{
|
||||
if(wd_manager.available(wd) == false)
|
||||
return false;
|
||||
@@ -411,7 +411,7 @@ namespace detail
|
||||
return true;
|
||||
}
|
||||
|
||||
bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::detail::event_arg_interface& arg, thread_context* thrd)
|
||||
bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd)
|
||||
{
|
||||
if(wd_manager.available(wd) == false)
|
||||
return false;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* A Bedrock 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
|
||||
@@ -1607,10 +1607,10 @@ namespace detail
|
||||
if (evt_code != arg.evt_code)
|
||||
throw std::runtime_error("Nana.bedrock: invalid event arg.");
|
||||
|
||||
return emit(evt_code, wd, static_cast<const ::nana::detail::event_arg_interface&>(arg), ask_update, thrd);
|
||||
return emit(evt_code, wd, static_cast<const ::nana::event_arg&>(arg), ask_update, thrd);
|
||||
}
|
||||
|
||||
bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::detail::event_arg_interface& arg, bool ask_update, thread_context* thrd)
|
||||
bool bedrock::emit(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, bool ask_update, thread_context* thrd)
|
||||
{
|
||||
if (wd_manager.available(wd) == false)
|
||||
return false;
|
||||
@@ -1637,7 +1637,7 @@ namespace detail
|
||||
return true;
|
||||
}
|
||||
|
||||
bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::detail::event_arg_interface& arg, thread_context* thrd)
|
||||
bool bedrock::emit_drawer(event_code evt_code, core_window_t* wd, const ::nana::event_arg& arg, thread_context* thrd)
|
||||
{
|
||||
if (bedrock_object.wd_manager.available(wd) == false)
|
||||
return false;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* A List Box 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
|
||||
@@ -3489,6 +3489,12 @@ namespace nana
|
||||
}
|
||||
}//end namespace drawerbase
|
||||
|
||||
arg_listbox::arg_listbox(drawerbase::listbox::item_proxy& m, bool selected)
|
||||
: item(m), selected(selected)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//class listbox
|
||||
listbox::listbox(window wd, bool visible)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
namespace nana
|
||||
{
|
||||
arg_slider::arg_slider(slider& wdg)
|
||||
: widget{ wdg }
|
||||
{}
|
||||
|
||||
namespace drawerbase
|
||||
{
|
||||
namespace slider
|
||||
|
||||
@@ -15,7 +15,13 @@
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
|
||||
namespace nana{ namespace drawerbase {
|
||||
namespace nana
|
||||
{
|
||||
arg_textbox::arg_textbox(textbox& wdg)
|
||||
: widget{wdg}
|
||||
{}
|
||||
|
||||
namespace drawerbase {
|
||||
namespace textbox
|
||||
{
|
||||
//class event_agent
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* A Toolbar Implementation
|
||||
* Copyright(C) 2003-2013 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
|
||||
@@ -16,6 +16,10 @@
|
||||
|
||||
namespace nana
|
||||
{
|
||||
arg_toolbar::arg_toolbar(toolbar& tbar, std::size_t btn)
|
||||
: widget{ tbar }, button{btn}
|
||||
{}
|
||||
|
||||
namespace drawerbase
|
||||
{
|
||||
namespace toolbar
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* A Treebox 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
|
||||
@@ -18,6 +18,10 @@
|
||||
|
||||
namespace nana
|
||||
{
|
||||
arg_treebox::arg_treebox(treebox& wdg, drawerbase::treebox::item_proxy& m, bool op)
|
||||
: widget{ wdg }, item{ m }, operated{op}
|
||||
{}
|
||||
|
||||
namespace drawerbase
|
||||
{
|
||||
//Here defines some function objects
|
||||
|
||||
Reference in New Issue
Block a user