comparison pyink/MBScene.py @ 964:1028f6278ead

Remove showGrid() from MBScene
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 17 Nov 2010 17:25:44 +0800
parents a05ec4fb1c20
children 84f502fb3e40
comparison
equal deleted inserted replaced
963:a05ec4fb1c20 964:1028f6278ead
545 pass 545 pass
546 pass 546 pass
547 pass 547 pass
548 pass 548 pass
549 549
550 def showGrid(self):
551 max = 0
552 for layer in self.layers:
553 for s in layer.scenes:
554 if s.end > max:
555 max = s.end
556 pass
557 pass
558 pass
559 max = 50
560
561 self.grid = gtk.Table(len(self.layers)+1, 50)
562 self.scrollwin = gtk.ScrolledWindow()
563 self.scrollwin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
564 self.scrollwin.add_with_viewport(self.grid)
565 self.scrollwin.set_size_request(-1,150)
566 for i in range(1,max):
567 self.grid.attach(gtk.Label('%d'% i), i,i+1,0,1,0,0,0,0)
568 pass
569 for i in range(1,len(self.layers)+1):
570 print "Layer", i
571 l = self.layers[i-1]
572 for s in l.scenes:
573 btn = self.newCell('start.png')
574 btn.nScene = s.start
575 btn.layer = l.node.getId()
576 btn.nLayer = i
577
578 self.grid.attach(btn, s.start, s.start+1, i, i+1,0,0,0,0)
579 for j in range(s.start+1,s.end+1):
580 btn = self.newCell('fill.png')
581 self.grid.attach(btn, j, j+1, i , i+1,0,0,0,0)
582 color = btn.get_colormap().alloc_color("gray")
583 btn.modify_bg(gtk.STATE_NORMAL, color)
584 btn.nScene = j
585 btn.layer = l.node.getId()
586 btn.nLayer = i
587 pass
588 pass
589 if len(l.scenes) == 0:
590 start = 0
591 else:
592 start = l.scenes[len(l.scenes)-1].end
593 pass
594
595 for j in range(start,max):
596 btn = self.newCell('empty.png')
597 self.grid.attach(btn, j+1, j+2,i,i+1,0,0,0,0)
598 color = btn.get_colormap().alloc_color("gray")
599 btn.modify_bg(gtk.STATE_NORMAL, color)
600 btn.nScene = j+1
601 btn.layer = l.node.getId()
602 btn.nLayer = i
603 pass
604 pass
605 self.last_cell = None
606 pass
607
608 def cellSelect(self, cell, data): 550 def cellSelect(self, cell, data):
609 if self.last_cell: 551 if self.last_cell:
610 color = self.last_cell.get_colormap().alloc_color("gray") 552 color = self.last_cell.get_colormap().alloc_color("gray")
611 self.last_cell.modify_bg(gtk.STATE_NORMAL, color) 553 self.last_cell.modify_bg(gtk.STATE_NORMAL, color)
612 pass 554 pass