diff --git a/include/nana/basic_types.hpp b/include/nana/basic_types.hpp index d8253b85..c0765ae5 100644 --- a/include/nana/basic_types.hpp +++ b/include/nana/basic_types.hpp @@ -315,6 +315,7 @@ namespace nana ///< Blends two colors with the specified alpha, and the alpha values that come with these two colors are both ignored. color blend(const color& bgcolor, double alpha) const; + ///< Determines whether the color is completely transparent. bool invisible() const; pixel_color_t px_color() const; pixel_argb_t argb() const; diff --git a/include/nana/gui/detail/bedrock.hpp b/include/nana/gui/detail/bedrock.hpp index 2f62fee1..d5676899 100644 --- a/include/nana/gui/detail/bedrock.hpp +++ b/include/nana/gui/detail/bedrock.hpp @@ -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 @@ -81,16 +81,16 @@ namespace detail widget_colors& get_scheme_template(scheme_factory_base&&); std::unique_ptr make_scheme(scheme_factory_base&&); public: - window_manager_t wd_manager; events_operation evt_operation; + window_manager_t wd_manager; runtime_manager rt_manager; bool emit(event_code, core_window_t*, const arg_mouse&, bool ask_update, thread_context*); - bool emit(event_code, core_window_t*, const event_arg_interface&, bool ask_update, thread_context*); - bool emit_drawer(event_code, core_window_t*, const event_arg_interface&, thread_context*); + bool emit(event_code, core_window_t*, const event_arg&, bool ask_update, thread_context*); + bool emit_drawer(event_code, core_window_t*, const event_arg&, thread_context*); private: - void _m_emit_core(event_code, core_window_t*, bool draw_only, const event_arg_interface&); + void _m_emit_core(event_code, core_window_t*, bool draw_only, const event_arg&); void _m_event_filter(event_code, core_window_t*, thread_context*); void _m_except_handler(); private: diff --git a/include/nana/gui/detail/general_events.hpp b/include/nana/gui/detail/general_events.hpp index e95ebfc7..20dae998 100644 --- a/include/nana/gui/detail/general_events.hpp +++ b/include/nana/gui/detail/general_events.hpp @@ -1,7 +1,7 @@ /* * Definition of General Events * 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 @@ -39,16 +39,21 @@ namespace nana virtual event_interface* get_event() const = 0; }; - class event_arg_interface - { - public: - virtual ~event_arg_interface() = default; - }; - void events_operation_register(event_handle); void events_operation_cancel(event_handle); }//end namespace detail + class event_arg + { + public: + virtual ~event_arg(); + + void stop_propagation() const; + bool propagation_stopped() const; + private: + mutable bool stop_propagation_{ false }; + }; + struct general_events; template @@ -62,15 +67,16 @@ namespace nana { basic_event * const event_ptr; std::function invoke; - bool flag_entered = false; - bool flag_deleted = false; + bool flag_entered{ false }; + bool flag_deleted{ false }; + bool unignorable{false}; - docker(basic_event * s, std::function && ivk) - : event_ptr(s), invoke(std::move(ivk)) + docker(basic_event * s, std::function && ivk, bool unignorable_flag) + : event_ptr(s), invoke(std::move(ivk)), unignorable(unignorable_flag) {} - docker(basic_event * s, const std::function & ivk) - : event_ptr(s), invoke(ivk) + docker(basic_event * s, const std::function & ivk, bool unignorable_flag) + : event_ptr(s), invoke(ivk), unignorable(unignorable_flag) {} ~docker() @@ -91,8 +97,8 @@ namespace nana if (nullptr == dockers_) dockers_.reset(new std::vector>); - typedef typename std::remove_reference::type prototype; - std::unique_ptr dck(new docker(this, factory::value>::build(std::forward(fn)))); + using prototype = typename std::remove_reference::type; + std::unique_ptr dck(new docker(this, factory::value>::build(std::forward(fn)), false)); auto evt = reinterpret_cast(static_cast(dck.get())); dockers_->emplace(dockers_->begin(), std::move(dck)); detail::events_operation_register(evt); @@ -113,8 +119,8 @@ namespace nana if (nullptr == dockers_) dockers_.reset(new std::vector>); - typedef typename std::remove_reference::type prototype; - std::unique_ptr dck(new docker(this, factory::value>::build(std::forward(fn)))); + using prototype = typename std::remove_reference::type; + std::unique_ptr dck(new docker(this, factory::value>::build(std::forward(fn)), false)); auto evt = reinterpret_cast(static_cast(dck.get())); dockers_->emplace_back(std::move(dck)); detail::events_operation_register(evt); @@ -127,6 +133,24 @@ namespace nana return connect(std::forward(fn)); } + template + event_handle connect_unignorable(Function && fn, bool in_front = false) + { + internal_scope_guard lock; + if (nullptr == dockers_) + dockers_.reset(new std::vector>); + + using prototype = typename std::remove_reference::type; + std::unique_ptr dck(new docker(this, factory::value>::build(std::forward(fn)), true)); + auto evt = reinterpret_cast(static_cast(dck.get())); + if (in_front) + dockers_->emplace(dockers_->begin(), std::move(dck)); + else + dockers_->emplace_back(std::move(dck)); + detail::events_operation_register(evt); + return evt; + } + std::size_t length() const { internal_scope_guard lock; @@ -158,20 +182,30 @@ namespace nana (*output++) = dck.get(); } + bool stop_propagation = false; for (; transitory != output; ++transitory) { - std::unique_ptr p(*transitory); - auto i = std::find(dockers.begin(), dockers.end(), p); + auto docker_ptr = *transitory; + if (stop_propagation && !docker_ptr->unignorable) + continue; + + auto i = std::find_if(dockers.begin(), dockers.end(), [docker_ptr](std::unique_ptr& p){ + return (docker_ptr == p.get()); + }); + if (i != dockers.end()) { - (*transitory)->flag_entered = true; - (*transitory)->invoke(arg); - (*transitory)->flag_entered = false; + docker_ptr->flag_entered = true; + docker_ptr->invoke(arg); - if ((*transitory)->flag_deleted) + if (arg.propagation_stopped()) + stop_propagation = true; + + docker_ptr->flag_entered = false; + + if (docker_ptr->flag_deleted) dockers.erase(i); } - p.release(); } } @@ -182,7 +216,7 @@ namespace nana dockers_.reset(); } - void remove(event_handle evt) + void remove(event_handle evt) override { internal_scope_guard lock; if (dockers_) @@ -362,7 +396,7 @@ namespace nana }; struct arg_mouse - : public detail::event_arg_interface + : public event_arg { event_code evt_code; ::nana::window window_handle; @@ -386,27 +420,27 @@ namespace nana unsigned distance; //expressed in multiples or divisions of 120 }; - struct arg_dropfiles : public detail::event_arg_interface + struct arg_dropfiles : public event_arg { ::nana::window window_handle; ::nana::point pos; std::vector files; }; - struct arg_expose : public detail::event_arg_interface + struct arg_expose : public event_arg { ::nana::window window_handle; bool exposed; }; - struct arg_focus : public detail::event_arg_interface + struct arg_focus : public event_arg { ::nana::window window_handle; ::nana::native_window_type receiver; bool getting; }; - struct arg_keyboard : public detail::event_arg_interface + struct arg_keyboard : public event_arg { event_code evt_code; ::nana::window window_handle; @@ -416,21 +450,21 @@ namespace nana bool shift; }; - struct arg_move : public detail::event_arg_interface + struct arg_move : public event_arg { ::nana::window window_handle; int x; int y; }; - struct arg_resized : public detail::event_arg_interface + struct arg_resized : public event_arg { ::nana::window window_handle; unsigned width; unsigned height; }; - struct arg_resizing : public detail::event_arg_interface + struct arg_resizing : public event_arg { ::nana::window window_handle; window_border border; @@ -438,13 +472,13 @@ namespace nana mutable unsigned height; }; - struct arg_unload : public detail::event_arg_interface + struct arg_unload : public event_arg { ::nana::window window_handle; mutable bool cancel; }; - struct arg_destroy : public detail::event_arg_interface + struct arg_destroy : public event_arg { ::nana::window window_handle; }; diff --git a/include/nana/gui/notifier.hpp b/include/nana/gui/notifier.hpp index f7a7531d..c6eea9da 100644 --- a/include/nana/gui/notifier.hpp +++ b/include/nana/gui/notifier.hpp @@ -1,7 +1,7 @@ /* * Definition of Notifier * 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 @@ -20,6 +20,7 @@ namespace nana class notifier; struct arg_notifier + : public event_arg { event_code evt_code; notifier* notifier_ptr; diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp index 44bf2287..805c932e 100644 --- a/include/nana/gui/programming_interface.hpp +++ b/include/nana/gui/programming_interface.hpp @@ -1,7 +1,7 @@ /* * Nana GUI Programming Interface 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 @@ -164,7 +164,7 @@ namespace API return *widget_evt; } - template::value>::type* = nullptr> + template::value>::type* = nullptr> bool emit_event(event_code evt_code, window wd, const EventArg& arg) { auto & brock = ::nana::detail::bedrock::instance(); diff --git a/include/nana/gui/timer.hpp b/include/nana/gui/timer.hpp index 458e929e..893a4e5d 100644 --- a/include/nana/gui/timer.hpp +++ b/include/nana/gui/timer.hpp @@ -1,6 +1,6 @@ /* * A Timer 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 @@ -22,6 +22,7 @@ namespace nana /// Can repeatedly call a piece of code. struct arg_elapse + : public event_arg { long long id; //timer identifier; }; diff --git a/include/nana/gui/widgets/categorize.hpp b/include/nana/gui/widgets/categorize.hpp index c5b6b705..72df23d6 100644 --- a/include/nana/gui/widgets/categorize.hpp +++ b/include/nana/gui/widgets/categorize.hpp @@ -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 @@ -23,6 +23,7 @@ namespace nana template struct arg_categorize + : public event_arg { categorize & widget; ValueType & value; diff --git a/include/nana/gui/widgets/combox.hpp b/include/nana/gui/widgets/combox.hpp index 640a8060..c3cbc921 100644 --- a/include/nana/gui/widgets/combox.hpp +++ b/include/nana/gui/widgets/combox.hpp @@ -25,6 +25,7 @@ namespace nana class combox; struct arg_combox + : public event_arg { combox & widget; diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index adb435ec..638eb5fb 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -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 @@ -416,9 +416,12 @@ namespace nana }//end namespace drawerbase struct arg_listbox + : public event_arg { mutable drawerbase::listbox::item_proxy item; bool selected; + + arg_listbox(drawerbase::listbox::item_proxy&, bool selected); }; namespace drawerbase diff --git a/include/nana/gui/widgets/panel.hpp b/include/nana/gui/widgets/panel.hpp index 6dc1363e..e1d98d00 100644 --- a/include/nana/gui/widgets/panel.hpp +++ b/include/nana/gui/widgets/panel.hpp @@ -1,7 +1,7 @@ /* * A Panel Implementation * Nana C++ Library(http://www.nanaro.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/include/nana/gui/widgets/picture.hpp b/include/nana/gui/widgets/picture.hpp index 6ae273ea..5c9b5f97 100644 --- a/include/nana/gui/widgets/picture.hpp +++ b/include/nana/gui/widgets/picture.hpp @@ -1,7 +1,7 @@ /* * A Picture 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/include/nana/gui/widgets/progress.hpp b/include/nana/gui/widgets/progress.hpp index 9e849f75..14172397 100644 --- a/include/nana/gui/widgets/progress.hpp +++ b/include/nana/gui/widgets/progress.hpp @@ -1,7 +1,7 @@ /* * A Progress Indicator 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/include/nana/gui/widgets/scroll.hpp b/include/nana/gui/widgets/scroll.hpp index 0cd2775f..25a952f9 100644 --- a/include/nana/gui/widgets/scroll.hpp +++ b/include/nana/gui/widgets/scroll.hpp @@ -1,7 +1,7 @@ /* * A Scroll 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 @@ -22,8 +22,13 @@ namespace nana template struct arg_scroll + : public event_arg { scroll & widget; + + arg_scroll(scroll & wdg) + : widget{ wdg } + {} }; namespace drawerbase diff --git a/include/nana/gui/widgets/slider.hpp b/include/nana/gui/widgets/slider.hpp index 01769e02..ca1ab75a 100644 --- a/include/nana/gui/widgets/slider.hpp +++ b/include/nana/gui/widgets/slider.hpp @@ -1,7 +1,7 @@ /* * A Slider 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 @@ -19,8 +19,11 @@ namespace nana class slider; struct arg_slider + : public event_arg { slider & widget; + + arg_slider(slider&); }; namespace drawerbase diff --git a/include/nana/gui/widgets/spinbox.hpp b/include/nana/gui/widgets/spinbox.hpp index 6c273bdb..f0deb3f6 100644 --- a/include/nana/gui/widgets/spinbox.hpp +++ b/include/nana/gui/widgets/spinbox.hpp @@ -20,6 +20,7 @@ namespace nana class spinbox; struct arg_spinbox + : public event_arg { spinbox & widget; @@ -123,7 +124,17 @@ namespace nana private: ::nana::string _m_caption() const; void _m_caption(::nana::string&&); - }; + }; //end class spinbox + + namespace dev + { + template<> + struct widget_traits + { + using event_type = drawerbase::spinbox::spinbox_events; + using scheme_type = ::nana::widgets::skeletons::text_editor_scheme; + }; + } }//end namespace nana #endif //NANA_GUI_WIDGET_SPINBOX_HPP \ No newline at end of file diff --git a/include/nana/gui/widgets/tabbar.hpp b/include/nana/gui/widgets/tabbar.hpp index a6498875..4d641461 100644 --- a/include/nana/gui/widgets/tabbar.hpp +++ b/include/nana/gui/widgets/tabbar.hpp @@ -1,7 +1,7 @@ /* * A Tabbar 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 @@ -24,9 +24,14 @@ namespace nana template struct arg_tabbar + : public event_arg { tabbar & widget; T & value; + + arg_tabbar(tabbar& wdg, T& v) + : widget{ wdg }, value{ v } + {} }; template diff --git a/include/nana/gui/widgets/textbox.hpp b/include/nana/gui/widgets/textbox.hpp index 266a1ffd..045a05fc 100644 --- a/include/nana/gui/widgets/textbox.hpp +++ b/include/nana/gui/widgets/textbox.hpp @@ -20,8 +20,11 @@ namespace nana class textbox; struct arg_textbox + : public event_arg { textbox& widget; + + arg_textbox(textbox&); }; namespace widgets diff --git a/include/nana/gui/widgets/toolbar.hpp b/include/nana/gui/widgets/toolbar.hpp index b39b50f1..35f539ac 100644 --- a/include/nana/gui/widgets/toolbar.hpp +++ b/include/nana/gui/widgets/toolbar.hpp @@ -1,7 +1,7 @@ /* * A Toolbar 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 @@ -21,9 +21,12 @@ namespace nana class toolbar; struct arg_toolbar + : public event_arg { toolbar& widget; std::size_t button; + + arg_toolbar(toolbar&, std::size_t); }; namespace drawerbase diff --git a/include/nana/gui/widgets/treebox.hpp b/include/nana/gui/widgets/treebox.hpp index 9e0a72b6..ee5408e5 100644 --- a/include/nana/gui/widgets/treebox.hpp +++ b/include/nana/gui/widgets/treebox.hpp @@ -1,7 +1,7 @@ /* * A Tree 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 @@ -333,10 +333,13 @@ namespace nana }//end namespace drawerbase struct arg_treebox + : public event_arg { treebox& widget; drawerbase::treebox::item_proxy & item; bool operated; + + arg_treebox(treebox&, drawerbase::treebox::item_proxy&, bool operated); }; namespace drawerbase diff --git a/include/nana/gui/widgets/widget.hpp b/include/nana/gui/widgets/widget.hpp index 54dd39b9..70aacb25 100644 --- a/include/nana/gui/widgets/widget.hpp +++ b/include/nana/gui/widgets/widget.hpp @@ -1,7 +1,7 @@ /* * The fundamental widget class 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/detail/bedrock_pi.cpp b/source/gui/detail/bedrock_pi.cpp index d3722ce2..be824a0b 100644 --- a/source/gui/detail/bedrock_pi.cpp +++ b/source/gui/detail/bedrock_pi.cpp @@ -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) { diff --git a/source/gui/detail/linux_X11/bedrock.cpp b/source/gui/detail/linux_X11/bedrock.cpp index 8b55a9b7..96008bbc 100644 --- a/source/gui/detail/linux_X11/bedrock.cpp +++ b/source/gui/detail/linux_X11/bedrock.cpp @@ -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(arg), ask_update, thrd); + return emit(evt_code, wd, static_cast(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; diff --git a/source/gui/detail/win32/bedrock.cpp b/source/gui/detail/win32/bedrock.cpp index fd1eb903..6f53e16d 100644 --- a/source/gui/detail/win32/bedrock.cpp +++ b/source/gui/detail/win32/bedrock.cpp @@ -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(arg), ask_update, thrd); + return emit(evt_code, wd, static_cast(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; diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 853d1f50..406f7ca7 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -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) { diff --git a/source/gui/widgets/slider.cpp b/source/gui/widgets/slider.cpp index ffab733a..a7700752 100644 --- a/source/gui/widgets/slider.cpp +++ b/source/gui/widgets/slider.cpp @@ -3,6 +3,10 @@ namespace nana { + arg_slider::arg_slider(slider& wdg) + : widget{ wdg } + {} + namespace drawerbase { namespace slider diff --git a/source/gui/widgets/textbox.cpp b/source/gui/widgets/textbox.cpp index cc064328..cb4f9cf6 100644 --- a/source/gui/widgets/textbox.cpp +++ b/source/gui/widgets/textbox.cpp @@ -15,7 +15,13 @@ #include #include -namespace nana{ namespace drawerbase { +namespace nana +{ + arg_textbox::arg_textbox(textbox& wdg) + : widget{wdg} + {} + +namespace drawerbase { namespace textbox { //class event_agent diff --git a/source/gui/widgets/toolbar.cpp b/source/gui/widgets/toolbar.cpp index 1f0706e7..a51c14cd 100644 --- a/source/gui/widgets/toolbar.cpp +++ b/source/gui/widgets/toolbar.cpp @@ -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 diff --git a/source/gui/widgets/treebox.cpp b/source/gui/widgets/treebox.cpp index ace4711a..fdae39c5 100644 --- a/source/gui/widgets/treebox.cpp +++ b/source/gui/widgets/treebox.cpp @@ -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