def setUp(self): self.frame.getItemParentHasExclusiveChildren = lambda item: item.subject( ).startswith('mutual') super(CheckTreeCtrlTest, self).setUp() columns = [widgets.Column('subject', 'Subject')] self.treeCtrl = widgets.CheckTreeCtrl(self.frame, columns, self.onSelect, self.onCheck, dummy.DummyUICommand(), dummy.DummyUICommand()) self.mutual1 = DummyDomainObject('mutual 1') self.mutual2 = DummyDomainObject('mutual 2')
def createWidget(self): imageList = self.createImageList() # Has side-effects self._columns = self._createColumns() itemPopupMenu = self.createCategoryPopupMenu() columnPopupMenu = menu.ColumnPopupMenu(self) self._popupMenus.extend([itemPopupMenu, columnPopupMenu]) widget = widgets.CheckTreeCtrl( self, self._columns, self.onSelect, self.onCheck, uicommand.Edit(viewer=self), uicommand.CategoryDragAndDrop(viewer=self, categories=self.presentation()), itemPopupMenu, columnPopupMenu, **self.widgetCreationKeywordArguments()) widget.AssignImageList(imageList) # pylint: disable=E1101 return widget