Quit, Rest-Knopf, noch ohne Funktionalitaet
authorJoachim Breitner <mail@joachim-breitner.de>
Tue, 22 May 2007 20:17:22 +0000 (20:17 +0000)
committerJoachim Breitner <mail@joachim-breitner.de>
Tue, 22 May 2007 20:17:22 +0000 (20:17 +0000)
cairoboard.py

index 3ddbbe2..729591c 100644 (file)
@@ -124,7 +124,7 @@ class CairoBoard(gtk.DrawingArea):
         self.board.bh.guiinfo.draw(window)
         self.board.pile.guiinfo.draw(window)
         self.board.hand.guiinfo.draw(window)
-        #self.draw_hand(self.board.hand, window, self.hand_x, self.hand_y)
+
     
     def draw_points(self, points, window):
         cr = window.cairo_create()
@@ -145,16 +145,33 @@ class CairoBoard(gtk.DrawingArea):
         ocr = window.cairo_create()
         if not self.base_surface:
             self.base_surface = ocr.get_target().create_similar(cairo.CONTENT_COLOR_ALPHA, 
-                    2*GRIDPAD + 9*GRIDWIDTH, 2*GRIDPAD + 6*GRIDWIDTH)
+                    2*GRIDPAD + 11*GRIDWIDTH, 2*GRIDPAD + 7*GRIDWIDTH)
 
             cr = cairo.Context(self.base_surface)
             self.draw_base(cr)
+            cr = cairo.Context(self.base_surface)
+            self.draw_buttons(cr)
 
         ocr.set_source_surface(self.base_surface,0,0)
         ocr.rectangle(0,0,
-                2*GRIDPAD + 9*GRIDWIDTH, 2*GRIDPAD + 6*GRIDWIDTH)
+                2*GRIDPAD + 11*GRIDWIDTH, 2*GRIDPAD + 7*GRIDWIDTH)
         ocr.fill()
 
+    def draw_buttons(self,cr):
+        cr.set_font_size(25)
+        cr.set_source_rgb(0,0,0)
+
+        (_,_,w,h,ax,_) = cr.text_extents("QUIT")
+        cr.move_to(20, 1*GRIDPAD + 6*GRIDWIDTH + 10)
+        cr.show_text("QUIT")
+        self.quit_rect = (20, 1*GRIDPAD + 6*GRIDWIDTH + 10 - h, w, h)
+
+        (_,_,w,h,_,_) = cr.text_extents("RESET")
+        cr.move_to(20 + ax + 20, 1*GRIDPAD + 6*GRIDWIDTH + 10)
+        cr.show_text("RESET")
+        self.reset_rect = (20 + ax + 20, 1*GRIDPAD + 6*GRIDWIDTH + 10 - h, w, h)
+
+
 class CairoSlot:
     def __init__(self, fabric, slot):
         self.fabric = fabric