fix mouse left button issues due to breaking changes

This commit is contained in:
Jinhao
2015-07-28 00:00:15 +08:00
parent 5dd5d110d7
commit 396163c1b7
13 changed files with 93 additions and 72 deletions

View File

@@ -34,7 +34,7 @@ namespace nana
{
if (state == StateHighlighted)
{
::nana::color clr{ 0xaf, 0xc7, 0xe3 };
::nana::color clr(static_cast<color_rgb>(0xafc7e3));
graph.rectangle(r, false, clr);
auto right = r.right() - 1;
@@ -276,7 +276,7 @@ namespace nana
}
}
bool right_area(graph_reference graph, int x, int y) const
static bool right_area(graph_reference graph, int x, int y)
{
return ((1 < x && 1 < y) &&
x < static_cast<int>(graph.width()) - 2 &&
@@ -325,7 +325,7 @@ namespace nana
_m_open_scrollbar(*widget_, pages);
}
else
graph_->string({ 4, 4 }, STR("Empty Listbox, No Module!"), {0x80, 0x80, 0x80});
graph_->string({ 4, 4 }, STR("Empty Listbox, No Module!"), static_cast<color_rgb>(0x808080));
//Draw border
graph_->rectangle(false, colors::black);
@@ -361,7 +361,7 @@ namespace nana
auto fn = [this](const arg_mouse& arg)
{
if (arg.left_button && (scrollbar_.value() != state_.offset_y))
if (arg.is_left_button() && (scrollbar_.value() != state_.offset_y))
{
state_.offset_y = static_cast<unsigned>(scrollbar_.value());
draw();
@@ -449,12 +449,16 @@ namespace nana
void trigger::mouse_up(graph_reference graph, const arg_mouse& arg)
{
if(drawer_->right_area(graph, arg.pos.x, arg.pos.y))
bool close_wdg = false;
if (drawer_->right_area(graph, arg.pos.x, arg.pos.y))
{
drawer_->set_result();
drawer_->widget_ptr()->close();
close_wdg = true;
}
else if(false == drawer_->ignore_emitting_mouseup())
else
close_wdg = (false == drawer_->ignore_emitting_mouseup());
if (close_wdg)
drawer_->widget_ptr()->close();
}
//end class trigger