Example #1
0
    def addCtrls(self, type=PHONE_TYPE[OTHER_REL], label="", primary=False):
        nr = wx.StaticText(self, -1, PMI.getLabel(PID_NUMBER))
        self.nr = wx.TextCtrl(self, -1, size=(150, -1))
        self.nr.SetToolTipString(PMI.getHelp(PID_NUMBER))
        self.nr.SetFocus()
        
        la = wx.StaticText(self, -1, PMI.getLabel(PID_LABEL))
        self.la = wx.TextCtrl(self, -1, size=(150, -1))
        self.la.SetToolTipString(PMI.getHelp(PID_LABEL))

        ur = wx.StaticText(self, -1, PMI.getLabel(PID_URI))
        self.ur = wx.TextCtrl(self, -1, size=(150, -1))
        self.ur.SetToolTipString(PMI.getHelp(PID_URI))

        pr = wx.StaticText(self, -1, PMI.getLabel(PID_PRIMARY))
        self.pr = wx.CheckBox(self, -1 )
        self.pr.SetToolTipString(PMI.getHelp(PID_PRIMARY))

        ty = wx.StaticText(self, -1, PMI.getLabel(PID_TYPE))
        self.ty = wx.Choice(self, -1, (-1, -1), choices = self.types)
        self.ty.SetToolTipString(PMI.getHelp(PID_TYPE))

        self.updateB = wx.Button(self, 10, self.updateLabel["add"], (50, -1))
        self.deleteB = wx.Button(self, 20, "Delete", (50, -1))
        self.disableDeleteButton()
        
        # formSizer = wx.FlexGridSizer(rows=3, cols=5, vgap=6, hgap=6)
        formSizer = rcsizer.RowColSizer()
        formSizer.Add(nr,           row=0, col=0, flag=wx.ALIGN_LEFT)
        formSizer.AddSpacer(6,6,    row=0, col=1)
        formSizer.Add(self.nr,      row=0, col=2, flag=wx.EXPAND)
        formSizer.AddSpacer(6,6,    row=0, col=3)
        formSizer.Add(ty,           row=0, col=4, flag=wx.ALIGN_LEFT)
        formSizer.AddSpacer(6,6,    row=0, col=5)
        formSizer.Add(self.ty,      row=0, col=6)
        formSizer.AddSpacer(6,6,    row=0, col=7)
        formSizer.Add(self.updateB, row=0, col=8, flag= wx.ALIGN_RIGHT)

        formSizer.Add(la,           row=1, col=0, flag=wx.ALIGN_LEFT)
        formSizer.AddSpacer(6,6,    row=1, col=1)
        formSizer.Add(self.la,      row=1, col=2, flag=wx.EXPAND)
        formSizer.AddSpacer(6,6,    row=1, col=3)
        formSizer.Add(pr,           row=1, col=4, flag=wx.ALIGN_LEFT)
        formSizer.AddSpacer(6,6,    row=1, col=5)
        formSizer.Add(self.pr,      row=1, col=6, flag=wx.ALIGN_LEFT)
        formSizer.AddSpacer(6,6,    row=1, col=7)
        formSizer.Add(self.deleteB, row=1, col=8, flag= wx.ALIGN_LEFT)

        formSizer.Add(ur,           row=2, col=0, flag=wx.ALIGN_LEFT)
        formSizer.AddSpacer(6,6,    row=2, col=1)
        formSizer.Add(self.ur,      row=2, col=2, flag=wx.EXPAND)

        self.SetSizer(formSizer)
Example #2
0
 def reset(self):
     """Just to make it more readable or understandable
     """
     for id in PMI.getIDs():
         self.setValue(id, "")