summaryrefslogtreecommitdiff
path: root/ui/mouse_move_dlg.h
blob: 9d68845dcf1bad29a2591d9e99e62d6052da1ad5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// **************************************************************************
// * This file is part of the FreeFileSync project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl.html       *
// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de)                    *
// **************************************************************************
//
#ifndef MOUSEMOVEWINDOW_H_INCLUDED
#define MOUSEMOVEWINDOW_H_INCLUDED

#include <wx/window.h>

namespace ffs3
{

//move main dialog by mouse-dragging contained sub-windows:
//----------------------------------------------------------------------------------------
//keep it as an attribute of the to-be-moved dialog and ensure that all connected source windows
//have a longer lifetime than the dialog which is moved (should be fulfilled naturally)
class MouseMoveWindow : private wxEvtHandler
{
public:
    MouseMoveWindow(wxWindow* dialogToMove) :
        dialogToMove_(dialogToMove) {}

    void connectSourceWindow(wxWindow* sourceWindow);

private:
    void LeftButtonDown(wxMouseEvent& event);

    wxWindow* dialogToMove_;
};

}


#endif // MOUSEMOVEWINDOW_H_INCLUDED
bgstack15