Dart Documentationdock_spawnResizableContainer

ResizableContainer Class

Decorates a dock container with resizer handles around its base element This enables the container to be resized from all directions

Implements

IDockContainer

Constructors

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

ResizableContainer(this.dialog, this.delegate, this.topLevelElement) {
  containerType = delegate.containerType;
  topLevelElement.style.marginLeft = "${topLevelElement.$dom_offsetLeft}";
  topLevelElement.style.marginTop = "${topLevelElement.$dom_offsetTop}";
  _buildResizeHandles();
}

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(ResizeHandle handle, MouseEvent event) #

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

  window.document.body.classes.add("disable-selection");
}

Code void onMouseMoved(ResizeHandle handle, MouseEvent e) #

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

Code void onMouseUp(ResizeHandle handle, MouseEvent event) #

void onMouseUp(ResizeHandle handle, MouseEvent event) {
  window.on.mouseMove.remove(handle.mouseMoveHandler);
  window.on.mouseUp.remove(handle.mouseUpHandler);

  window.document.body.classes.remove("disable-selection");
}

Code void performLayout(List<IDockContainer> children) #

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

Code void removeDecorator() #

void removeDecorator() {
  
}

Code void resize(int _width, int _height) #

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

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 Point2 dragOffset #

Point2 dragOffset;

Code Point2 previousMousePosition #

Point2 previousMousePosition;

Code List<ResizeHandle> resizeHandles #

List<ResizeHandle> resizeHandles;

Code Element topLevelElement #

Element topLevelElement;