diff --git a/include/nana/charset.hpp b/include/nana/charset.hpp index 725fdf96..41fa4d72 100644 --- a/include/nana/charset.hpp +++ b/include/nana/charset.hpp @@ -1,7 +1,7 @@ /** * The charset Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2016 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/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index 1087f1fc..42ac9123 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -8,8 +8,11 @@ * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/gui/widgets/listbox.hpp - * @contributors: Ariel Vina-Rodriguez - * + * @contributors: + * Hiroshi Seki + * Ariel Vina-Rodriguez + * leobackes + * Benjamin Navarro */ #ifndef NANA_GUI_WIDGETS_LISTBOX_HPP @@ -471,18 +474,24 @@ namespace nana mutable drawerbase::listbox::item_proxy item; bool selected; - arg_listbox(const drawerbase::listbox::item_proxy&, bool selected); + arg_listbox(const drawerbase::listbox::item_proxy&, bool selected) noexcept; }; + + /// The event argument type for listbox's category_dbl_click struct arg_category : public event_arg { drawerbase::listbox::cat_proxy category; - void block_category_change() const; - bool category_change_blocked() const; - arg_category(const drawerbase::listbox::cat_proxy&); + /// Block expension/shrink of category + void block_category_change() const noexcept; + + /// Determines whether expension/shrink of category is blocked + bool category_change_blocked() const noexcept; + + arg_category(const drawerbase::listbox::cat_proxy&) noexcept; private: - mutable bool _m_block_change; + mutable bool block_change_; }; namespace drawerbase @@ -494,6 +503,8 @@ namespace nana { basic_event checked; basic_event selected; + + /// An event occurs when a listbox category is double clicking. basic_event category_dbl_click; }; @@ -625,8 +636,13 @@ By \a clicking on one header the list get \a reordered, first up, and then down return cat_proxy(&_m_ess(), _m_at_key(p)); } + /// Returns an item by the specified absolute position item_proxy at(const index_pair &abs_pos) const; + + /// Returns an index of item which contains the specified point. index_pair at(const point & pos) const; + + /// Returns the column which contains the specified point. columns_indexs column_from_pos(const point & pos); diff --git a/include/nana/gui/widgets/toolbar.hpp b/include/nana/gui/widgets/toolbar.hpp index 630c2294..8a4d3a40 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-2015 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2016 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/charset.cpp b/source/charset.cpp index eed89a8d..ddf7207f 100644 --- a/source/charset.cpp +++ b/source/charset.cpp @@ -1,7 +1,7 @@ /* * A Character Encoding Set Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -11,6 +11,7 @@ * @brief: A conversion between unicode characters and multi bytes characters * @contributions: * UTF16 4-byte decoding issue by Renke Yan. + * Pr0curo(pr#98) */ #include @@ -18,7 +19,7 @@ #include #include #include -#include +#include //Added by Pr0curo(pr#98) //GCC 4.7.0 does not implement the and codecvt_utfx classes #ifndef STD_CODECVT_NOT_SUPPORTED diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index cb23a4e9..3e214531 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -11,7 +11,7 @@ * @contributors: * Hiroshi Seki * Ariel Vina-Rodriguez - * leobackes(pr#86) + * leobackes(pr#86,pr#97) * Benjamin Navarro(pr#81) * */ @@ -4279,6 +4279,8 @@ namespace nana cat_ = &(*i); } + //A fix for auto_draw, to make sure the inline widget set() issued after value() and value_ptr() are actually set. + //Fixed by leobackes(pr#86) void cat_proxy::_m_update() { ess_->update(); } @@ -4289,27 +4291,30 @@ namespace nana } }//end namespace drawerbase - arg_listbox::arg_listbox(const drawerbase::listbox::item_proxy& m, bool selected) + arg_listbox::arg_listbox(const drawerbase::listbox::item_proxy& m, bool selected) noexcept : item(m), selected(selected) { } - arg_category::arg_category ( const nana::drawerbase::listbox::cat_proxy& cat ) - : category(cat), _m_block_change(false) + + //Implementation of arg_category + //Contributed by leobackes(pr#97) + arg_category::arg_category ( const nana::drawerbase::listbox::cat_proxy& cat ) noexcept + : category(cat), block_change_(false) { } - void arg_category::block_category_change() const { - _m_block_change=true; + void arg_category::block_category_change() const noexcept + { + block_change_ = true; } - bool arg_category::category_change_blocked() const { - return _m_block_change; + bool arg_category::category_change_blocked() const noexcept + { + return block_change_; } - - //class listbox listbox::listbox(window wd, bool visible) { @@ -4475,12 +4480,13 @@ namespace nana return *this; } - /// from abs pos listbox::item_proxy listbox::at(const index_pair& pos_abs) const { return at(pos_abs.cat).at(pos_abs.item); } + + // Contributed by leobackes(pr#97) listbox::index_pair listbox::at ( const point& pos ) const { auto & ess=_m_ess(); @@ -4493,6 +4499,7 @@ namespace nana return item_pos; } + //Contributed by leobackes(pr#97) listbox::columns_indexs listbox::column_from_pos ( const point& pos ) { auto & ess=_m_ess(); diff --git a/source/gui/widgets/menu.cpp b/source/gui/widgets/menu.cpp index 5276b212..53930ae4 100644 --- a/source/gui/widgets/menu.cpp +++ b/source/gui/widgets/menu.cpp @@ -8,6 +8,8 @@ * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/gui/widgets/menu.cpp +* @contributors: +* kmribti(pr#102) */ #include @@ -145,14 +147,18 @@ namespace nana void item_image(graph_reference graph, const nana::point& pos, unsigned image_px, const paint::image& img) { - if (img.size().width > image_px || img.size().height > image_px ) + if (img.size().width > image_px || img.size().height > image_px) + { img.stretch(rectangle{ img.size() }, graph, rectangle{ pos, ::nana::size(image_px, image_px) }); - else { - nana::point ipos = pos; - ipos.x += (image_px - img.size().width ) / 2; - ipos.y += (image_px - img.size().height) / 2; - img.paste(graph, ipos); + return; } + + //Stretchs menu icon only when it doesn't fit, center it otherwise. + //Contributed by kmribti(pr#102) + nana::point ipos = pos; + ipos.x += (image_px - img.size().width ) / 2; + ipos.y += (image_px - img.size().height) / 2; + img.paste(graph, ipos); } void item_text(graph_reference graph, const nana::point& pos, const std::string& text, unsigned text_pixels, const attr& at) diff --git a/source/gui/widgets/toolbar.cpp b/source/gui/widgets/toolbar.cpp index c509f1a0..6cf81234 100644 --- a/source/gui/widgets/toolbar.cpp +++ b/source/gui/widgets/toolbar.cpp @@ -1,13 +1,15 @@ /* * A Toolbar Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/gui/widgets/toolbar.cpp + * @contributors: + * kmribti(pr#105) */ #include @@ -79,12 +81,14 @@ namespace nana insert(cont_.size(), text, nana::paint::image(), item_type::kind::button); } - void go_right() + //Contributed by kmribti(pr#105) + void go_right() noexcept { right_ = cont_.size(); } - size_t right() + //Contributed by kmribti(pr#105) + size_t right() const noexcept { return right_; } @@ -102,12 +106,12 @@ namespace nana cont_.push_back(nullptr); } - size_type size() const + size_type size() const noexcept { return cont_.size(); } - container_type& container() + container_type& container() noexcept { return cont_; } @@ -247,9 +251,12 @@ namespace nana x += 4; } ++index; + + //Reset the x position of items which are right aligned + //Contributed by kmribti(pr#105) if (index == impl_->items.right() && index < impl_->items.size()) { - int total_x = 0; + unsigned total_x = 0; for (size_t i = index; i < impl_->items.size(); i++) { if (impl_->items.at(i) == nullptr) { total_x += 8; // we assume that separator has width = 8. @@ -259,6 +266,7 @@ namespace nana total_x += impl_->items.at(i)->pixels; } } + x = graph.size().width - total_x - 4; } } @@ -427,6 +435,7 @@ namespace nana create(wd, r, visible); } + //Contributed by kmribti(pr#105) void toolbar::go_right() { get_drawer_trigger().items().go_right(); diff --git a/source/paint/image.cpp b/source/paint/image.cpp index ee77a0bb..f14de479 100644 --- a/source/paint/image.cpp +++ b/source/paint/image.cpp @@ -8,6 +8,8 @@ * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/paint/image.cpp + * @contributors: + * nabijaczleweli(pr#106) */ #include @@ -355,16 +357,19 @@ namespace paint return (image_ptr_ ? &image::empty : nullptr); } + //Fixed missing noexcept specifier by nabijaczleweli(pr#106) void image::close() noexcept { image_ptr_.reset(); } + //Fixed missing noexcept specifier by nabijaczleweli(pr#106) bool image::alpha() const noexcept { return (image_ptr_ ? image_ptr_->alpha_channel() : false); } + //Fixed missing noexcept specifier by nabijaczleweli(pr#106) nana::size image::size() const noexcept { return (image_ptr_ ? image_ptr_->size() : nana::size());