add contribution information

This commit is contained in:
Jinhao 2016-01-31 22:38:39 +08:00
parent 780805484e
commit 397096f60e
8 changed files with 78 additions and 34 deletions

View File

@ -1,7 +1,7 @@
/** /**
* The charset Implementation * The charset Implementation
* Nana C++ Library(http://www.nanapro.org) * 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. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at * (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -8,8 +8,11 @@
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
* *
* @file: nana/gui/widgets/listbox.hpp * @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 #ifndef NANA_GUI_WIDGETS_LISTBOX_HPP
@ -471,18 +474,24 @@ namespace nana
mutable drawerbase::listbox::item_proxy item; mutable drawerbase::listbox::item_proxy item;
bool selected; 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 struct arg_category
: public event_arg : public event_arg
{ {
drawerbase::listbox::cat_proxy category; 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: private:
mutable bool _m_block_change; mutable bool block_change_;
}; };
namespace drawerbase namespace drawerbase
@ -494,6 +503,8 @@ namespace nana
{ {
basic_event<arg_listbox> checked; basic_event<arg_listbox> checked;
basic_event<arg_listbox> selected; basic_event<arg_listbox> selected;
/// An event occurs when a listbox category is double clicking.
basic_event<arg_category> category_dbl_click; basic_event<arg_category> 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)); 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; 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; index_pair at(const point & pos) const;
/// Returns the column which contains the specified point.
columns_indexs column_from_pos(const point & pos); columns_indexs column_from_pos(const point & pos);

View File

@ -1,7 +1,7 @@
/** /**
* A Toolbar Implementation * A Toolbar Implementation
* Nana C++ Library(http://www.nanapro.org) * 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. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at * (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,7 +1,7 @@
/* /*
* A Character Encoding Set Implementation * A Character Encoding Set Implementation
* Nana C++ Library(http://www.nanapro.org) * 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. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at * (See accompanying file LICENSE_1_0.txt or copy at
@ -11,6 +11,7 @@
* @brief: A conversion between unicode characters and multi bytes characters * @brief: A conversion between unicode characters and multi bytes characters
* @contributions: * @contributions:
* UTF16 4-byte decoding issue by Renke Yan. * UTF16 4-byte decoding issue by Renke Yan.
* Pr0curo(pr#98)
*/ */
#include <nana/charset.hpp> #include <nana/charset.hpp>
@ -18,7 +19,7 @@
#include <nana/deploy.hpp> #include <nana/deploy.hpp>
#include <cwchar> #include <cwchar>
#include <clocale> #include <clocale>
#include <cstring> #include <cstring> //Added by Pr0curo(pr#98)
//GCC 4.7.0 does not implement the <codecvt> and codecvt_utfx classes //GCC 4.7.0 does not implement the <codecvt> and codecvt_utfx classes
#ifndef STD_CODECVT_NOT_SUPPORTED #ifndef STD_CODECVT_NOT_SUPPORTED

View File

@ -11,7 +11,7 @@
* @contributors: * @contributors:
* Hiroshi Seki * Hiroshi Seki
* Ariel Vina-Rodriguez * Ariel Vina-Rodriguez
* leobackes(pr#86) * leobackes(pr#86,pr#97)
* Benjamin Navarro(pr#81) * Benjamin Navarro(pr#81)
* *
*/ */
@ -4279,6 +4279,8 @@ namespace nana
cat_ = &(*i); 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() { void cat_proxy::_m_update() {
ess_->update(); ess_->update();
} }
@ -4289,27 +4291,30 @@ namespace nana
} }
}//end namespace drawerbase }//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) : 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 { void arg_category::block_category_change() const noexcept
_m_block_change=true; {
block_change_ = true;
} }
bool arg_category::category_change_blocked() const { bool arg_category::category_change_blocked() const noexcept
return _m_block_change; {
return block_change_;
} }
//class listbox //class listbox
listbox::listbox(window wd, bool visible) listbox::listbox(window wd, bool visible)
{ {
@ -4475,12 +4480,13 @@ namespace nana
return *this; return *this;
} }
/// from abs pos
listbox::item_proxy listbox::at(const index_pair& pos_abs) const listbox::item_proxy listbox::at(const index_pair& pos_abs) const
{ {
return at(pos_abs.cat).at(pos_abs.item); return at(pos_abs.cat).at(pos_abs.item);
} }
// Contributed by leobackes(pr#97)
listbox::index_pair listbox::at ( const point& pos ) const listbox::index_pair listbox::at ( const point& pos ) const
{ {
auto & ess=_m_ess(); auto & ess=_m_ess();
@ -4493,6 +4499,7 @@ namespace nana
return item_pos; return item_pos;
} }
//Contributed by leobackes(pr#97)
listbox::columns_indexs listbox::column_from_pos ( const point& pos ) listbox::columns_indexs listbox::column_from_pos ( const point& pos )
{ {
auto & ess=_m_ess(); auto & ess=_m_ess();

View File

@ -8,6 +8,8 @@
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
* *
* @file: nana/gui/widgets/menu.cpp * @file: nana/gui/widgets/menu.cpp
* @contributors:
* kmribti(pr#102)
*/ */
#include <nana/gui/widgets/menu.hpp> #include <nana/gui/widgets/menu.hpp>
@ -145,14 +147,18 @@ namespace nana
void item_image(graph_reference graph, const nana::point& pos, unsigned image_px, const paint::image& img) 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) }); img.stretch(rectangle{ img.size() }, graph, rectangle{ pos, ::nana::size(image_px, image_px) });
else { return;
nana::point ipos = pos;
ipos.x += (image_px - img.size().width ) / 2;
ipos.y += (image_px - img.size().height) / 2;
img.paste(graph, ipos);
} }
//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) void item_text(graph_reference graph, const nana::point& pos, const std::string& text, unsigned text_pixels, const attr& at)

