comparison orpg/mapper/miniatures.py @ 7:2b9e766f9dee grumpy-goblin

Tests fixes issues with Linux GUI effecting miniatures Files: /mapper/miniatures.py /mapper/miniatures_handler.py
author sirebral
date Thu, 16 Jul 2009 14:26:50 -0500
parents 4385a7d0efd1
children 78407d627cba
comparison
equal deleted inserted replaced
6:668694b93f6c 7:2b9e766f9dee
492 self.canvas = canvas 492 self.canvas = canvas
493 self.log = self.canvas.log 493 self.log = self.canvas.log
494 self.log.log("Enter miniature_layer", ORPG_DEBUG) 494 self.log.log("Enter miniature_layer", ORPG_DEBUG)
495 self.settings = self.canvas.settings 495 self.settings = self.canvas.settings
496 layer_base.__init__(self) 496 layer_base.__init__(self)
497
498 self.id = -1 #added.
499
497 self.miniatures = [] 500 self.miniatures = []
498 self.serial_number = 0 501 self.serial_number = 0
502
503 # Set the font of the labels to be the same as the chat window
504 # only smaller.
505 font_size = int(self.settings.get_setting('defaultfontsize'))
506 if (font_size >= 10):
507 font_size -= 2
508 self.label_font = wx.Font(font_size, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL,
509 False, self.settings.get_setting('defaultfont'))
510
499 self.log.log("Exit miniature_layer", ORPG_DEBUG) 511 self.log.log("Exit miniature_layer", ORPG_DEBUG)
500 512
501 def next_serial(self): 513 def next_serial(self):
502 self.log.log("Enter miniature_layer->next_serial(self)", ORPG_DEBUG) 514 self.log.log("Enter miniature_layer->next_serial(self)", ORPG_DEBUG)
503 self.serial_number += 1 515 self.serial_number += 1
587 self.collapse_zorder() 599 self.collapse_zorder()
588 self.log.log("Exit miniature_layer->del_all_miniatures(self)", ORPG_DEBUG) 600 self.log.log("Exit miniature_layer->del_all_miniatures(self)", ORPG_DEBUG)
589 601
590 def layerDraw(self, dc, topleft, size): 602 def layerDraw(self, dc, topleft, size):
591 self.log.log("Enter miniature_layer->layerDraw(self, dc, topleft, size)", ORPG_DEBUG) 603 self.log.log("Enter miniature_layer->layerDraw(self, dc, topleft, size)", ORPG_DEBUG)
604
605 dc.SetFont(self.label_font)
606
592 sorted_miniatures = self.miniatures[:] 607 sorted_miniatures = self.miniatures[:]
593 sorted_miniatures.sort(cmp_zorder) 608 sorted_miniatures.sort(cmp_zorder)
594 for m in sorted_miniatures: 609 for m in sorted_miniatures:
595 if (m.pos.x>topleft[0]-m.right and 610 if (m.pos.x>topleft[0]-m.right and
596 m.pos.y>topleft[1]-m.bottom and 611 m.pos.y>topleft[1]-m.bottom and