diff --git a/build/codeblocks/nana.cbp b/build/codeblocks/nana.cbp
index 18c78755..d48270ec 100644
--- a/build/codeblocks/nana.cbp
+++ b/build/codeblocks/nana.cbp
@@ -66,6 +66,7 @@
+
diff --git a/build/vc2013/nana.vcxproj b/build/vc2013/nana.vcxproj
index 8501f83f..4051495b 100644
--- a/build/vc2013/nana.vcxproj
+++ b/build/vc2013/nana.vcxproj
@@ -202,6 +202,7 @@
+
diff --git a/build/vc2013/nana.vcxproj.filters b/build/vc2013/nana.vcxproj.filters
index 6fe722eb..4c14b4d7 100644
--- a/build/vc2013/nana.vcxproj.filters
+++ b/build/vc2013/nana.vcxproj.filters
@@ -333,6 +333,9 @@
Source Files\nana\detail
+
+ Source Files\nana\gui
+
diff --git a/build/vc2015/nana.vcxproj b/build/vc2015/nana.vcxproj
index 3ec4cf7d..f271092c 100644
--- a/build/vc2015/nana.vcxproj
+++ b/build/vc2015/nana.vcxproj
@@ -196,6 +196,7 @@
+
diff --git a/build/vc2015/nana.vcxproj.filters b/build/vc2015/nana.vcxproj.filters
index d1d7ba78..c0cfcbdc 100644
--- a/build/vc2015/nana.vcxproj.filters
+++ b/build/vc2015/nana.vcxproj.filters
@@ -291,6 +291,9 @@
Source Files\detail
+
+ Source Files\gui
+
diff --git a/build/vc2017/nana.vcxproj b/build/vc2017/nana.vcxproj
index cc3c70dc..39d61fe8 100644
--- a/build/vc2017/nana.vcxproj
+++ b/build/vc2017/nana.vcxproj
@@ -179,6 +179,7 @@
+
diff --git a/build/vc2017/nana.vcxproj.filters b/build/vc2017/nana.vcxproj.filters
index 10e92180..65431a04 100644
--- a/build/vc2017/nana.vcxproj.filters
+++ b/build/vc2017/nana.vcxproj.filters
@@ -292,6 +292,9 @@
Sources\gui
+
+ Sources\gui
+
diff --git a/include/nana/gui/basis.hpp b/include/nana/gui/basis.hpp
index a582d7b9..f7ed845d 100644
--- a/include/nana/gui/basis.hpp
+++ b/include/nana/gui/basis.hpp
@@ -65,6 +65,13 @@ namespace nana
blend
};
+ enum class dragdrop_status
+ {
+ not_ready,
+ ready,
+ in_progress
+ };
+
namespace category
{
enum class flags
diff --git a/include/nana/gui/detail/basic_window.hpp b/include/nana/gui/detail/basic_window.hpp
index 6c5bc202..5911b598 100644
--- a/include/nana/gui/detail/basic_window.hpp
+++ b/include/nana/gui/detail/basic_window.hpp
@@ -1,7 +1,7 @@
/**
* A Basic Window Widget Definition
* Nana C++ Library(http://www.nanapro.org)
- * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
+ * Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -179,7 +179,8 @@ namespace detail
bool ignore_menubar_focus : 1; ///< A flag indicates whether the menubar sets the focus.
bool ignore_mouse_focus : 1; ///< A flag indicates whether the widget accepts focus when clicking on it
bool space_click_enabled : 1; ///< A flag indicates whether enable mouse_down/click/mouse_up when pressing and releasing whitespace key.
- unsigned Reserved :18;
+ bool draggable : 1;
+ unsigned Reserved :17;
unsigned char tab; ///< indicate a window that can receive the keyboard TAB
mouse_action action;
mouse_action action_before;
@@ -234,6 +235,7 @@ namespace detail
///< if the active_window is null, the parent of this window keeps focus.
paint::graphics glass_buffer; ///< if effect.bground is avaiable. Refer to window_layout::make_bground.
update_state upd_state;
+ dragdrop_status dnd_state{ dragdrop_status::not_ready };
union
{
diff --git a/include/nana/gui/dragdrop.hpp b/include/nana/gui/dragdrop.hpp
new file mode 100644
index 00000000..e68279b8
--- /dev/null
+++ b/include/nana/gui/dragdrop.hpp
@@ -0,0 +1,45 @@
+/**
+* Drag and Drop Implementation
+* Nana C++ Library(http://www.nanapro.org)
+* Copyright(C) 2018 Jinhao(cnjinhao@hotmail.com)
+*
+* Distributed under the Boost Software License, Version 1.0.
+* (See accompanying file LICENSE_1_0.txt or copy at
+* http://www.boost.org/LICENSE_1_0.txt)
+*
+* @file: nana/gui/dragdrop.hpp
+* @author: Jinhao(cnjinhao@hotmail.com)
+*/
+#ifndef NANA_GUI_DRAGDROP_INCLUDED
+#define NANA_GUI_DRAGDROP_INCLUDED
+
+#include
+#include
+#include "basis.hpp"
+
+#include
+
+namespace nana
+{
+ class simple_dragdrop
+ {
+ struct implementation;
+
+ simple_dragdrop(const simple_dragdrop&) = delete;
+ simple_dragdrop& operator=(const simple_dragdrop&) = delete;
+
+ simple_dragdrop(simple_dragdrop&&) = delete;
+ simple_dragdrop& operator=(simple_dragdrop&&) = delete;
+ public:
+ simple_dragdrop(window drag_wd);
+ ~simple_dragdrop();
+
+ /// Sets a condition that determines whether the drag&drop can start
+ void condition(std::function predicate_fn);
+ void make_drop(window target, std::function drop_fn);
+ private:
+ implementation* const impl_;
+ };
+}
+
+#endif
\ No newline at end of file
diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp
index 134b0082..56c3ec7d 100644
--- a/include/nana/gui/programming_interface.hpp
+++ b/include/nana/gui/programming_interface.hpp
@@ -1,7 +1,7 @@
/*
* Nana GUI Programming Interface Implementation
* Nana C++ Library(http://www.nanapro.org)
- * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
+ * Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@@ -117,6 +117,9 @@ namespace API
void lazy_refresh();
void draw_shortkey_underline(paint::graphics&, const std::string& text, wchar_t shortkey, std::size_t shortkey_position, const point& text_pos, const color&);
+
+ void window_draggable(window, bool enabled);
+ bool window_draggable(window);
}//end namespace dev
@@ -476,6 +479,8 @@ namespace API
::std::optional> content_extent(window wd, unsigned limited_px, bool limit_width);
unsigned screen_dpi(bool x_requested);
+
+ dragdrop_status window_dragdrop_status(::nana::window);
}//end namespace API
}//end namespace nana
diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp
index a2eee239..dde46edc 100644
--- a/include/nana/gui/widgets/listbox.hpp
+++ b/include/nana/gui/widgets/listbox.hpp
@@ -1497,6 +1497,9 @@ the nana::detail::basic_window member pointer scheme
void erase(index_pairs indexes); ///
+#include
+
+#include
+#include
+
+#include