View File

@ -1,13 +1,15 @@
/* /*
* A Toolbar Implementation * A Toolbar Implementation
* Nana C++ Library(http://www.nanapro.org) * 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. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at * (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
* *
* @file: nana/gui/widgets/toolbar.cpp * @file: nana/gui/widgets/toolbar.cpp
* @contributors:
* kmribti(pr#105)
*/ */
#include <nana/gui/widgets/toolbar.hpp> #include <nana/gui/widgets/toolbar.hpp>
@ -79,12 +81,14 @@ namespace nana
insert(cont_.size(), text, nana::paint::image(), item_type::kind::button); 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(); right_ = cont_.size();
} }
size_t right() //Contributed by kmribti(pr#105)
size_t right() const noexcept
{ {
return right_; return right_;
} }
@ -102,12 +106,12 @@ namespace nana
cont_.push_back(nullptr); cont_.push_back(nullptr);
} }
size_type size() const size_type size() const noexcept
{ {
return cont_.size(); return cont_.size();
} }
container_type& container() container_type& container() noexcept
{ {
return cont_; return cont_;
} }
@ -247,9 +251,12 @@ namespace nana
x += 4; x += 4;
} }
++index; ++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()) 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++) { for (size_t i = index; i < impl_->items.size(); i++) {
if (impl_->items.at(i) == nullptr) { if (impl_->items.at(i) == nullptr) {
total_x += 8; // we assume that separator has width = 8. total_x += 8; // we assume that separator has width = 8.
@ -259,6 +266,7 @@ namespace nana
total_x += impl_->items.at(i)->pixels; total_x += impl_->items.at(i)->pixels;
} }
} }
x = graph.size().width - total_x - 4; x = graph.size().width - total_x - 4;
} }
} }
@ -427,6 +435,7 @@ namespace nana
create(wd, r, visible); create(wd, r, visible);
} }
//Contributed by kmribti(pr#105)
void toolbar::go_right() void toolbar::go_right()
{ {
get_drawer_trigger().items().go_right(); get_drawer_trigger().items().go_right();

View File

@ -8,6 +8,8 @@
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
* *
* @file: nana/paint/image.cpp * @file: nana/paint/image.cpp
* @contributors:
* nabijaczleweli(pr#106)
*/ */
#include <nana/detail/platform_spec_selector.hpp> #include <nana/detail/platform_spec_selector.hpp>
@ -355,16 +357,19 @@ namespace paint
return (image_ptr_ ? &image::empty : nullptr); return (image_ptr_ ? &image::empty : nullptr);
} }
//Fixed missing noexcept specifier by nabijaczleweli(pr#106)
void image::close() noexcept void image::close() noexcept
{ {
image_ptr_.reset(); image_ptr_.reset();
} }
//Fixed missing noexcept specifier by nabijaczleweli(pr#106)
bool image::alpha() const noexcept bool image::alpha() const noexcept
{ {
return (image_ptr_ ? image_ptr_->alpha_channel() : false); return (image_ptr_ ? image_ptr_->alpha_channel() : false);
} }
//Fixed missing noexcept specifier by nabijaczleweli(pr#106)
nana::size image::size() const noexcept nana::size image::size() const noexcept
{ {
return (image_ptr_ ? image_ptr_->size() : nana::size()); return (image_ptr_ ? image_ptr_->size() : nana::size());