code review

This commit is contained in:
Jinhao
2015-10-07 18:01:46 +08:00
parent c6f13c1748
commit 573a5bee86
18 changed files with 36 additions and 333 deletions

View File

@@ -1491,7 +1491,7 @@ namespace nana
impl_->data.trigger_ptr = this;
impl_->data.renderer = nana::pat::cloneable<renderer_interface>(internal_renderer());
impl_->data.comp_placer = nana::pat::cloneable<compset_placer_interface>(internal_placer());
//impl_->adjust.timer.elapse(std::bind(&trigger::_m_deal_adjust, this)); //deprecated
impl_->adjust.timer.elapse([this]
{
auto & adjust = impl_->adjust;
@@ -2151,61 +2151,6 @@ namespace nana
API::lazy_refresh();
}
}
/*
void trigger::_m_deal_adjust() //deprecated
{
auto & adjust = impl_->adjust;
if(adjust.scroll_timestamp && (nana::system::timestamp() - adjust.scroll_timestamp >= 500))
{
if(adjust.offset_x_adjust == 0)
{
if(!impl_->make_adjust(adjust.node ? adjust.node : impl_->shape.first, 1))
{
adjust.offset_x_adjust = 0;
adjust.node = nullptr;
adjust.scroll_timestamp = 0;
adjust.timer.stop();
return;
}
}
auto & shape = impl_->shape;
const int delta = 5;
int old = shape.offset_x;
if(shape.offset_x < adjust.offset_x_adjust)
{
shape.offset_x += delta;
if(shape.offset_x > adjust.offset_x_adjust)
shape.offset_x = adjust.offset_x_adjust;
}
else if(shape.offset_x > adjust.offset_x_adjust)
{
shape.offset_x -= delta;
if(shape.offset_x < adjust.offset_x_adjust)
shape.offset_x = adjust.offset_x_adjust;
}
impl_->draw(false);
API::update_window(impl_->data.widget_ptr->handle());
if(impl_->node_state.tooltip)
{
nana::point pos = impl_->node_state.tooltip->pos();
impl_->node_state.tooltip->move(pos.x - shape.offset_x + old, pos.y);
}
if(shape.offset_x == adjust.offset_x_adjust)
{
adjust.offset_x_adjust = 0;
adjust.node = nullptr;
adjust.scroll_timestamp = 0;
adjust.timer.stop();
}
}
}
//*/
//end class trigger
}//end namespace treebox
}//end namespace drawerbase