Пример #1
0
 def eInit(self):
     edit.init(self)
     self.oldProjects = pickletest.loadAll()
     self.projectButtons = []
     for i in range(len(self.oldProjects)):
         project = self.oldProjects[i]
         y0 = self.height / 2 + 20
         x0 = self.width / 5
         space = 20
         maxProjectsX = 5
         maxProjectsY = 2
         width = ((self.width * 3 / 5) -
                  (space * (maxProjectsX - 1))) / maxProjectsX
         height = ((self.height / 2) -
                   (space * maxProjectsY)) / maxProjectsY
         x = x0 + i % maxProjectsX * (space + width)
         y = y0 if i < maxProjectsX else y0 + height + space
         rect = (x, y, width, height)
         text = project.scoreTitle
         button = Button(rect, text, (159, 182, 205))
         self.projectButtons.append(button)
     if len(self.oldProjects) == 0:
         text = "No Old Projects"
         button = Button((self.width / 4, 2 * self.height / 3,
                          self.width / 2, self.height / 4), text,
                         (198, 226, 255), 0, False)
         self.buttons.append(button)
 def eInit(self):
     edit.init(self)
     projects = pickletest.loadAll()
     self.projectButtons = []
     for i in range(len(projects)):
         project = projects[i]
         y0 = self.height/2 + 20
         x0 = self.width/5
         space = 20
         maxProjectsX = 5
         maxProjectsY = 2
         width = ((self.width*3/5) - (space*(maxProjectsX-1)))/maxProjectsX
         height = ((self.height/2) - (space*maxProjectsY))/maxProjectsY
         x = x0 + i%maxProjectsX*(space + width)
         y = y0 if i < maxProjectsX else y0 + height + space
         rect = (x, y, width, height)
         text = str(projects[i])
         # text = project.scoreTitle
         button = Button(rect, text, (40,50,60))
         self.projectButtons.append(button)
 def eInit(self):
     edit.init(self)
     projects = pickletest.loadAll()
     self.projectButtons = []
     for i in range(len(projects)):
         project = projects[i]
         y0 = self.height / 2 + 20
         x0 = self.width / 5
         space = 20
         maxProjectsX = 5
         maxProjectsY = 2
         width = ((self.width * 3 / 5) - (space * (maxProjectsX - 1))) / maxProjectsX
         height = ((self.height / 2) - (space * maxProjectsY)) / maxProjectsY
         x = x0 + i % maxProjectsX * (space + width)
         y = y0 if i < maxProjectsX else y0 + height + space
         rect = (x, y, width, height)
         text = str(projects[i])
         # text = project.scoreTitle
         button = Button(rect, text, (40, 50, 60))
         self.projectButtons.append(button)
Пример #4
0
 def eInit(self):
     edit.init(self)
     self.oldProjects = pickletest.loadAll()
     self.projectButtons = []
     for i in range(len(self.oldProjects)):
         project = self.oldProjects[i]
         y0 = self.height/2 + 20
         x0 = self.width/5
         space = 20
         maxProjectsX = 5
         maxProjectsY = 2
         width = ((self.width*3/5) - (space*(maxProjectsX-1)))/maxProjectsX
         height = ((self.height/2) - (space*maxProjectsY))/maxProjectsY
         x = x0 + i%maxProjectsX*(space + width)
         y = y0 if i < maxProjectsX else y0 + height + space
         rect = (x, y, width, height)
         text = project.scoreTitle
         button = Button(rect, text, (159,182,205))
         self.projectButtons.append(button)
     if len(self.oldProjects) == 0:
         text = "No Old Projects"
         button = Button((self.width/4, 2*self.height/3,self.width/2, self.height/4), text, (198,226,255), 0, False)
         self.buttons.append(button)