-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
basketball.py
executable file
·49 lines (41 loc) · 1.53 KB
/
basketball.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
#
# This file is part of Mediary's Caspar Client.
# Copyright (C) 2018 Mediary Limited. All rights reserved.
#
import scorebug
import wx
import configurable
import lowerthird
import scoreextra
import timer
import lt_banner
class BasketballScore(scorebug.ScoreBug):
'''
Basketball scoring widget.
This is a customisation of the ScoreBug widget, with
one-touch controls for +1, +2 and +3 points for each team.
The +2 controls are in large text, as they're most commonly used.
'''
config_section='basketball'
ui_label='Basketball'
def createSecondLine(self,sizer):
line2 = wx.BoxSizer(wx.HORIZONTAL)
self.addButton(line2, '+1', lambda e: self.score(1, 1))
line2.AddSpacer(10)
self.addButton(line2, '+2', lambda e: self.score(1, 2), True)
line2.AddSpacer(10)
self.addButton(line2, '+3', lambda e: self.score(1, 3))
line2.AddStretchSpacer(1)
self.addButton(line2, '+1', lambda e: self.score(2, 1))
line2.AddSpacer(10)
self.addButton(line2, '+2', lambda e: self.score(2, 2), True)
line2.AddSpacer(10)
self.addButton(line2, '+3', lambda e: self.score(2, 3))
sizer.AddStretchSpacer(1)
sizer.AddSpacer(10)
sizer.Add(line2, 0, wx.EXPAND)
if __name__=='__main__':
import wxclient
# This is the set of widgets to load when this script is invoked directly.
wxclient.run_app([BasketballScore, timer.Timer, scoreextra.ScoreExtra, lowerthird.LowerThird, lt_banner.LowerThirdBanner])