Merge branch 'hotfix-1.1.3' into feature-docker-place

This commit is contained in:
Jinhao 2015-09-14 01:53:07 +08:00
commit de96ff2cab
8 changed files with 56 additions and 6 deletions

View File

@ -34,8 +34,13 @@ if(BIICODE)
# we'll use the default config file so we can iliminate the following macro definitions
if(MSVC)
# More MSVC specific compilation flags
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
if(MSVC14)
add_definitions(-DSTD_CODECVT_NOT_SUPPORTED)
else()
add_definitions(-DNOT_IMPLEMENTED_KEYWORD_noexcept)
endif()
endif()
add_biicode_targets()

View File

@ -106,6 +106,8 @@ namespace detail
~drawable_impl_type();
void fgcolor(const ::nana::color&); //deprecated
unsigned get_color() const;
unsigned get_text_color() const;
void set_color(const ::nana::color&);
void set_text_color(const ::nana::color&);

View File

@ -146,6 +146,7 @@ namespace detail
void fgcolor(const ::nana::color&); //deprecated
unsigned get_color() const;
unsigned get_text_color() const;
void set_color(const ::nana::color&);
void set_text_color(const ::nana::color&);

View File

@ -136,8 +136,11 @@ namespace nana
/// @param file_utf8 A UTF-8 string to a filename
void save_as_file(const char* file_utf8) const throw();
void set_color(const ::nana::color&);
void set_text_color(const ::nana::color&);
void set_color(const ::nana::color&); //deprecated, graphics::palette() instead
void set_text_color(const ::nana::color&); //deprecated, graphics::palette() instead
::nana::color palette(bool for_text) const;
graphics& palette(bool for_text, const ::nana::color&);
unsigned bidi_string(const nana::point&, const char_t *, std::size_t len);
unsigned bidi_string(const point& pos, const char*, std::size_t len);

View File

@ -302,6 +302,16 @@ namespace detail
#endif
}
unsigned drawable_impl_type::get_color() const
{
return color_;
}
unsigned drawable_impl_type::get_text_color() const
{
return text_color_;
}
void drawable_impl_type::set_color(const ::nana::color& clr)
{
color_ = (clr.px_color().value & 0xFFFFFF);

View File

@ -63,6 +63,11 @@ namespace detail
return color_;
}
unsigned drawable_impl_type::get_text_color() const
{
return text_color_;
}
void drawable_impl_type::set_color(const ::nana::color& clr)
{
color_ = (clr.px_color().value & 0xFFFFFF);

View File

@ -874,6 +874,27 @@ namespace paint
handle_->set_text_color(col);
}
::nana::color graphics::palette(bool for_text) const
{
if (handle_)
return static_cast<color_rgb>(for_text ? handle_->get_text_color() : handle_->get_color());
return{};
}
graphics& graphics::palette(bool for_text, const ::nana::color& clr)
{
if (handle_)
{
if (for_text)
handle_->set_text_color(clr);
else
handle_->set_color(clr);
}
return *this;
}
unsigned graphics::bidi_string(const nana::point& pos, const char_t * str, std::size_t len)
{
auto moved_pos = pos;

View File

@ -118,11 +118,12 @@ namespace nana
{
graphics & graph;
int x, endpos;
::nana::color fgcolor;
//::nana::color fgcolor; //deprecated
unsigned omitted_pixels;
nana::unicode_bidi bidi;
std::vector<nana::unicode_bidi::entity> reordered;
/* //deprecated
draw_string_omitted(graphics& graph, int x, int endpos, const ::nana::color& fgcolor, bool omitted)
: graph(graph), x(x), endpos(endpos), fgcolor(fgcolor)
{
@ -132,6 +133,7 @@ namespace nana
else
this->endpos = x;
}
*/
draw_string_omitted(graphics& graph, int x, int endpos, bool omitted)
: graph(graph), x(x), endpos(endpos)
@ -169,7 +171,8 @@ namespace nana
nana::paint::graphics dum_graph({ r.width, r.height });
dum_graph.bitblt(r, graph, pos);
dum_graph.set_text_color(fgcolor);
//dum_graph.set_text_color(fgcolor); //deprecated
dum_graph.set_text_color(graph.palette(true));
dum_graph.string({}, i.begin, len);
r.x = pos.x;