ultimatepp/bazaar/XMLMenu/DragWindow.h
micio 38738cab41 Bazaar/XMLMenu : fixed for GTK
git-svn-id: svn://ultimatepp.org/upp/trunk@12195 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2018-08-26 17:11:16 +00:00

59 lines
1.1 KiB
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(flagX11)
virtual void EventProc(XWindow& w, XEvent *event);
#elif defined(flagGTK)
gulong handlerId;
GtkWindow *gtkWindow;
void connectInternalHandler(void);
static gboolean DragWindowGtkEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data);
virtual void EventProc(GdkEvent *event);
#endif
// handler for window drag events
virtual void WindowDragged(DragEvent e, Point p);
public:
DragWindow();
~DragWindow();
};
END_UPP_NAMESPACE
#endif