[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Moving Composites

hello,

i have a composite on which i want to place other panel-composites and be able to move these panels on the parent-composite around.

hooking inside these panel-composites:

static class MyMouseMoveListener implements MouseMoveListener {
		public void mouseMove(MouseEvent e) {
			System.out.println("MOVE!");
		}
	}

mml = new MyMouseMoveListener();
// registering into parent to get absolute mouse positions
parent.addMouseMoveListener(mml);

addListener(SWT.DragDetect, new Listener() {
			public void handleEvent(Event e) {
				
				System.out.println("START");
				//parent.addMouseMoveListener(mml);
				isMoving = true;
			}
		});

addListener(SWT.MouseUp, new Listener() {
			public void handleEvent(Event event) {
				
				System.out.println("STOP");
				//parent.removeMouseMoveListener(mml);
				isMoving = false;
			}
		});

the output in the console is the following:
MOVE!Point {213, 234}
MOVE!Point {213, 234}
START
STOP
MOVE!Point {244, 241}
MOVE!Point {244, 241}

no events between dragging and stopping to drag .......why??
any advice on how to properly make composites moveable?

thanks,
kai