Esempio n. 1
0
 def reset(self):
     """Just to make it more readable or understandable
     """
     for id in AMI.getIDs():
         self.setValue(id, "")
Esempio n. 2
0
    def addCtrls(self, type=REL_LABEL[OTHER_REL], label="", primary=False):
        pa = wx.StaticText(self, -1, AMI.getLabel("PA"))
        self.pa = wx.TextCtrl(self, -1, size=(200, -1), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER) 
        self.pa.SetToolTipString(AMI.getHelp("PA"))
        self.pa.SetFocus()

        ty = wx.StaticText(self, -1, AMI.getLabel("TY"))
        self.ty = wx.Choice(self, -1, (-1, -1), choices = self.types)
        self.ty.SetToolTipString(AMI.getHelp("TY"))

        pr = wx.StaticText(self, -1, AMI.getLabel("PR"))
        self.pr = wx.CheckBox(self, -1 )
        self.pr.SetToolTipString(AMI.getHelp("PR"))

        ag = wx.StaticText(self, -1, AMI.getLabel("AG"))
        self.ag = wx.TextCtrl(self, -1, "", size=(170, -1))
        self.ag.SetToolTipString(AMI.getHelp("AG"))

        st = wx.StaticText(self, -1, AMI.getLabel("ST"))
        self.st = wx.TextCtrl(self, -1, "", size=(-1, -1))
        self.st.SetToolTipString(AMI.getHelp("ST"))

        po = wx.StaticText(self, -1, AMI.getLabel("PO"))
        self.po = wx.TextCtrl(self, -1, "", size=(-1, -1))
        self.po.SetToolTipString(AMI.getHelp("PO"))

        mc = wx.StaticText(self, -1, AMI.getLabel("MC"))
        self.mc = wx.Choice(self, -1, (-1, -1), choices = self.mailClasses)
        self.mc.SetToolTipString(AMI.getHelp("MC"))

        hn = wx.StaticText(self, -1, AMI.getLabel("HN"))
        self.hn = wx.TextCtrl(self, -1, "", size=(170, -1))
        self.hn.SetToolTipString(AMI.getHelp("HN"))

        nh = wx.StaticText(self, -1, AMI.getLabel("NH"))
        self.nh = wx.TextCtrl(self, -1, "", size=(170, -1))
        self.nh.SetToolTipString(AMI.getHelp("NH"))

        re = wx.StaticText(self, -1, AMI.getLabel("RE"))
        self.re = wx.TextCtrl(self, -1, "", size=(170, -1))
        self.re.SetToolTipString(AMI.getHelp("RE"))

        pc = wx.StaticText(self, -1, AMI.getLabel("PC"))
        self.pc = wx.TextCtrl(self, -1, "", size=(-1, -1))
        self.pc.SetToolTipString(AMI.getHelp("PC"))

        ci = wx.StaticText(self, -1, AMI.getLabel("CI"))
        self.ci = wx.TextCtrl(self, -1, "", size=(-1, -1))
        self.ci.SetToolTipString(AMI.getHelp("CI"))

        sr = wx.StaticText(self, -1, AMI.getLabel("SR"))
        self.sr = wx.TextCtrl(self, -1, "", size=(170, -1))
        self.sr.SetToolTipString(AMI.getHelp("SR"))

        co = wx.StaticText(self, -1, AMI.getLabel("CO"))
        self.co = CountryChoice(self)
        self.co.SetToolTipString(AMI.getHelp("CO"))

        la = wx.StaticText(self, -1, AMI.getLabel("LA"))
        self.la = wx.TextCtrl(self, -1, "", size=(200, -1))
        self.la.SetToolTipString(AMI.getHelp("LA"))

        us = wx.StaticText(self, -1, AMI.getLabel("US"))
        self.us = wx.Choice(self, -1, (-1, -1), choices = self.mailUsage)
        self.us.SetToolTipString(AMI.getHelp("US"))

        self.updateB = wx.Button(self, 10, self.updateLabel["add"], (50, -1))
        self.deleteB = wx.Button(self, 20, "Delete", (50, -1))
        self.disableDeleteButton()

        # On my system the GridBagSizer did not run stable so I switched to 
        # the RowColSizer.
        formSizer = rcsizer.RowColSizer()

        formSizer.Add(pa,        row=0, col=1, flag=wx.ALIGN_LEFT)
        formSizer.Add(la,        row=4, col=1, flag=wx.ALIGN_LEFT )

        formSizer.AddSpacer(6,6, row=1, col=2)

        formSizer.Add(self.pa,   row=0, col=3, rowspan=4, flag=wx.EXPAND)
        formSizer.Add(self.la,   row=4, col=3, flag=wx.ALL)

        formSizer.AddSpacer(6,6, row=2, col=4)

        formSizer.Add(st,        row=0, col=5, flag=wx.ALIGN_LEFT)
        formSizer.Add(pc,        row=1, col=5, flag=wx.ALIGN_LEFT)
        formSizer.Add(po,        row=2, col=5, flag=wx.ALIGN_LEFT)
        formSizer.Add(ty,        row=3, col=5, flag=wx.ALIGN_LEFT)
        formSizer.Add(mc,        row=4, col=5, flag=wx.ALIGN_LEFT)

        formSizer.AddSpacer(6,6, row=2, col=6)

        formSizer.Add(self.st,   row=0, col=7, colspan=5, flag=wx.EXPAND)
        formSizer.Add(self.pc,   row=1, col=7, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.po,   row=2, col=7, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.ty,   row=3, col=7, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.mc,   row=4, col=7, flag=wx.ALIGN_LEFT)

        formSizer.AddSpacer(6,6, row=2, col=8)

        formSizer.Add(ci,        row=1, col=9, flag=wx.ALIGN_LEFT)
        formSizer.Add(co,        row=2, col=9, flag=wx.ALIGN_LEFT)
        formSizer.Add(us,        row=3, col=9, flag=wx.ALIGN_LEFT)
        formSizer.Add(pr,        row=4, col=9, flag=wx.ALIGN_LEFT)

        formSizer.AddSpacer(6,6, row=2, col=10)

        formSizer.Add(self.ci,   row=1, col=11, flag=wx.EXPAND)
        formSizer.Add(self.co,   row=2, col=11, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.us,   row=3, col=11, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.pr,   row=4, col=11, flag=wx.ALIGN_LEFT)

        formSizer.AddSpacer(6,6, row=1, col=12)

        formSizer.Add(hn,        row=0, col=13, flag=wx.ALIGN_LEFT)
        formSizer.Add(nh,        row=1, col=13, flag=wx.ALIGN_LEFT)
        formSizer.Add(re,        row=2, col=13, flag=wx.ALIGN_LEFT)
        formSizer.Add(sr,        row=3, col=13, flag=wx.ALIGN_LEFT)
        formSizer.Add(ag,        row=4, col=13, flag=wx.ALIGN_LEFT)

        formSizer.AddSpacer(6,6, row=1, col=14)

        formSizer.Add(self.hn,   row=0, col=15, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.nh,   row=1, col=15, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.re,   row=2, col=15, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.sr,   row=3, col=15, flag=wx.ALIGN_LEFT)
        formSizer.Add(self.ag,   row=4, col=15, flag=wx.ALIGN_LEFT)

        bBox = wx.BoxSizer(wx.HORIZONTAL)
        bBox.Add(self.deleteB)
        bBox.Add(self.updateB)

        formSizer.Add(bBox, row=5, col=15, flag=wx.ALL | wx.ALIGN_RIGHT)
        self.SetSizer(formSizer)