-
Notifications
You must be signed in to change notification settings - Fork 0
/
wxglade_out.py
352 lines (265 loc) · 16.1 KB
/
wxglade_out.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 1.0.5 on Sat Oct 19 13:15:53 2024
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class RoundTimer(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: RoundTimer.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((800, 600))
self.SetTitle("Bridge Clock")
# Menu Bar
self.frame_menubar = wx.MenuBar()
wxglade_tmp_menu = wx.Menu()
item = wxglade_tmp_menu.Append(wx.ID_ANY, "Save Current Profile\tCtrl-S", "")
self.Bind(wx.EVT_MENU, self.on_menu_file_save, item)
item = wxglade_tmp_menu.Append(wx.ID_ANY, "Load Profile\tCtrl-L", "")
self.Bind(wx.EVT_MENU, self.on_menu_file_load, item)
item = wxglade_tmp_menu.Append(wx.ID_ANY, "Exit\tCtrl-X", "")
self.Bind(wx.EVT_MENU, self.on_menu_file_exit, item)
self.frame_menubar.Append(wxglade_tmp_menu, "&File")
wxglade_tmp_menu = wx.Menu()
item = wxglade_tmp_menu.Append(wx.ID_ANY, "Parameters\tCtrl-P", "")
self.Bind(wx.EVT_MENU, self.on_menu_settings_customize, item)
self.frame_menubar.Append(wxglade_tmp_menu, "&Settings")
wxglade_tmp_menu = wx.Menu()
self.frame_menubar.i_view_buttons = wxglade_tmp_menu.Append(wx.ID_ANY, "Hide_Buttons", "", wx.ITEM_CHECK)
self.Bind(wx.EVT_MENU, self.on_menu_view_buttons, self.frame_menubar.i_view_buttons)
self.frame_menubar.i_view_statusbar = wxglade_tmp_menu.Append(wx.ID_ANY, "Hide Statusbar", "", wx.ITEM_CHECK)
self.Bind(wx.EVT_MENU, self.on_menu_view_statusbar, self.frame_menubar.i_view_statusbar)
self.frame_menubar.Append(wxglade_tmp_menu, "&View")
wxglade_tmp_menu = wx.Menu()
item = wxglade_tmp_menu.Append(wx.ID_ANY, "About", "")
self.Bind(wx.EVT_MENU, self.on_menu_help_about, item)
self.frame_menubar.Append(wxglade_tmp_menu, "&Help")
self.SetMenuBar(self.frame_menubar)
# Menu Bar end
self.frame_statusbar = self.CreateStatusBar(3)
self.frame_statusbar.SetStatusWidths([-1, 200, 50])
# statusbar fields
frame_statusbar_fields = ["Round Number:", "Minutes Per Round:", "Time:"]
for i in range(len(frame_statusbar_fields)):
self.frame_statusbar.SetStatusText(frame_statusbar_fields[i], i)
self.panel_1 = wx.Panel(self, wx.ID_ANY, style=wx.CLIP_CHILDREN | wx.FULL_REPAINT_ON_RESIZE)
self.sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.label_description = wx.StaticText(self.panel_1, wx.ID_ANY, "All Sections", style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
self.label_description.SetBackgroundColour(wx.Colour(176, 0, 255))
self.label_description.SetForegroundColour(wx.Colour(255, 255, 0))
self.label_description.SetFont(wx.Font(36, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Copperplate Gothic Bold"))
self.sizer_1.Add(self.label_description, 1, wx.EXPAND, 0)
self.label_round = wx.StaticText(self.panel_1, wx.ID_ANY, "Round 1", style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
self.label_round.SetBackgroundColour(wx.Colour(176, 0, 255))
self.label_round.SetForegroundColour(wx.Colour(255, 255, 255))
self.label_round.SetFont(wx.Font(36, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Copperplate Gothic Bold"))
self.sizer_1.Add(self.label_round, 1, wx.EXPAND, 0)
self.sizer_clock = wx.BoxSizer(wx.HORIZONTAL)
self.sizer_1.Add(self.sizer_clock, 5, wx.EXPAND, 0)
self.label_clock_minutes = wx.StaticText(self.panel_1, wx.ID_ANY, "15", style=wx.ALIGN_RIGHT | wx.ST_NO_AUTORESIZE)
self.label_clock_minutes.SetBackgroundColour(wx.Colour(176, 15, 255))
self.label_clock_minutes.SetForegroundColour(wx.Colour(255, 255, 0))
self.label_clock_minutes.SetFont(wx.Font(256, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
self.sizer_clock.Add(self.label_clock_minutes, 4, wx.EXPAND, 0)
self.label_clock_colon = wx.StaticText(self.panel_1, wx.ID_ANY, ":", style=wx.ALIGN_CENTER_HORIZONTAL | wx.ST_NO_AUTORESIZE)
self.label_clock_colon.SetBackgroundColour(wx.Colour(176, 15, 255))
self.label_clock_colon.SetForegroundColour(wx.Colour(255, 255, 0))
self.label_clock_colon.SetFont(wx.Font(256, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
self.sizer_clock.Add(self.label_clock_colon, 1, wx.EXPAND, 0)
self.label_clock_seconds = wx.StaticText(self.panel_1, wx.ID_ANY, "00", style=wx.ALIGN_LEFT | wx.ST_NO_AUTORESIZE)
self.label_clock_seconds.SetBackgroundColour(wx.Colour(176, 15, 255))
self.label_clock_seconds.SetForegroundColour(wx.Colour(255, 255, 0))
self.label_clock_seconds.SetFont(wx.Font(256, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
self.sizer_clock.Add(self.label_clock_seconds, 4, wx.EXPAND, 0)
self.sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
self.sizer_1.Add(self.sizer_2, 0, wx.EXPAND, 0)
self.button_start = wx.ToggleButton(self.panel_1, wx.ID_ANY, "Start")
self.button_start.SetToolTip("Run or pause the clock.")
self.sizer_2.Add(self.button_start, 0, 0, 0)
self.button_reset = wx.Button(self.panel_1, wx.ID_ANY, "Reset")
self.button_reset.SetToolTip("Reset current round to full round length.")
self.sizer_2.Add(self.button_reset, 0, 0, 0)
self.button_clock_plus = wx.Button(self.panel_1, wx.ID_ANY, "+1 min")
self.sizer_2.Add(self.button_clock_plus, 0, 0, 0)
self.button_clock_minus = wx.Button(self.panel_1, wx.ID_ANY, "-1 min")
self.sizer_2.Add(self.button_clock_minus, 0, 0, 0)
self.button_break = wx.Button(self.panel_1, wx.ID_ANY, "Go To Break")
self.button_break.SetToolTip("Add an unscheduled break after this round.")
self.sizer_2.Add(self.button_break, 0, 0, 0)
self.sizer_2.Add((40, 0), 1, wx.ALL, 0)
self.button_end_round = wx.Button(self.panel_1, wx.ID_ANY, "End Round")
self.sizer_2.Add(self.button_end_round, 0, 0, 0)
self.button_round_plus = wx.Button(self.panel_1, wx.ID_ANY, "+1 Round")
self.sizer_2.Add(self.button_round_plus, 0, 0, 0)
self.button_round_minus = wx.Button(self.panel_1, wx.ID_ANY, "-1 Round")
self.sizer_2.Add(self.button_round_minus, 0, 0, 0)
self.panel_1.SetSizer(self.sizer_1)
self.Layout()
self.Bind(wx.EVT_TOGGLEBUTTON, self.on_button_start, self.button_start)
self.Bind(wx.EVT_BUTTON, self.on_button_reset, self.button_reset)
self.Bind(wx.EVT_BUTTON, self.on_button_clock_plus, self.button_clock_plus)
self.Bind(wx.EVT_BUTTON, self.on_button_clock_minus, self.button_clock_minus)
self.Bind(wx.EVT_BUTTON, self.on_goto_break, self.button_break)
self.Bind(wx.EVT_BUTTON, self.on_button_end_round, self.button_end_round)
self.Bind(wx.EVT_BUTTON, self.on_button_round_plus, self.button_round_plus)
self.Bind(wx.EVT_BUTTON, self.on_button_round_minus, self.button_round_minus)
self.Bind(wx.EVT_CLOSE, self.on_close, self)
self.Bind(wx.EVT_SIZE, self.on_resize, self)
# end wxGlade
def on_menu_file_save(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_menu_file_save' not implemented!")
event.Skip()
def on_menu_file_load(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_menu_file_load' not implemented!")
event.Skip()
def on_menu_file_exit(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_menu_file_exit' not implemented!")
event.Skip()
def on_menu_settings_customize(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_menu_settings_customize' not implemented!")
event.Skip()
def on_menu_view_buttons(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_menu_view_buttons' not implemented!")
event.Skip()
def on_menu_view_statusbar(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_menu_view_statusbar' not implemented!")
event.Skip()
def on_menu_help_about(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_menu_help_about' not implemented!")
event.Skip()
def on_button_start(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_button_start' not implemented!")
event.Skip()
def on_button_reset(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_button_reset' not implemented!")
event.Skip()
def on_button_clock_plus(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_button_clock_plus' not implemented!")
event.Skip()
def on_button_clock_minus(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_button_clock_minus' not implemented!")
event.Skip()
def on_goto_break(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_goto_break' not implemented!")
event.Skip()
def on_button_end_round(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_button_end_round' not implemented!")
event.Skip()
def on_button_round_plus(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_button_round_plus' not implemented!")
event.Skip()
def on_button_round_minus(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_button_round_minus' not implemented!")
event.Skip()
def on_close(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_close' not implemented!")
event.Skip()
def on_resize(self, event): # wxGlade: RoundTimer.<event_handler>
print("Event handler 'on_resize' not implemented!")
event.Skip()
# end of class RoundTimer
class SetupDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: SetupDialog.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE
wx.Dialog.__init__(self, *args, **kwds)
self.SetTitle("dialog")
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.panel_1 = wx.Panel(self, wx.ID_ANY)
sizer_1.Add(self.panel_1, 1, wx.EXPAND, 0)
sizer_3 = wx.BoxSizer(wx.VERTICAL)
label_1 = wx.StaticText(self.panel_1, wx.ID_ANY, "Setup Game")
sizer_3.Add(label_1, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
grid_sizer_1 = wx.FlexGridSizer(2, 2, 0, 50)
sizer_3.Add(grid_sizer_1, 2, wx.ALIGN_CENTER_HORIZONTAL, 0)
label_2 = wx.StaticText(self.panel_1, wx.ID_ANY, "Number of Rounds:")
grid_sizer_1.Add(label_2, 0, wx.ALIGN_CENTER_VERTICAL, 0)
label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, "Minutes per Round:")
grid_sizer_1.Add(label_3, 0, wx.ALIGN_CENTER_VERTICAL, 0)
self.text_round_count = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_CENTRE)
self.text_round_count.SetMinSize((50, -1))
self.text_round_count.SetToolTip("Number of rounds to count (9, 13, ...)")
grid_sizer_1.Add(self.text_round_count, 0, wx.ALIGN_CENTER, 0)
self.text_round_length = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_CENTRE)
self.text_round_length.SetMinSize((50, -1))
self.text_round_length.SetToolTip("Length of each round (minutes). Include time for round change!")
grid_sizer_1.Add(self.text_round_length, 0, wx.ALIGN_CENTER, 0)
label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, "Hospitality Breaks")
sizer_3.Add(label_4, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
grid_sizer_2 = wx.FlexGridSizer(2, 3, 0, 20)
sizer_3.Add(grid_sizer_2, 2, wx.ALIGN_CENTER_HORIZONTAL, 0)
label_5 = wx.StaticText(self.panel_1, wx.ID_ANY, "After Rounds (e.g. \"4,9\")")
grid_sizer_2.Add(label_5, 0, 0, 0)
label_6 = wx.StaticText(self.panel_1, wx.ID_ANY, "Break Length")
grid_sizer_2.Add(label_6, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
label_7 = wx.StaticText(self.panel_1, wx.ID_ANY, "Invisible?")
grid_sizer_2.Add(label_7, 0, 0, 0)
self.text_break_rounds = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_CENTRE)
self.text_break_rounds.SetMinSize((80, -1))
self.text_break_rounds.SetToolTip("Rounds to give a break after. If more than one, separate by commas (e.g. 4, 9)")
grid_sizer_2.Add(self.text_break_rounds, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
self.text_break_length = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_CENTRE)
self.text_break_length.SetMinSize((50, -1))
self.text_break_length.SetToolTip("Minutes to pause for the break.")
grid_sizer_2.Add(self.text_break_length, 0, wx.ALIGN_CENTER, 0)
self.check_invisible = wx.CheckBox(self.panel_1, wx.ID_ANY, "")
self.check_invisible.SetToolTip("If checked, rather than showing a break explicitly, just add the time to the current round.")
grid_sizer_2.Add(self.check_invisible, 0, wx.ALIGN_CENTER, 0)
sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
sizer_3.Add(sizer_5, 1, wx.ALIGN_CENTER_HORIZONTAL, 0)
self.check_show_description = wx.CheckBox(self.panel_1, wx.ID_ANY, "Description (e.g. \"Sections KLM\"):")
sizer_5.Add(self.check_show_description, 0, wx.ALIGN_CENTER_VERTICAL, 0)
self.text_description = wx.TextCtrl(self.panel_1, wx.ID_ANY, "")
self.text_description.SetToolTip("If needed, one-line description of who this clock is for.")
sizer_5.Add(self.text_description, 0, wx.ALIGN_CENTER_VERTICAL, 0)
sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
sizer_3.Add(sizer_4, 1, wx.ALIGN_CENTER_HORIZONTAL, 0)
self.check_sounds = wx.CheckBox(self.panel_1, wx.ID_ANY, "Sounds:", style=wx.ALIGN_RIGHT)
self.check_sounds.SetToolTip("Play sounds")
sizer_4.Add(self.check_sounds, 0, wx.ALIGN_CENTER_VERTICAL, 0)
self.check_manual = wx.CheckBox(self.panel_1, wx.ID_ANY, "Manually Start Rounds:", style=wx.ALIGN_RIGHT)
self.check_manual.SetToolTip("If checked, will not automatically start each next round.")
sizer_4.Add(self.check_manual, 0, wx.EXPAND | wx.LEFT, 30)
self.check_restart = wx.CheckBox(self.panel_1, wx.ID_ANY, "Restart Game", style=wx.ALIGN_RIGHT)
self.check_restart.Hide()
sizer_4.Add(self.check_restart, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 30)
sizer_2 = wx.StdDialogButtonSizer()
sizer_1.Add(sizer_2, 0, wx.ALIGN_RIGHT | wx.ALL, 4)
self.button_ok = wx.Button(self, wx.ID_OK, "")
self.button_ok.SetDefault()
sizer_2.AddButton(self.button_ok)
sizer_2.Add((50, 0), 1, wx.EXPAND, 0)
self.button_cancel = wx.Button(self, wx.ID_CANCEL, "")
sizer_2.AddButton(self.button_cancel)
sizer_2.Realize()
self.panel_1.SetSizer(sizer_3)
self.SetSizer(sizer_1)
sizer_1.Fit(self)
self.SetAffirmativeId(self.button_ok.GetId())
self.SetEscapeId(self.button_cancel.GetId())
self.Layout()
self.Bind(wx.EVT_CHECKBOX, self.on_description_checked, self.check_show_description)
self.Bind(wx.EVT_CHECKBOX, self.on_restart_checked, self.check_restart)
# end wxGlade
def on_description_checked(self, event): # wxGlade: SetupDialog.<event_handler>
print("Event handler 'on_description_checked' not implemented!")
event.Skip()
def on_restart_checked(self, event): # wxGlade: SetupDialog.<event_handler>
print("Event handler 'on_restart_checked' not implemented!")
event.Skip()
# end of class SetupDialog
class MyApp(wx.App):
def OnInit(self):
self.round_timer = RoundTimer(None, wx.ID_ANY, "")
self.SetTopWindow(self.round_timer)
self.round_timer.Show()
return True
# end of class MyApp
if __name__ == "__main__":
app = MyApp(0)
app.MainLoop()