Ejemplo n.º 1
0
    def addCard(self, attr, ctrl, ctrlArgs, pageStr, descKey):
        panel = wxScrolledPanel(self, -1)
        panel.setSpecialtyLbl = self.updateSpecialtyLabel
        szr = wxBoxSizer(wxVERTICAL)
        self.addSectionHeaderToSizer(panel, szr, pageStr.upper())

        # For the Specialty Card add a label to szr that will take
        #  the name of the specialty move
        if attr == "specialtyCard":
            self.specialtyCardLbl = boldLabel("", panel)
            self.specialtyCardLbl.theParent = panel
            szr.Add((0, 10))
            self.addToPageSizer(self.specialtyCardLbl, szr)
            szr.Add((0, 10))
            
        args = [panel] + ctrlArgs
        setattr(self, attr, ctrl(*args))
        getattr(self, attr).tag = pageStr 
        winSzr = getattr(self, attr).szr        
        self.addToPageSizer(winSzr, szr)
        szr.Add((0, 20))
        self.addToPageSizer(wxStaticLine(panel, -1), szr)
        szr.Add((0, 10))
        pageDesc = formattedStrings[descKey]
        descLbl = getFixedWidthLabel(panel, pageDesc)
        self.addToPageSizer(descLbl, szr, wxALIGN_CENTER)
        self.addPanelToPage(panel, szr, pageStr)
Ejemplo n.º 2
0
    def addBasicInfoTab(self):
        self.biPanel = wxScrolledPanel(self, -1)
        szr = wxBoxSizer(wxVERTICAL)
        self.addSectionHeaderToSizer(self.biPanel, szr,
                                     "BASIC WRESTLER INFORMATION")
        szr.Add((0, 5))

        # Name label and entry widget
        nameSzr = wxBoxSizer(wxHORIZONTAL)
        namelbl = wxStaticText(self.biPanel, -1, "Wrestler Name")
        namelbl.SetForegroundColour("FOREST GREEN")
        font = namelbl.GetFont()
        font.SetWeight(wxBOLD)
        namelbl.SetFont(font)
        nameSzr.Add(namelbl, 0, wxALIGN_RIGHT|wxST_NO_AUTORESIZE)
        nameSzr.Add((5, 0))
        self.nameCtrl = wxTextCtrl(self.biPanel, -1, "", size=(300, -1))
        EVT_TEXT(self.nameCtrl, self.nameCtrl.GetId(),
                 self.parentWin.updateName)
        nameSzr.Add(self.nameCtrl, 0, wxALIGN_LEFT)
        self.addToPageSizer(nameSzr, szr)
        szr.Add((0, 20))

        # Submission Range label and entry widgets
        self.subRow = TwoValueRow(self.biPanel, "SUBMISSION RANGE:",
                                  self.validateRange, size=(150, -1),
                                  evt_macro=EVT_KILL_FOCUS)
        subRangeDesc = formattedStrings["SUBMISSION_RANGE_DESCRIPTION"]
        self.addTwoValueRowToSizer(self.biPanel, self.subRow.szr, szr,
                                   subRangeDesc)

        # Tag Team Range label and entry widgets
        self.tagTeamRow = TwoValueRow(self.biPanel, "TAG TEAM RANGE:",
                                  self.validateRange, size=(150, -1),
                                      evt_macro=EVT_KILL_FOCUS)
        tagRangeDesc = formattedStrings["TAG_TEAM_RANGE_DESCRIPTION"]
        self.addTwoValueRowToSizer(self.biPanel, self.tagTeamRow.szr, szr,
                                   tagRangeDesc)

        # Priority label and entry widgets
        self.priorityRow = TwoValueRow(self.biPanel, "PRIORITY:",
                                       self.validatePriority,
                                       v1Str="Singles", v2Str="Tag Team",
                                       size=(150, -1))
        
        priDesc = formattedStrings["PRIORITIES_DESCRIPTION"]
        self.addTwoValueRowToSizer(self.biPanel, self.priorityRow.szr, szr,
                                   priDesc)

        # Name of the set this wrestler belongs to
        szr.Add(wxStaticLine(self.biPanel, -1), 0, wxEXPAND)
        szr.Add((0, 5))
        self.addToPageSizer(self.getLblAndTextCtrl("Set Name",
                                                   "nameSetCtrl",
                                                   lambda e: self.parentWin.setDirty()),
                                                   szr)

        self.addPanelToPage(self.biPanel, szr, "Basic Info")