add move-constructor and move-assignment for class dragger
This commit is contained in:
parent
70ecce5962
commit
57303d302c
@ -1,6 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* A Dragger Implementation
|
||||||
|
* Nana C++ Library(http://www.nanapro.org)
|
||||||
|
* Copyright(C) 2003-2016 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/dragger.hpp
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef NANA_GUI_DRAGGER_HPP
|
#ifndef NANA_GUI_DRAGGER_HPP
|
||||||
#define NANA_GUI_DRAGGER_HPP
|
#define NANA_GUI_DRAGGER_HPP
|
||||||
#include "programming_interface.hpp"
|
#include "basis.hpp"
|
||||||
|
#include "../basic_types.hpp"
|
||||||
|
#include "../traits.hpp"
|
||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
@ -18,6 +32,10 @@ namespace nana
|
|||||||
public:
|
public:
|
||||||
dragger();
|
dragger();
|
||||||
~dragger();
|
~dragger();
|
||||||
|
|
||||||
|
dragger(dragger&&);
|
||||||
|
dragger& operator=(dragger&&);
|
||||||
|
|
||||||
void target(window);
|
void target(window);
|
||||||
void target(window, const rectangle& restrict_area, nana::arrange);
|
void target(window, const rectangle& restrict_area, nana::arrange);
|
||||||
void remove_target(window);
|
void remove_target(window);
|
||||||
|
|||||||
@ -1,5 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* A Dragger Implementation
|
||||||
|
* Nana C++ Library(http://www.nanapro.org)
|
||||||
|
* Copyright(C) 2003-2016 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/dragger.cpp
|
||||||
|
*/
|
||||||
|
|
||||||
#include <nana/gui/dragger.hpp>
|
#include <nana/gui/dragger.hpp>
|
||||||
|
#include <nana/gui/programming_interface.hpp>
|
||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
@ -180,6 +192,23 @@ namespace nana
|
|||||||
delete impl_;
|
delete impl_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dragger::dragger(dragger&& other)
|
||||||
|
: impl_(other.impl_)
|
||||||
|
{
|
||||||
|
other.impl_ = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
dragger& dragger::operator=(dragger&& other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
|
{
|
||||||
|
delete impl_;
|
||||||
|
impl_ = other.impl_;
|
||||||
|
other.impl_ = nullptr;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
void dragger::target(window wd)
|
void dragger::target(window wd)
|
||||||
{
|
{
|
||||||
impl_->drag_target(wd, rectangle(), nana::arrange::horizontal_vertical);
|
impl_->drag_target(wd, rectangle(), nana::arrange::horizontal_vertical);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user