init dragdrop

contains a new class simple_dragdrop and changes of listbox for dragdrop
This commit is contained in:
Jinhao
2018-10-09 03:56:50 +08:00
parent 95ccc3cb7e
commit 943a9e444d
17 changed files with 812 additions and 19 deletions

View File

@@ -65,7 +65,7 @@ namespace nana {
bool passive{ true }; //The passive mode determines whether to update if scrollbar changes. It updates the client window if passive is true.
bool drag_started{ false };
bool drag_view_move{ false }; //indicates the status of the content-view if it moves origin by dragging
point origin;
std::shared_ptr<cv_scroll_rep> cv_scroll;
@@ -120,19 +120,22 @@ namespace nana {
if (!arg.is_left_button())
return;
this->drag_started = this->view.view_area().is_hit(arg.pos);
this->drag_view_move = this->view.view_area().is_hit(arg.pos);
}
else if (event_code::mouse_move == arg.evt_code)
{
if (this->drag_started && this->drive(arg.pos))
if (this->drag_view_move && (dragdrop_status::not_ready == API::window_dragdrop_status(this->window_handle)))
{
tmr.interval(16);
tmr.start();
if (this->drive(arg.pos))
{
tmr.interval(16);
tmr.start();
}
}
}
else if (event_code::mouse_up == arg.evt_code)
{
this->drag_started = false;
this->drag_view_move = false;
tmr.stop();
}
};