def __init__(self, sink): SimplePanel.__init__(self) self.sink = sink self.caption = HTML() self.child = None self.showing = False self.dragging = False self.dragStartX = 0 self.dragStartY = 0 self.panel = FlexTable() self.collapse = Image("./images/cancel.png") self.collapse.addClickListener(self) dock = DockPanel() dock.setSpacing(0) dock.add(self.collapse, DockPanel.EAST) dock.add(self.caption, DockPanel.WEST) dock.setCellHorizontalAlignment(self.collapse, HasAlignment.ALIGN_RIGHT) dock.setCellVerticalAlignment(self.collapse, HasAlignment.ALIGN_TOP) dock.setCellHorizontalAlignment(self.caption, HasAlignment.ALIGN_LEFT) dock.setCellWidth(self.caption, "100%") dock.setWidth("100%") dock.setHeight("100%") self.panel.setWidget(0, 0, dock) self.panel.setHeight("100%") self.panel.setWidth("100%") self.panel.setBorderWidth(0) self.panel.setCellPadding(0) self.panel.setCellSpacing(0) self.panel.getCellFormatter().setHeight(1, 0, "100%") self.panel.getCellFormatter().setWidth(1, 0, "100%") self.panel.getCellFormatter().setAlignment( 1, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP) SimplePanel.setWidget(self, self.panel) self.setStyleName("gwt-DialogBox") self.caption.setStyleName("Caption") self.collapse.setStyleName("Close") dock.setStyleName("Header") #self.caption.addMouseListener(self) self.collapsed = False self.collapsed_width = "15px" self.uncollapsed_width = "100%"
def __init__(self, sink): SimplePanel.__init__(self) self.sink = sink self.caption = HTML() self.child = None self.showing = False self.dragging = False self.dragStartX = 0 self.dragStartY = 0 self.panel = FlexTable() self.collapse = Image("./images/cancel.png") self.collapse.addClickListener(self) dock = DockPanel() dock.setSpacing(0) dock.add(self.collapse, DockPanel.EAST) dock.add(self.caption, DockPanel.WEST) dock.setCellHorizontalAlignment(self.collapse, HasAlignment.ALIGN_RIGHT) dock.setCellVerticalAlignment(self.collapse, HasAlignment.ALIGN_TOP) dock.setCellHorizontalAlignment(self.caption, HasAlignment.ALIGN_LEFT) dock.setCellWidth(self.caption, "100%") dock.setWidth("100%") dock.setHeight("100%") self.panel.setWidget(0, 0, dock) self.panel.setHeight("100%") self.panel.setWidth("100%") self.panel.setBorderWidth(0) self.panel.setCellPadding(0) self.panel.setCellSpacing(0) self.panel.getCellFormatter().setHeight(1, 0, "100%") self.panel.getCellFormatter().setWidth(1, 0, "100%") self.panel.getCellFormatter().setAlignment(1, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP) SimplePanel.setWidget(self, self.panel) self.setStyleName("gwt-DialogBox") self.caption.setStyleName("Caption") self.collapse.setStyleName("Close") dock.setStyleName("Header") #self.caption.addMouseListener(self) self.collapsed = False self.collapsed_width = "15px" self.uncollapsed_width = "100%"