Added named colors from 4.3 Extended color keywords
::nana::colors::<named colors>
This commit is contained in:
@@ -130,8 +130,8 @@ namespace nana
|
||||
pos.y += effective_range_.y;
|
||||
}
|
||||
|
||||
if( (pos.x + static_cast<int>(size.width) <= rect.x) || (pos.x >= rect.x + static_cast<int>(rect.width)) ||
|
||||
(pos.y + static_cast<int>(size.height) <= rect.y) || (pos.y >= rect.y + static_cast<int>(rect.height))
|
||||
if( (pos.x + static_cast<int>(size.width) <= rect.x) || (pos.x >= rect.right()) ||
|
||||
(pos.y + static_cast<int>(size.height) <= rect.y) || (pos.y >= rect.bottom())
|
||||
)
|
||||
{//Out of Range without overlap
|
||||
if(false == out_of_range_)
|
||||
@@ -149,7 +149,7 @@ namespace nana
|
||||
size.width -= (rect.x - pos.x);
|
||||
pos.x = rect.x;
|
||||
}
|
||||
else if(pos.x + size.width > rect.right())
|
||||
else if(pos.x + static_cast<int>(size.width) > rect.right())
|
||||
{
|
||||
size.width -= pos.x + size.width - rect.right();
|
||||
}
|
||||
@@ -159,7 +159,7 @@ namespace nana
|
||||
size.width -= (rect.y - pos.y);
|
||||
pos.y = rect.y;
|
||||
}
|
||||
else if(pos.y + size.height > rect.bottom())
|
||||
else if(pos.y + static_cast<int>(size.height) > rect.bottom())
|
||||
size.height -= pos.y + size.height - rect.bottom();
|
||||
|
||||
if(out_of_range_)
|
||||
@@ -297,11 +297,8 @@ namespace nana
|
||||
pos_owner = pos_root = r;
|
||||
dimension = r;
|
||||
|
||||
if(parent)
|
||||
{
|
||||
pos_root.x += parent->pos_root.x;
|
||||
pos_root.y += parent->pos_root.y;
|
||||
}
|
||||
if (parent)
|
||||
pos_root += parent->pos_root;
|
||||
}
|
||||
|
||||
void basic_window::_m_initialize(basic_window* agrparent)
|
||||
@@ -345,10 +342,6 @@ namespace nana
|
||||
|
||||
visible = false;
|
||||
|
||||
colors.fgcolor = ::nana::colors::black;
|
||||
colors.bgcolor = ::nana::colors::button_face;
|
||||
colors.activated.from_rgb(0x60, 0xc8, 0xfd);
|
||||
|
||||
effect.edge_nimbus = effects::edge_nimbus::none;
|
||||
effect.bground = nullptr;
|
||||
effect.bground_fade_rate = 0;
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace API
|
||||
if(restrict::window_manager.available(iwd))
|
||||
{
|
||||
iwd->drawer.graphics.make(iwd->dimension.width, iwd->dimension.height);
|
||||
iwd->drawer.graphics.rectangle(true, iwd->colors.bgcolor);
|
||||
iwd->drawer.graphics.rectangle(true, iwd->expr_colors->background.get_color());
|
||||
iwd->drawer.attached(wd, dr);
|
||||
iwd->drawer.refresh(); //Always redrawe no matter it is visible or invisible. This can make the graphics data correctly.
|
||||
}
|
||||
@@ -685,6 +685,12 @@ namespace API
|
||||
restrict::window_manager.update(reinterpret_cast<restrict::core_window_t*>(wd), false, true);
|
||||
}
|
||||
|
||||
|
||||
void window_caption(window wd, const std::string& title_utf8)
|
||||
{
|
||||
window_caption(wd, std::wstring(::nana::charset(title_utf8, ::nana::unicode::utf8)));
|
||||
}
|
||||
|
||||
void window_caption(window wd, const nana::string& title)
|
||||
{
|
||||
auto const iwd = reinterpret_cast<restrict::core_window_t*>(wd);
|
||||
|
||||
@@ -2373,18 +2373,16 @@ namespace nana{ namespace widgets
|
||||
|
||||
nana::size text_editor::_m_text_extent_size(const char_type* str, size_type n) const
|
||||
{
|
||||
if(graph_)
|
||||
if (!graph_)
|
||||
return{};
|
||||
|
||||
if(mask_char_)
|
||||
{
|
||||
if(mask_char_)
|
||||
{
|
||||
nana::string maskstr;
|
||||
maskstr.append(n, mask_char_);
|
||||
return graph_.text_extent_size(maskstr);
|
||||
}
|
||||
else
|
||||
return graph_.text_extent_size(str, static_cast<unsigned>(n));
|
||||
nana::string maskstr;
|
||||
maskstr.append(n, mask_char_);
|
||||
return graph_.text_extent_size(maskstr);
|
||||
}
|
||||
return{};
|
||||
return graph_.text_extent_size(str, static_cast<unsigned>(n));
|
||||
}
|
||||
|
||||
//_m_move_offset_x_while_over_border
|
||||
@@ -2415,7 +2413,7 @@ namespace nana{ namespace widgets
|
||||
width += text_area_.area.x;
|
||||
if(static_cast<int>(width) - points_.offset.x >= _m_endx())
|
||||
{ //Out of screen text area
|
||||
points_.offset.x = width - _m_endx() + 1;
|
||||
points_.offset.x = static_cast<int>(width) -_m_endx() + 1;
|
||||
auto rest_size = lnstr.size() - points_.caret.x;
|
||||
points_.offset.x += static_cast<int>(_m_text_extent_size(lnstr.c_str() + points_.caret.x, (rest_size >= static_cast<unsigned>(many) ? static_cast<unsigned>(many) : rest_size)).width);
|
||||
return true;
|
||||
|
||||
@@ -20,13 +20,16 @@ namespace nana
|
||||
}
|
||||
//class widget
|
||||
//@brief:The definition of class widget
|
||||
widget::~widget(){}
|
||||
|
||||
nana::string widget::caption() const
|
||||
{
|
||||
return this->_m_caption();
|
||||
}
|
||||
|
||||
void widget::caption(std::string utf8)
|
||||
{
|
||||
_m_caption(std::wstring(::nana::charset(utf8, ::nana::unicode::utf8)));
|
||||
}
|
||||
|
||||
void widget::caption(nana::string str)
|
||||
{
|
||||
_m_caption(std::move(str));
|
||||
|
||||
Reference in New Issue
Block a user