From 4880851f132fc3874c5bb01db2f68bc66320063c Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 2 May 2004 21:26:07 +0000 Subject: movetest --- src/tests/movetest.cc | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/tests/movetest.cc diff --git a/src/tests/movetest.cc b/src/tests/movetest.cc new file mode 100644 index 0000000..7db0c39 --- /dev/null +++ b/src/tests/movetest.cc @@ -0,0 +1,83 @@ +#include + +#include "../FbTk/FbWindow.hh" +#include "../FbTk/App.hh" +#include "../FbTk/EventManager.hh" +#include "../FbTk/EventHandler.hh" +#include "../FbTk/Color.hh" + +using namespace std; +using namespace FbTk; + +class Ev: public EventHandler { +public: + Ev():m_window(0, + 0, 0, + 512, 512, + ExposureMask | ButtonPressMask | + ButtonReleaseMask | ButtonMotionMask | SubstructureRedirectMask), + m_drag(m_window, + 0, 0, + 32, 32, + + ExposureMask) { /* | ButtonPressMask) { + ButtonReleaseMask | ButtonMotionMask) { + */ + m_window.setName("hello"); + m_window.show(); + m_drag.setBackgroundColor(Color("blue", 0)); + m_drag.show(); + EventManager::instance()->add(*this, m_window); + EventManager::instance()->add(*this, m_drag); + drag = false; + } + + void exposeEvent(XExposeEvent &event) { + m_drag.clear(); + m_window.clear(); + } + + void buttonPressEvent(XButtonEvent &event) { + if (m_drag != event.subwindow) + return; + + cerr<<"drag!"<