parent
8f0d79b88d
commit
57aa0498b3
@ -8,12 +8,7 @@
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* @file: nana/gui/widgets/listbox.hpp
|
||||
* @contributors:
|
||||
* Hiroshi Seki
|
||||
* Ariel Vina-Rodriguez
|
||||
* leobackes(pr#86,pr#97)
|
||||
* Benjamin Navarro(pr#81)
|
||||
* besh81(pr#130)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NANA_GUI_WIDGETS_LISTBOX_HPP
|
||||
@ -1149,7 +1144,7 @@ namespace nana
|
||||
: public widget_geometrics
|
||||
{
|
||||
color_proxy header_bgcolor{static_cast<color_rgb>(0xf1f2f4)};
|
||||
color_proxy header_fgcolor{ static_cast<color_rgb>(0x000000) };
|
||||
color_proxy header_fgcolor{ colors::black };
|
||||
color_proxy header_grabbed{ static_cast<color_rgb>(0x8BD6F6)};
|
||||
color_proxy header_floated{ static_cast<color_rgb>(0xBABBBC)};
|
||||
color_proxy item_selected{ static_cast<color_rgb>(0xD5EFFC) };
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
/**
|
||||
* A Menu implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2009-2014 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2009-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/menu.hpp
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NANA_GUI_WIDGETS_MENU_HPP
|
||||
@ -138,13 +139,13 @@ namespace nana
|
||||
~menu();
|
||||
|
||||
/// Appends an item to the menu.
|
||||
item_proxy append(const std::string& text, const event_fn_t& callback= event_fn_t());
|
||||
item_proxy append(std::string text_utf8, const event_fn_t& callback= event_fn_t());
|
||||
void append_splitter();
|
||||
void clear(); ///< Erases all of the items.
|
||||
/// Closes the menu. It does not destroy the menu; just close the window for the menu.
|
||||
void close();
|
||||
void image(std::size_t pos, const paint::image& icon);
|
||||
void change_text(std::size_t pos, const std::string& text);
|
||||
void text(std::size_t pos, std::string text_utf8);
|
||||
void check_style(std::size_t pos, checks);
|
||||
void checked(std::size_t pos, bool);
|
||||
bool checked(std::size_t pos) const;
|
||||
|
||||
@ -14,7 +14,8 @@
|
||||
* leobackes(pr#86,pr#97)
|
||||
* Benjamin Navarro(pr#81)
|
||||
* besh81(pr#130)
|
||||
*
|
||||
* dankan1890(pr#154)
|
||||
*
|
||||
*/
|
||||
|
||||
#include <nana/gui/widgets/listbox.hpp>
|
||||
@ -3394,6 +3395,7 @@ namespace nana
|
||||
|
||||
int text_top = (r.height - essence_->scheme_ptr->text_height) / 2 + r.y;
|
||||
auto text_color = essence_->scheme_ptr->header_fgcolor.get_color();
|
||||
|
||||
|
||||
auto state = item_state::normal;
|
||||
//check whether grabing an item, if item_spliter_ != npos, that indicates the grab item is a spliter.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* A Menu implementation
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2009-2015 Jinhao(cnjinhao@hotmail.com)
|
||||
* Copyright(C) 2009-2016 Jinhao(cnjinhao@hotmail.com)
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -10,6 +10,7 @@
|
||||
* @file: nana/gui/widgets/menu.cpp
|
||||
* @contributors:
|
||||
* kmribti(pr#102)
|
||||
* dankan1890(pr#154)
|
||||
*/
|
||||
|
||||
#include <nana/gui/widgets/menu.hpp>
|
||||
@ -1120,9 +1121,9 @@ namespace nana
|
||||
delete impl_;
|
||||
}
|
||||
|
||||
auto menu::append(const std::string& text, const menu::event_fn_t& f) -> item_proxy
|
||||
auto menu::append(std::string text_utf8, const menu::event_fn_t& f) -> item_proxy
|
||||
{
|
||||
impl_->mbuilder.data().items.emplace_back(text, f);
|
||||
impl_->mbuilder.data().items.emplace_back(std::move(text_utf8), f);
|
||||
return item_proxy(size() - 1, impl_->mbuilder.data().items.back());
|
||||
}
|
||||
|
||||
@ -1158,9 +1159,9 @@ namespace nana
|
||||
impl_->mbuilder.data().items.at(index).image = img;
|
||||
}
|
||||
|
||||
void menu::change_text(std::size_t index, const std::string& text)
|
||||
void menu::text(std::size_t index, std::string text_utf8)
|
||||
{
|
||||
impl_->mbuilder.data().items.at(index).text = text;
|
||||
impl_->mbuilder.data().items.at(index).text.swap(text_utf8);
|
||||
}
|
||||
|
||||
bool menu::link(std::size_t index, menu& menu_obj)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user