ultimatepp/bazaar/XMLMenu/DragWindow.h
micio 31599d99f3 sandbox/XMLMenu moved to bazaar
git-svn-id: svn://ultimatepp.org/upp/trunk@4070 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-10-20 10:38:46 +00:00

55 lines
882 B
C++

#ifndef _DragWindow_h_
#define _DragWindow_h_
#include <CtrlCore/CtrlCore.h>
NAMESPACE_UPP
// a window that can react to dragging events
// i.e. report moves of itself to an handler
class DragWindow : public TopWindow
{
public:
typedef enum { DRAG_START, DRAG_DRAG, DRAG_END } DragEvent;
private:
// dragging flag
bool dragging;
#ifdef PLATFORM_WIN32
bool sizeMoving;
#endif
// position and size of dragged window
int x, y;
int width, height;
protected:
#ifdef PLATFORM_WIN32
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
#elif defined(PLATFORM_X11)
virtual void EventProc(XWindow& w, XEvent *event);
#else
#error("Unsupported platform")
#endif
// handler for window drag events
virtual void WindowDragged(DragEvent e, Point p);
public:
DragWindow();
~DragWindow();
};
END_UPP_NAMESPACE
#endif