def pressPopups(self, x, y): if self.popUpup.type == "Yes/No": if self.popUpup.button == '<--': if self.popUpup.whatPressed(x, y) == "Yes": pickletest.saveProject(self.project) self.init() elif self.popUpup.whatPressed(x, y) == "No": self.init() elif self.popUpup.button == "title": if self.popUpup.whatPressed(x, y) == "No": self.popUpup = None elif self.popUpup.whatPressed(x, y) == "Yes": question = "Would you like to change the name of your score?" self.popUpup = PopUpBox((self.width / 2, self.height / 2), question, "input", "title") elif self.popUpup.type == "input": if self.popUpup.button == "title": if self.popUpup.whatPressed(x, y) == "enter": self.project.scoreTitle = self.popUpup.input self.project.titleButton.text = self.project.scoreTitle self.popUpup = None elif self.popUpup.button == "Timebox": if self.popUpup.whatPressed(x, y) == "enter": time = self.popUpup.input self.popUpup = None newBox = TextBox( time, (self.width / 2 - 40, self.height / 2 - 40, 80, 80)) self.project.textBoxes.append(newBox) elif self.popUpup.button == "Lyrics": if self.popUpup.whatPressed(x, y) == "enter": words = self.popUpup.input self.popUpup = None newBox = TextBox( words, (self.width / 2 - 40, self.height / 2 - 40, 80, 80)) self.project.textBoxes.append(newBox) elif self.popUpup.type == "ok": if self.popUpup.whatPressed(x, y) == "ok": if self.popUpup.button == 'sing': question = "*Recording*" self.popUpup = (PopUpBox((self.width / 2, self.height / 2), question, "display", "recording")) elif self.popUpup.button == "notesSung": self.popUpup = None elif self.popUpup.button == "direc": self.popUpup = None
def pressPopups(self, x, y): if self.popUpup.type == "Yes/No": if self.popUpup.button == '<--': if self.popUpup.whatPressed(x,y) == "Yes": pickletest.saveProject(self.project) self.init() elif self.popUpup.whatPressed(x,y) == "No": self.init() elif self.popUpup.button == "title": if self.popUpup.whatPressed(x,y) == "No": self.popUpup = None elif self.popUpup.whatPressed(x,y) == "Yes": question = "Would you like to change the name of your score?" self.popUpup = PopUpBox((self.width/2, self.height/2), question, "input", "title") elif self.popUpup.type == "input": if self.popUpup.button == "title": if self.popUpup.whatPressed(x,y) == "enter": self.project.scoreTitle = self.popUpup.input self.project.titleButton.text = self.project.scoreTitle self.popUpup = None elif self.popUpup.button == "Timebox": if self.popUpup.whatPressed(x,y) == "enter": time = self.popUpup.input self.popUpup = None newBox = TextBox(time, (self.width/2-40, self.height/2-40, 80, 80)) self.project.textBoxes.append(newBox) elif self.popUpup.button == "Lyrics": if self.popUpup.whatPressed(x,y) == "enter": words = self.popUpup.input self.popUpup = None newBox = TextBox(words, (self.width/2-40, self.height/2-40, 80, 80)) self.project.textBoxes.append(newBox) elif self.popUpup.type == "ok": if self.popUpup.whatPressed(x,y) == "ok": if self.popUpup.button == 'sing': question = "*Recording*" self.popUpup = (PopUpBox((self.width/2, self.height/2), question, "display", "recording")) elif self.popUpup.button == "notesSung": self.popUpup = None elif self.popUpup.button == "direc": self.popUpup = None
def pressedButtons(self, x, y): self.justSaved = False for button in self.buttons: if button.pressed(x, y): if button.text == "+": maxPages = 8 newPage = len(self.pages) + 1 if newPage <= maxPages: page = Page(self.properties, newPage) self.pages.append(page) creating.addPageButtons(self) else: pass #popUp elif button.text == "Add Music": button.isPressed = not button.isPressed self.canAdd = not self.canAdd elif button.text == "<--": if not self.justSaved: question = "Would you like to save?" self.popUpup = PopUpBox( (self.width / 2, self.height / 2), question, "Yes/No", '<--') else: self.init() elif button.text == "save": self.justSaved = True pickletest.saveProject(self.project) self.cInit(None, project=self.project, saved=True) elif button.text == "Sing": question = "Press OK to record" self.popUpup = PopUpBox((self.width / 2, self.height / 2), question, "ok", 'sing') elif button.text == "Directions": question = "Press 'Add Music' to change the score \n\ Select a measure to change \n drag and drop into the measure\n \n Press\ 'Sing' to obtain the notes you sing \n You must sing on the syllable 'Bah'\ loudly and clearly into the microphone \n For best results, sing slowly" self.popUpup = PopUpBox((self.width / 2, self.height / 2), question, "ok", 'direc')
def pressedButtons(self,x,y): self.justSaved = False for button in self.buttons: if button.pressed(x,y): if button.text == "+": maxPages = 8 newPage = len(self.pages) + 1 if newPage <= maxPages: page = Page(self.properties, newPage) self.pages.append(page) creating.addPageButtons(self) else: pass #popUp elif button.text == "Add Music": button.isPressed = not button.isPressed self.canAdd = not self.canAdd elif button.text == "<--": if not self.justSaved: question = "Would you like to save?" self.popUpup = PopUpBox((self.width/2, self.height/2), question, "Yes/No", '<--') else: self.init() elif button.text == "save": self.justSaved = True pickletest.saveProject(self.project) self.cInit(None, project = self.project, saved = True) elif button.text == "Sing": question = "Press OK to record" self.popUpup = PopUpBox((self.width/2, self.height/2), question, "ok", 'sing') elif button.text == "Directions": question = "Press 'Add Music' to change the score \n\ Select a measure to change \n drag and drop into the measure\n \n Press\ 'Sing' to obtain the notes you sing \n You must sing on the syllable 'Bah'\ loudly and clearly into the microphone \n For best results, sing slowly" self.popUpup = PopUpBox((self.width/2, self.height/2), question, "ok", 'direc')