def doReplacePrompt(self, cursor): r = Rect(0, 2, 40, 9) r.move((self.desktop.size.x - r.bottomRight.x) // 2, 0) lower = self.desktop.makeGlobal(r.bottomRight) if cursor.y <= lower.y: r.move(0, (self.desktop.size.y - r.bottomRight.y) // 2) return messageBoxRect(r, 'Replace this occurrence?', mfInformation, (mfYesButton, mfNoButton, mfCancelButton))
def test_move(self): r = Rect(1, 1, 2, 2) r.move(1, 1) assert r == Rect(2, 2, 3, 3)
def inputBox(Title, aLabel, s, limit): r = Rect(0, 0, 60, 8) size = getDesktopSize() r.move((size.x - r.bottomRight.x) // 2, (size.y - r.bottomRight.y) // 2) return inputBoxRect(r, Title, aLabel, s, limit)
def makeRect(): r = Rect(0, 0, 40, 9) size = getDesktopSize() r.move((size.x - r.bottomRight.x) // 2, (size.y - r.bottomRight.y) // 2) return r