comparison python/codeedit.py @ 250:f5fba5b554d7

Removal of obsolete editor
author Windel Bouwman
date Sun, 28 Jul 2013 19:07:51 +0200
parents e41e4109addd
children 225f444019b1
comparison
equal deleted inserted replaced
249:e41e4109addd 250:f5fba5b554d7
28 self.errorlist = [] 28 self.errorlist = []
29 self.arrow = None 29 self.arrow = None
30 # Initial values: 30 # Initial values:
31 self.setSource('') 31 self.setSource('')
32 self.CursorPosition = 0 32 self.CursorPosition = 0
33 t = QTimer(self) 33 self.t = QTimer(self)
34 t.timeout.connect(self.updateCursor) 34 self.t.timeout.connect(self.updateCursor)
35 t.setInterval(500) 35 self.t.setInterval(500)
36 t.start() 36 self.t.start()
37
37 def updateCursor(self): 38 def updateCursor(self):
38 self.blinkcursor = not self.blinkcursor 39 self.blinkcursor = not self.blinkcursor
39 self.update() 40 self.update()
40 #self.update(self.cursorX, self.cursorY, self.charWidth, self.charHeight) 41 #self.update(self.cursorX, self.cursorY, self.charWidth, self.charHeight)
41 42
145 # Draw contents: 146 # Draw contents:
146 ypos = row1 * chh - self.charDescent 147 ypos = row1 * chh - self.charDescent
147 curRow = self.CursorRow 148 curRow = self.CursorRow
148 ydt = -chh + self.charDescent 149 ydt = -chh + self.charDescent
149 for row in range(row1, row2 + 1): 150 for row in range(row1, row2 + 1):
150 if curRow == row: 151 if curRow == row and self.hasFocus():
151 painter.fillRect(self.xposTXT, ypos + ydt, er.width(), chh, Qt.yellow) 152 painter.fillRect(self.xposTXT, ypos + ydt, er.width(), chh, Qt.yellow)
152 # cursor 153 # cursor
153 if self.blinkcursor: 154 if self.blinkcursor:
154 cursorX = self.CursorCol * self.charWidth + self.xposTXT - self.charWidth 155 cursorX = self.CursorCol * self.charWidth + self.xposTXT - self.charWidth
155 cursorY = ypos + ydt 156 cursorY = ypos + ydt