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

@@ -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();

View File

@@ -8,6 +8,8 @@
* http://www.boost.org/LICENSE_1_0.txt)
*
* @file: nana/gui/widgets/menu.cpp
* @contributors:
* kmribti(pr#102)
*/
#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)
{
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)

View File

@@ -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 <nana/gui/widgets/toolbar.hpp>
@@ -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();