def __init__(self, parent, ID, table, row, col, title="Edit Group Membership"): wx.Dialog.__init__(self, parent, ID, title, style=wx.DEFAULT_DIALOG_STYLE #| wx.RESIZE_BORDER ) # read panel and get important controlers for convenience self.panel = xrcl.loadPanel(self, "groupcelleditor.xrc", "groupcelleditor") self.lb = xrcl.getControl(self.panel, "chkgroupbox") self.groups = DlgGroupData() self.groups.initialize(table, row, col) self.populateGroupList() self.binEvents() space = 5 self.topSizer = wx.BoxSizer(wx.VERTICAL) self.topSizer.Add(self.panel, 1, wx.EXPAND, space) self.SetSizer(self.topSizer) self.topSizer.Fit(self) self.ShowModal()
def __init__(self, parent, ID=-1, title="Manage Groups"): wx.Dialog.__init__(self, parent, ID, title, style=wx.DEFAULT_DIALOG_STYLE #| wx.RESIZE_BORDER ) self.idx = -1 # s = system groups, p = private groups s, p = domaindata.get_group_names() self.sg = Groups(s) self.pg = Groups(p) self.panel = xrcl.loadPanel(self, "groupeditor.xrc", "groupeditor") self.glc = xrcl.getControl(self.panel, "grplstctrl") self.gnc = xrcl.getControl(self.panel, "grpname") self.uab = xrcl.getControl(self.panel, "upaddbutton") self.uab.SetLabel(LABEL_ADD) self.deb = xrcl.getControl(self.panel, "delbutton") self.deb.SetLabel(LABEL_DEL) self.populateForm() space = 5 self.topSizer = wx.BoxSizer(wx.VERTICAL) self.topSizer.Add(self.panel, 1, wx.EXPAND, space) self.SetSizer(self.topSizer) self.topSizer.Fit(self) self.binEvents() self.ShowModal()
def binEvents(self): xrcl.getControl(self.panel, "wxID_OK").Bind(wx.EVT_BUTTON, self.onOk)
def binEvents(self): xrcl.getControl(self.panel, "wxID_OK").Bind(wx.EVT_BUTTON, self.onOk) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected, self.glc) self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.onItemDeselected, self.glc) self.Bind(wx.EVT_BUTTON, self.onAddOrUpdate, self.uab) self.Bind(wx.EVT_BUTTON, self.onDelete, self.deb)
def __init__(self, parent, ID, table, row, col, title="Edit Organization"): wx.Dialog.__init__(self, parent, ID, title, style=wx.DEFAULT_DIALOG_STYLE #| wx.RESIZE_BORDER ) self.table = table self.row = row self.col = col self.types = ["", REL_LABEL[WORK_REL], REL_LABEL[OTHER_REL]] # read panel and get important controlers for convenience self.panel = xrcl.loadPanel(self, "orgeditor.xrc", "orgeditor") self.cnam = xrcl.getControl(self.panel, "cn") self.cdep = xrcl.getControl(self.panel, "cd") self.ctit = xrcl.getControl(self.panel, "ct") self.cjob = xrcl.getControl(self.panel, "cj") self.cwhe = xrcl.getControl(self.panel, "cw") self.clab = xrcl.getControl(self.panel, "cl") self.ctyp = xrcl.getControl(self.panel, "cr") self.csym = xrcl.getControl(self.panel, "cs") self.cpri = xrcl.getControl(self.panel, "cp") # Setup/customize form if not orgf.hasWhere(): # disable if not present self.ctyp.SetItems(items=self.types) xrcl.getControl(self.panel, "lw").Hide() self.cwhe.Hide() xrcl.getControl(self.panel, "wxID_OK").Bind(wx.EVT_BUTTON, self.onOk) self.populateForm() space = 5 self.topSizer = wx.BoxSizer(wx.VERTICAL) self.topSizer.Add(self.panel, 1, wx.EXPAND, space) self.SetSizer(self.topSizer) self.topSizer.Fit(self) self.ShowModal()