comparison frontends/wix/card_game.py @ 86:4b5f2d55b6ac

wix: Tarot panel now appear on top of groupchat window when a Tarot game is started
author Goffi <goffi@goffi.org>
date Tue, 11 May 2010 13:06:05 +0930
parents 1ac759ea28c3
children 66d784082930
comparison
equal deleted inserted replaced
85:fc7583282d40 86:4b5f2d55b6ac
30 from quick_frontend.quick_chat import QuickChat 30 from quick_frontend.quick_chat import QuickChat
31 from contact_list import ContactList 31 from contact_list import ContactList
32 32
33 CARD_WIDTH = 74 33 CARD_WIDTH = 74
34 CARD_HEIGHT = 136 34 CARD_HEIGHT = 136
35 MIN_WIDTH = 950 #Minimum size of the panel
36 MIN_HEIGHT = 500
35 37
36 class Card(): 38 class Card():
37 """This class is used to represent a card, graphically and logically""" 39 """This class is used to represent a card, graphically and logically"""
38 40
39 def __init__(self, file): 41 def __init__(self, file):
57 class CardPanel(wx.Panel): 59 class CardPanel(wx.Panel):
58 """This class is used to display the cards""" 60 """This class is used to display the cards"""
59 61
60 def __init__(self, parent): 62 def __init__(self, parent):
61 wx.Panel.__init__(self, parent) 63 wx.Panel.__init__(self, parent)
64 self.SetMinSize(wx.Size(MIN_WIDTH, MIN_HEIGHT))
62 self.load_cards("/home/goffi/dev/divers/images/cards/") 65 self.load_cards("/home/goffi/dev/divers/images/cards/")
63 self.selected = None #contain the card to highlight 66 self.selected = None #contain the card to highlight
64 self.hand_size = 13 #number of cards in a hand 67 self.hand_size = 13 #number of cards in a hand
65 self.visible_size = CARD_WIDTH/2 #number of pixels visible for cards 68 self.visible_size = CARD_WIDTH/2 #number of pixels visible for cards
66 self.hand = random.sample(self.deck, self.hand_size) 69 self.hand = random.sample(self.deck, self.hand_size)