Dart Documentationdock_spawnDraggableContainer

DraggableContainer Class

Implements

IDockContainer

Constructors

Code new DraggableContainer(Dialog dialog, IDockContainer delegate, Element topLevelElement, Element dragHandle) #

DraggableContainer(this.dialog, this.delegate, this.topLevelElement, this.dragHandle) {
  containerType = delegate.containerType;
  
  mouseDownHandler = onMouseDown;
  mouseUpHandler = onMouseUp;
  mouseMoveHandler = onMouseMove;
  
  dragHandle.on.mouseDown.add(mouseDownHandler);
  topLevelElement.style.marginLeft = "${topLevelElement.$dom_offsetLeft}";
  topLevelElement.style.marginTop = "${topLevelElement.$dom_offsetTop}";
}

Methods

Code Element get containerElement() #

Element get containerElement() {
  return delegate.containerElement;
}

Code void destroy() #

void destroy() {
  removeDecorator();
  delegate.destroy();
}

Code int get height() #

int get height() {
  return delegate.height;
}

Code void loadState(Map<String, Object> state) #

void loadState(Map<String, Object> state) {
  delegate.loadState(state);
}

Code int get minimumAllowedChildNodes() #

int get minimumAllowedChildNodes() { return delegate.minimumAllowedChildNodes; }

Code String get name() #

String get name() {
  return delegate.name;
}

Code void set name(String value) #

void set name(String value) {
  delegate.name = value;
}

Code void onMouseDown(MouseEvent event) #

void onMouseDown(MouseEvent event) {
  _startDragging(event);
  previousMousePosition = new Point2(event.pageX, event.pageY);
  window.on.mouseMove.add(mouseMoveHandler);
  window.on.mouseUp.add(mouseUpHandler);
}

Code void onMouseMove(MouseEvent event) #

void onMouseMove(MouseEvent event) {
  Point2 currentMousePosition = new Point2(event.pageX, event.pageY);
  int dx = (currentMousePosition.x - previousMousePosition.x).toInt();
  int dy = (currentMousePosition.y - previousMousePosition.y).toInt();
  _performDrag(dx, dy);
  previousMousePosition = currentMousePosition; 
}

Code void onMouseUp(MouseEvent event) #

void onMouseUp(MouseEvent event) {
  _stopDragging(event);
  window.on.mouseMove.remove(mouseMoveHandler);
  window.on.mouseUp.remove(mouseUpHandler);
}

Code void performLayout(List<IDockContainer> children) #

void performLayout(List<IDockContainer> children) {
  delegate.performLayout(children);
}

Code void removeDecorator() #

void removeDecorator() {
  dragHandle.on.mouseDown.remove(mouseDownHandler);
}

Code void resize(int _width, int _height) #

void resize(int _width, int _height) {
  delegate.resize(_width, _height);
}

Code void saveState(Map<String, Object> state) #

void saveState(Map<String, Object> state) {
  delegate.saveState(state);
}

Code void setActiveChild(IDockContainer child) #

void setActiveChild(IDockContainer child) {
}

Code int get width() #

int get width() {
  return delegate.width;
}

Fields

Code String containerType #

String containerType;

Code IDockContainer delegate #

IDockContainer delegate;

Code Dialog dialog #

Dialog dialog;

Code Element dragHandle #

Element dragHandle;

Code Point2 dragOffset #

Point2 dragOffset;

Code DialogEventListener eventListener #

DialogEventListener eventListener;

Code var mouseDownHandler #

var mouseDownHandler;

Code var mouseMoveHandler #

var mouseMoveHandler;

Code var mouseUpHandler #

var mouseUpHandler;

Code Point2 previousMousePosition #

Point2 previousMousePosition;

Code Element topLevelElement #

Element topLevelElement;