[shpy-commit] r2851 - shpy/trunk/dist/shpy

arigo@codespeak.net arigo@codespeak.net
Tue, 20 Jan 2004 14:57:57 +0100 (MET)


Author: arigo
Date: Tue Jan 20 14:57:56 2004
New Revision: 2851

Modified:
   shpy/trunk/dist/shpy/ui_pygame.py
Log:
Killed old code.


Modified: shpy/trunk/dist/shpy/ui_pygame.py
==============================================================================
--- shpy/trunk/dist/shpy/ui_pygame.py	(original)
+++ shpy/trunk/dist/shpy/ui_pygame.py	Tue Jan 20 14:57:56 2004
@@ -15,62 +15,6 @@
 WAKEUPEVENT = USEREVENT
 
 
-class InputCell:
-
-    def __init__(self, cellstructure):
-        self.cellstructure = cellstructure
-        self.lines = text.split('\n')
-        assert self.lines
-        self.cursor = None
-        self.vscroll = 0
-
-    def draw(self, screen, font):
-        ypos = self.vscroll
-        yposlist = []
-        for line in self.lines:
-            yposlist.append(ypos)
-            lineimage = font.render(line or ' ', 1, (0,0,0))
-            screen.blit(lineimage, (0, ypos))
-            ypos += lineimage.get_size()[1]
-        self.draw_cursor(screen, font, yposlist)
-
-    def draw_cursor(self, screen, font, yposlist):
-        if self.cursor is not None:
-            x = self.cursor.x
-            y = self.cursor.y
-            if y >= len(yposlist):
-                y = len(yposlist)-1
-            line = self.lines[y]
-            xpos = font.size(line[:x])[0]
-            ypos = yposlist[y]
-            char = line[x:x+1] or ' '
-            charimage = font.render(char, 1, (255,255,255), (40,0,0))
-            if ypos < 0:
-                screen.fill((255, 255, 255))
-                self.vscroll -= ypos
-                self.draw(screen, font)
-            elif ypos + charimage.get_size()[1] > screen.get_size()[1]:
-                screen.fill((255, 255, 255))
-                self.vscroll -= ypos + charimage.get_size()[1] - screen.get_size()[1]
-                self.draw(screen, font)                
-            screen.blit(charimage, (xpos, ypos))
-
-
-class Cursor:
-
-    def __init__(self):
-        self.cell = None
-        self.x = 0
-        self.y = 0
-
-    def entercell(self, cell, position=(0,0)):
-        if self.cell is not None:
-            self.cell.cursor = None
-        self.cell = cell
-        cell.cursor = self
-        self.x, self.y = position
-
-
 KEYMAP = {}
 for name, value in pygame.locals.__dict__.items():
     if name.startswith('K_'):