Mercurial > lcfOS
diff python/codeedit.py @ 167:0b5b2ee6b435
Added 2 unit tests
author | Windel Bouwman |
---|---|
date | Fri, 22 Mar 2013 17:40:13 +0100 |
parents | 8104fc8b5e90 |
children | ee0d30533dae |
line wrap: on
line diff
--- a/python/codeedit.py Fri Mar 22 16:15:31 2013 +0100 +++ b/python/codeedit.py Fri Mar 22 17:40:13 2013 +0100 @@ -70,6 +70,7 @@ txt = '\n'.join(prevRows) c = clipVal(c, 1, len(self.getRow(r))) self.CursorPosition = len(txt) + c + 1 + self.showRow(self.CursorRow) def getRow(self, r): rows = self.Rows r = r - 1 @@ -149,11 +150,13 @@ painter.setPen(errorPen) x = self.xposTXT + (e.loc.col - 1) * chw - 2 wt = e.loc.length * chw + 4 - painter.drawRoundedRect(x, ypos + ydt, wt, chh, 7, 7) + dy = self.charDescent + painter.drawLine(x, ypos + dy, x + wt, ypos + dy) + #painter.drawRoundedRect(x, ypos + ydt, wt, chh, 7, 7) # print error balloon - painter.drawText(x, ypos + chh, e.msg) - if len(curErrors) > 0: - ypos += chh + #painter.drawText(x, ypos + chh, e.msg) + #if len(curErrors) > 0: + # ypos += chh ypos += chh def keyPressEvent(self, event): @@ -221,6 +224,8 @@ Source = property(lambda s: s.ic.getSource(), lambda s, v: s.ic.setSource(v)) def setErrors(self, el): self.ic.setErrors(el) + def setFocus(self): + self.ic.setFocus() if __name__ == '__main__': app = QApplication(sys.argv)