def __init__(self, parent, pos=0, label=None): # XXX unify with EditBase.__init__ ? assert isinstance(pos, int) assert not parent.IS_SLOT np.PropertyOwner.__init__(self) # initialise instance logger self._logger = logging.getLogger(self.__class__.__name__) self.klass = self.classname = "slot" self.label = label # initialise instance properties self.widget = None # Reference to the widget resembling the slot (a wx.Window) self._dont_destroy = False # for notebook pages, this will be set to True self.name = "SLOT" self.overlapped = False # for spanning in GridBagSizer self.item = None # initialise structure self.parent = parent self.children = None self.parent.add_item(self, pos) self.pos = np.LayoutPosProperty(pos) # position within the sizer or 0 # the following are just set to use the same Add call as with widgets self.proportion = 1 self.span = (1, 1) self.flag = wx.EXPAND self.border = 0
def __init__(self, name, klass, parent, id, sizer, pos): WindowBase.__init__(self, name, klass, parent, id) # if True, the user is able to control the layout of the widget # inside the sizer (proportion, borders, alignment...) self._has_layout = not sizer.is_virtual() # attributes to keep the values of the sizer properties self.pos = np.LayoutPosProperty(pos) # position within the sizer, 1-based self.span = np.LayoutSpanProperty((1,1)) # cell spanning for GridBagSizer self.proportion = np.LayoutProportionProperty(0) # item growth in sizer main direction self.border = np.SpinProperty(0, immediate=True) # border width self.flag = np.ManagedFlags(wx.ADJUST_MINSIZE) # alignment, border; expansion in other dir. self.sizer = sizer sizer.add_item(self, pos)