-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDemo.py
More file actions
1460 lines (1292 loc) · 115 KB
/
Demo.py
File metadata and controls
1460 lines (1292 loc) · 115 KB
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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.2 on Wed Feb 27 21:45:22 2008
"""
Demo of using ObjectListView and its friends.
Simple Tab
Shows the use
This tab also shows how to simply use a checkbox on each row.
"""
__author__ = "Phillip Piper"
__date__ = "24 July 2008"
__version__ = "1.1"
from datetime import datetime, time
import os
import random
from time import clock, strptime
import wx
import wx.lib.colourdb as colourdb
import sys
sys.path.append("..")
#sys.path.append("c:/jpp/code/python/ObjectListView/trunk")
from ObjectListView import ObjectListView, VirtualObjectListView, FastObjectListView, GroupListView, ColumnDefn
from ObjectListView import EVT_CELL_EDIT_STARTING, EVT_CELL_EDIT_FINISHING, CellEditorRegistry
from ObjectListView import ListCtrlPrinter, ReportFormat
from ObjectListView import Filter
import OwnerDrawnEditor
# begin wxGlade: extracode
# end wxGlade
class Track:
"""
A song in some music library
"""
def __init__(self, **kwargs):
self.isChecked = False
self.attributeNames = kwargs.keys()
self.attributeNames.extend(["trackColour", "font", "isChecked"])
self.__dict__.update(kwargs)
def clone(self):
"Return a deep copy of this object"
d = {}
for x in self.attributeNames:
d[x] = getattr(self, x, None)
return Track(**d)
def dateLastPlayed(self):
"Return just the date that the track was played"
return self.lastPlayed.date()
def SetDateLastPlayed(self, value):
"Modify just the date that the track was played. The time is preserved"
self.lastPlayed = datetime.combine(value, self.lastPlayed.time())
def SetFontFace(self, value):
"Remember a font to display this object. This really shouldn't be in the model"
if value is None or value == "":
self.font = None
else:
self.font = wx.FFont(11, wx.DEFAULT, face=value)
class MyFrame(wx.Frame):
"The main window for the demo app"
def __init__(self, *args, **kwds):
self.PreInit()
# begin wxGlade: MyFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.notebook_1 = wx.Notebook(self, -1, style=0)
self.notebook_1_pane_6 = wx.Panel(self.notebook_1, -1)
self.notebook_1_pane_5 = wx.Panel(self.notebook_1, -1)
self.notebook_1_pane_4 = wx.Panel(self.notebook_1, -1)
self.notebook_1_pane_3 = wx.Panel(self.notebook_1, -1)
self.notebook_1_pane_2 = wx.Panel(self.notebook_1, -1)
self.notebook_1_pane_1 = wx.Panel(self.notebook_1, -1)
self.sizer_5_staticbox = wx.StaticBox(self.notebook_1_pane_1, -1, "Commands")
self.sizer_6_staticbox = wx.StaticBox(self.notebook_1_pane_1, -1, "Select")
self.sizer_11_copy_staticbox = wx.StaticBox(self.notebook_1_pane_1, -1, "Search")
self.sizer_4_copy_staticbox = wx.StaticBox(self.notebook_1_pane_2, -1, "List View")
self.sizer_5_copy_staticbox = wx.StaticBox(self.notebook_1_pane_2, -1, "Commands")
self.sizer_6_copy_staticbox = wx.StaticBox(self.notebook_1_pane_2, -1, "Select")
self.sizer_11_staticbox = wx.StaticBox(self.notebook_1_pane_2, -1, "Search")
self.sizer_7_copy_staticbox = wx.StaticBox(self.notebook_1_pane_3, -1, "Commands")
self.sizer_8_copy_staticbox = wx.StaticBox(self.notebook_1_pane_3, -1, "Select")
self.sizer_9_copy_staticbox = wx.StaticBox(self.notebook_1_pane_4, -1, "Commands")
self.sizer_10_copy_staticbox = wx.StaticBox(self.notebook_1_pane_4, -1, "Select")
self.sizer_11_copy_copy_staticbox = wx.StaticBox(self.notebook_1_pane_4, -1, "Search")
self.sizer_7_staticbox = wx.StaticBox(self.notebook_1_pane_5, -1, "Group Commands")
self.sizer_9_copy_copy_staticbox = wx.StaticBox(self.notebook_1_pane_5, -1, "Commands")
self.sizer_10_copy_copy_staticbox = wx.StaticBox(self.notebook_1_pane_5, -1, "Select")
self.sizer_11_copy_copy_1_staticbox = wx.StaticBox(self.notebook_1_pane_5, -1, "Search")
self.sizer_18_staticbox = wx.StaticBox(self.notebook_1_pane_6, -1, "Printing Commands")
self.sizer_10_staticbox = wx.StaticBox(self.notebook_1_pane_6, -1, "Sources")
self.sizer_15_staticbox = wx.StaticBox(self.notebook_1_pane_6, -1, "Options")
self.sizer_17_staticbox = wx.StaticBox(self.notebook_1_pane_6, -1, "Headers")
self.sizer_9_staticbox = wx.StaticBox(self.notebook_1_pane_6, -1, "Watermark")
self.sizer_4_staticbox = wx.StaticBox(self.notebook_1_pane_1, -1, "List View")
self.frame_1_statusbar = self.CreateStatusBar(1, 0)
self.text_ctrl_1_copy = wx.TextCtrl(self.notebook_1_pane_1, -1, "This is a minimal example of an ObjectListView. The programmer defines the columns that should be shown -- this includes the attribute that should be should be displayed in the column. Once the columns are defined, the programmer gives the control a collection of model objects. The ObjectListView then manages the displaying and sorting of the list by itself. This tab shows what is possible using only the columns definitions, without handling any callbacks. The 'Album' column is a space filling column -- it will automatically shrink or expand to fill any available space.", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_LINEWRAP|wx.TE_WORDWRAP)
self.olvSimple = ObjectListView(self.notebook_1_pane_1, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
self.radio_btn_1 = wx.RadioButton(self.notebook_1_pane_1, -1, "Detail")
self.radio_btn_2 = wx.RadioButton(self.notebook_1_pane_1, -1, "List")
self.radio_btn_3 = wx.RadioButton(self.notebook_1_pane_1, -1, "Small Icon")
self.radio_btn_4 = wx.RadioButton(self.notebook_1_pane_1, -1, "Large Icon")
self.button_1 = wx.Button(self.notebook_1_pane_1, -1, "Repopulate")
self.button_2 = wx.Button(self.notebook_1_pane_1, -1, "Add 1000")
self.button_6 = wx.Button(self.notebook_1_pane_1, -1, "&Update selected")
self.button_7 = wx.Button(self.notebook_1_pane_1, -1, "Clear List")
self.button_3 = wx.Button(self.notebook_1_pane_1, -1, "All")
self.button_4 = wx.Button(self.notebook_1_pane_1, -1, "U2's")
self.button_5 = wx.Button(self.notebook_1_pane_1, -1, "None")
self.searchCtrlSimple = wx.SearchCtrl(self.notebook_1_pane_1)
self.text_ctrl_1_copy_copy = wx.TextCtrl(self.notebook_1_pane_2, -1, "This is a more complete example of what an ObjectListView can do. It uses callbacks to: decided the image for the Artist and Rating columns; to format the rows, taking into account any colour or font set for the row (changes to the \"Colour\" and \"Font\" values will effect their row). It also shows listening for cell edit events (the second row cannot be edited; the Artist and Album are text boxes that autocomplete, and the Genre is combo box that also alsocompletes. The Colour and Font columns have custom editors installed.", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_LINEWRAP|wx.TE_WORDWRAP)
self.olvComplex = ObjectListView(self.notebook_1_pane_2, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
self.radio_btn_1_copy = wx.RadioButton(self.notebook_1_pane_2, -1, "Detail")
self.radio_btn_2_copy = wx.RadioButton(self.notebook_1_pane_2, -1, "List")
self.radio_btn_3_copy = wx.RadioButton(self.notebook_1_pane_2, -1, "Small Icon")
self.radio_btn_4_copy = wx.RadioButton(self.notebook_1_pane_2, -1, "Large Icon")
self.button_1_copy = wx.Button(self.notebook_1_pane_2, -1, "Repopulate")
self.button_2_copy = wx.Button(self.notebook_1_pane_2, -1, "Add 1000")
self.button_6_copy = wx.Button(self.notebook_1_pane_2, -1, "&Update selected")
self.button_7_copy_1 = wx.Button(self.notebook_1_pane_2, -1, "Clear List")
self.button_3_copy = wx.Button(self.notebook_1_pane_2, -1, "All")
self.button_4_copy = wx.Button(self.notebook_1_pane_2, -1, "U2's")
self.button_5_copy = wx.Button(self.notebook_1_pane_2, -1, "None")
self.searchCtrlComplex = wx.SearchCtrl(self.notebook_1_pane_2)
self.text_ctrl_1_copy_1_copy = wx.TextCtrl(self.notebook_1_pane_3, -1, "A VirtualObjectListView can handle a large number of rows in virtually constant time. It uses the same manner of defining columns and the aspect the columns should show, but is different in its manner of accessing model objects. Instead of passing it a collection of objects, the programmer tells the control how many objects are in the list, and provides a callback that will provide the model objects when they are required. The downside of a virtual list is that it cannot iterate through its items, so it cannot sort its items.\nThe list below has 10 million rows. Do not try this with a normal list view.", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_LINEWRAP|wx.TE_WORDWRAP)
self.olvVirtual = VirtualObjectListView(self.notebook_1_pane_3, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
self.button_7_copy = wx.Button(self.notebook_1_pane_3, -1, "Repopulate")
self.button_8_copy = wx.Button(self.notebook_1_pane_3, -1, "Add 1000")
self.button_9_copy = wx.Button(self.notebook_1_pane_3, -1, "Update Selected")
self.button_7_copy_2 = wx.Button(self.notebook_1_pane_3, -1, "Clear List")
self.button_10_copy = wx.Button(self.notebook_1_pane_3, -1, "All")
self.button_11_copy = wx.Button(self.notebook_1_pane_3, -1, "None")
self.text_ctrl_1_copy_2 = wx.TextCtrl(self.notebook_1_pane_4, -1, "A FastObjectListView is a compromise between the functionality of an ObjectListView and the speed of a VirtualObjectListView. In many cases, it can be used as a drop in replacement for an ObjectListView. It supports sorting and model-level operations: SelectObject(), RefreshObject(). For a large number of objects, it is much faster than a normal list view.", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_LINEWRAP|wx.TE_WORDWRAP)
self.olvFast = FastObjectListView(self.notebook_1_pane_4, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
self.button_12_copy = wx.Button(self.notebook_1_pane_4, -1, "Repopulate")
self.button_13_copy = wx.Button(self.notebook_1_pane_4, -1, "Add 1000")
self.button_14_copy = wx.Button(self.notebook_1_pane_4, -1, "Update Selected")
self.button_7_copy_3 = wx.Button(self.notebook_1_pane_4, -1, "Clear List")
self.button_15_copy = wx.Button(self.notebook_1_pane_4, -1, "All")
self.button_16_copy = wx.Button(self.notebook_1_pane_4, -1, "U2's")
self.button_17_copy = wx.Button(self.notebook_1_pane_4, -1, "None")
self.searchCtrlFast = wx.SearchCtrl(self.notebook_1_pane_4)
self.text_ctrl_1_copy_2_copy = wx.TextCtrl(self.notebook_1_pane_5, -1, "A GroupListView can partition its objects into logical divisions, and then present those groups to the user. The groups are collapsible. ", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_LINEWRAP|wx.TE_WORDWRAP)
self.olvGroup = GroupListView(self.notebook_1_pane_5, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
self.cbShowGroups = wx.CheckBox(self.notebook_1_pane_5, -1, "Show Groups")
self.cbLockGroup = wx.CheckBox(self.notebook_1_pane_5, -1, "Lock Group")
self.cbShowItemCount = wx.CheckBox(self.notebook_1_pane_5, -1, "Show Item Counts")
self.button_8 = wx.Button(self.notebook_1_pane_5, -1, "Expand All")
self.button_9 = wx.Button(self.notebook_1_pane_5, -1, "Collapse All")
self.button_12_copy_copy = wx.Button(self.notebook_1_pane_5, -1, "Repopulate")
self.button_13_copy_copy = wx.Button(self.notebook_1_pane_5, -1, "Add 1000")
self.button_14_copy_copy = wx.Button(self.notebook_1_pane_5, -1, "Update Selected")
self.button_7_copy_3_copy = wx.Button(self.notebook_1_pane_5, -1, "Clear List")
self.button_15_copy_copy = wx.Button(self.notebook_1_pane_5, -1, "All")
self.button_16_copy_copy = wx.Button(self.notebook_1_pane_5, -1, "U2's")
self.button_17_copy_copy = wx.Button(self.notebook_1_pane_5, -1, "None")
self.searchCtrlGroup = wx.SearchCtrl(self.notebook_1_pane_5)
self.text_ctrl_1_copy_2_copy_copy = wx.TextCtrl(self.notebook_1_pane_6, -1, "A ListCtrlPrinter takes an ObjectListView (or even a plain ListCtrl) and turns it into a nice report, which can be printed and previewed. Using it is as simple as:\n printer = ListCtrlPrinter(self.listCtrlToPrint, \"My Title\")\n printer.PrintPreview()\n\nNOTE: The panel to the right is a wx.PreviewCanvas, which expects to live inside a print preview window, but here it is embedded in a tab control. It mostly works but sometimes throws exceptions (in particular, if you use scroll using a mouse wheel). These exceptions can be safely ignored. In a real app, this panel would be part of the preview frame and thus work properly.", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_LINEWRAP|wx.TE_WORDWRAP)
self.button_10 = wx.Button(self.notebook_1_pane_6, -1, "Print Preview")
self.button_11 = wx.Button(self.notebook_1_pane_6, -1, "Page Setup")
self.button_12 = wx.Button(self.notebook_1_pane_6, -1, "Print")
self.cbSimple = wx.CheckBox(self.notebook_1_pane_6, -1, "Simple")
self.cbComplex = wx.CheckBox(self.notebook_1_pane_6, -1, "Complex")
self.cbFast = wx.CheckBox(self.notebook_1_pane_6, -1, "Fast")
self.cbGroups = wx.CheckBox(self.notebook_1_pane_6, -1, "Groups")
self.radioBoxFormatting = wx.RadioBox(self.notebook_1_pane_6, -1, "Formatting", choices=["Minimal", "Normal", "Over the top"], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
self.cbShrinkToFit = wx.CheckBox(self.notebook_1_pane_6, -1, "Shrink columns to fit within the width of the page")
self.cbIncludeImages = wx.CheckBox(self.notebook_1_pane_6, -1, "Include images in the report")
self.cbWrapCells = wx.CheckBox(self.notebook_1_pane_6, -1, "Wrap long text within cells")
self.cbColumnHeaderOnEachPage = wx.CheckBox(self.notebook_1_pane_6, -1, "Repeat column headers on new pages")
self.cbUseListCtrlTextFormat = wx.CheckBox(self.notebook_1_pane_6, -1, "Take text formatting from list control")
self.tcPageHeaderLeft = wx.TextCtrl(self.notebook_1_pane_6, -1, "Playing with ListCtrl printing")
self.tcPageHeaderCenter = wx.TextCtrl(self.notebook_1_pane_6, -1, "")
self.tcPageHeaderRight = wx.TextCtrl(self.notebook_1_pane_6, -1, "")
self.tcPageFooterLeft = wx.TextCtrl(self.notebook_1_pane_6, -1, "%(date)s")
self.tcPageFooterCenter = wx.TextCtrl(self.notebook_1_pane_6, -1, "")
self.tcPageFooterRight = wx.TextCtrl(self.notebook_1_pane_6, -1, "%(currentPage)d of %(totalPages)d")
self.tcWatermark = wx.TextCtrl(self.notebook_1_pane_6, -1, "Slothful!")
self.watermarkFontCtrl = wx.FontPickerCtrl(self.notebook_1_pane_6, style=wx.FNTP_FONTDESC_AS_LABEL|wx.FNTP_USE_TEXTCTRL)
self.watermarkColorCtrl = wx.ColourPickerCtrl(self.notebook_1_pane_6, style=wx.CLRP_USE_TEXTCTRL)
self.cbWatermarkOnTop = wx.CheckBox(self.notebook_1_pane_6, -1, "Watermark on top")
self.button_13 = wx.Button(self.notebook_1_pane_6, -1, "| <<")
self.button_13_copy_1 = wx.Button(self.notebook_1_pane_6, -1, "<<")
self.button_13_copy_2 = wx.Button(self.notebook_1_pane_6, -1, ">>")
self.button_13_copy_2_copy = wx.Button(self.notebook_1_pane_6, -1, ">> |")
self.choiceZoom = wx.Choice(self.notebook_1_pane_6, -1, choices=["25%", "50%", "75%", "100%", "150%", "200%", "400%"])
self.previewCanvas = wx.PreviewCanvas(self.printPreview, self.notebook_1_pane_6)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewDetails, self.radio_btn_1)
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewList, self.radio_btn_2)
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewSmallIcon, self.radio_btn_3)
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewLargeIcon, self.radio_btn_4)
self.Bind(wx.EVT_BUTTON, self.OnRepopulate, self.button_1)
self.Bind(wx.EVT_BUTTON, self.OnAdd1000, self.button_2)
self.Bind(wx.EVT_BUTTON, self.OnUpdateSelected, self.button_6)
self.Bind(wx.EVT_BUTTON, self.OnClearListSimple, self.button_7)
self.Bind(wx.EVT_BUTTON, self.OnSelectAll, self.button_3)
self.Bind(wx.EVT_BUTTON, self.OnSelectU2s, self.button_4)
self.Bind(wx.EVT_BUTTON, self.OnSelectNone, self.button_5)
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewDetailsComplex, self.radio_btn_1_copy)
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewListComplex, self.radio_btn_2_copy)
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewSmallIconComplex, self.radio_btn_3_copy)
self.Bind(wx.EVT_RADIOBUTTON, self.OnListViewLargeIconComplex, self.radio_btn_4_copy)
self.Bind(wx.EVT_BUTTON, self.OnRepopulateComplex, self.button_1_copy)
self.Bind(wx.EVT_BUTTON, self.OnAdd1000Complex, self.button_2_copy)
self.Bind(wx.EVT_BUTTON, self.OnUpdateSelectedComplex, self.button_6_copy)
self.Bind(wx.EVT_BUTTON, self.OnClearListComplex, self.button_7_copy_1)
self.Bind(wx.EVT_BUTTON, self.OnSelectAllComplex, self.button_3_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectU2sComplex, self.button_4_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectNoneComplex, self.button_5_copy)
self.Bind(wx.EVT_BUTTON, self.OnRepopulateVirtual, self.button_7_copy)
self.Bind(wx.EVT_BUTTON, self.OnAdd1000Virtual, self.button_8_copy)
self.Bind(wx.EVT_BUTTON, self.OnUpdateSelectedVirtual, self.button_9_copy)
self.Bind(wx.EVT_BUTTON, self.OnClearListVirtual, self.button_7_copy_2)
self.Bind(wx.EVT_BUTTON, self.OnSelectAllVirtual, self.button_10_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectNoneVirtual, self.button_11_copy)
self.Bind(wx.EVT_BUTTON, self.OnRepopulateFast, self.button_12_copy)
self.Bind(wx.EVT_BUTTON, self.OnAdd1000Fast, self.button_13_copy)
self.Bind(wx.EVT_BUTTON, self.OnUpdateSelectedFast, self.button_14_copy)
self.Bind(wx.EVT_BUTTON, self.OnClearListFast, self.button_7_copy_3)
self.Bind(wx.EVT_BUTTON, self.OnSelectAllFast, self.button_15_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectU2sFast, self.button_16_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectNoneFast, self.button_17_copy)
self.Bind(wx.EVT_CHECKBOX, self.OnShowGroupChecked, self.cbShowGroups)
self.Bind(wx.EVT_CHECKBOX, self.OnLockGroupChecked, self.cbLockGroup)
self.Bind(wx.EVT_CHECKBOX, self.OnShowItemCountChecked, self.cbShowItemCount)
self.Bind(wx.EVT_BUTTON, self.OnExpandAllGroups, self.button_8)
self.Bind(wx.EVT_BUTTON, self.OnCollapseAllGroups, self.button_9)
self.Bind(wx.EVT_BUTTON, self.OnRepopulateGroup, self.button_12_copy_copy)
self.Bind(wx.EVT_BUTTON, self.OnAdd1000Group, self.button_13_copy_copy)
self.Bind(wx.EVT_BUTTON, self.OnUpdateSelectedGroup, self.button_14_copy_copy)
self.Bind(wx.EVT_BUTTON, self.OnClearListGroup, self.button_7_copy_3_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectAllGroup, self.button_15_copy_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectU2sGroup, self.button_16_copy_copy)
self.Bind(wx.EVT_BUTTON, self.OnSelectNoneGroup, self.button_17_copy_copy)
self.Bind(wx.EVT_BUTTON, self.OnPrintPreview, self.button_10)
self.Bind(wx.EVT_BUTTON, self.OnPageSetup, self.button_11)
self.Bind(wx.EVT_BUTTON, self.OnPrint, self.button_12)
self.Bind(wx.EVT_CHECKBOX, self.OnSourceChange, self.cbSimple)
self.Bind(wx.EVT_CHECKBOX, self.OnSourceChange, self.cbComplex)
self.Bind(wx.EVT_CHECKBOX, self.OnSourceChange, self.cbFast)
self.Bind(wx.EVT_CHECKBOX, self.OnSourceChange, self.cbGroups)
self.Bind(wx.EVT_RADIOBOX, self.OnFormatting, self.radioBoxFormatting)
self.Bind(wx.EVT_CHECKBOX, self.OnPreviewOptionChange, self.cbShrinkToFit)
self.Bind(wx.EVT_CHECKBOX, self.OnPreviewOptionChange, self.cbIncludeImages)
self.Bind(wx.EVT_CHECKBOX, self.OnPreviewOptionChange, self.cbWrapCells)
self.Bind(wx.EVT_CHECKBOX, self.OnPreviewOptionChange, self.cbColumnHeaderOnEachPage)
self.Bind(wx.EVT_CHECKBOX, self.OnPreviewOptionChange, self.cbUseListCtrlTextFormat)
self.Bind(wx.EVT_TEXT, self.OnPrintingTextChanged, self.tcPageHeaderLeft)
self.Bind(wx.EVT_TEXT, self.OnPrintingTextChanged, self.tcPageHeaderCenter)
self.Bind(wx.EVT_TEXT, self.OnPrintingTextChanged, self.tcPageHeaderRight)
self.Bind(wx.EVT_TEXT, self.OnPrintingTextChanged, self.tcPageFooterLeft)
self.Bind(wx.EVT_TEXT, self.OnPrintingTextChanged, self.tcPageFooterCenter)
self.Bind(wx.EVT_TEXT, self.OnPrintingTextChanged, self.tcPageFooterRight)
self.Bind(wx.EVT_TEXT, self.OnPrintingTextChanged, self.tcWatermark)
self.Bind(wx.EVT_CHECKBOX, self.OnWatermarkOnTop, self.cbWatermarkOnTop)
self.Bind(wx.EVT_BUTTON, self.OnFirstPage, self.button_13)
self.Bind(wx.EVT_BUTTON, self.OnPreviousPage, self.button_13_copy_1)
self.Bind(wx.EVT_BUTTON, self.OnNextPage, self.button_13_copy_2)
self.Bind(wx.EVT_BUTTON, self.OnLastPage, self.button_13_copy_2_copy)
self.Bind(wx.EVT_CHOICE, self.OnZoom, self.choiceZoom)
# end wxGlade
self.Init()
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("ObjectListView Demo")
self.SetSize((1274, 788))
self.frame_1_statusbar.SetStatusWidths([-1])
# statusbar fields
frame_1_statusbar_fields = ["frame_1_statusbar"]
for i in range(len(frame_1_statusbar_fields)):
self.frame_1_statusbar.SetStatusText(frame_1_statusbar_fields[i], i)
self.text_ctrl_1_copy.SetBackgroundColour(wx.Colour(252, 255, 138))
self.radio_btn_1.SetValue(1)
self.searchCtrlSimple.SetMinSize((150, -1))
self.text_ctrl_1_copy_copy.SetBackgroundColour(wx.Colour(252, 255, 138))
self.radio_btn_1_copy.SetValue(1)
self.searchCtrlComplex.SetMinSize((150, -1))
self.text_ctrl_1_copy_1_copy.SetBackgroundColour(wx.Colour(252, 255, 138))
self.text_ctrl_1_copy_2.SetBackgroundColour(wx.Colour(252, 255, 138))
self.searchCtrlFast.SetMinSize((150, -1))
self.text_ctrl_1_copy_2_copy.SetBackgroundColour(wx.Colour(252, 255, 138))
self.cbShowGroups.SetToolTipString("Show or hide groups in the control")
self.cbShowGroups.SetValue(1)
self.cbLockGroup.SetToolTipString("Lock the current groups. Sorting by a different column will change the sort order within the groups, but not the groups themselves")
self.cbShowItemCount.SetToolTipString("Show item counts in the group titles")
self.cbShowItemCount.SetValue(1)
self.searchCtrlGroup.SetMinSize((150, -1))
self.text_ctrl_1_copy_2_copy_copy.SetBackgroundColour(wx.Colour(252, 255, 138))
self.cbGroups.SetValue(1)
self.radioBoxFormatting.SetSelection(1)
self.cbIncludeImages.SetValue(1)
self.cbColumnHeaderOnEachPage.SetValue(1)
self.choiceZoom.SetSelection(2)
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
grid_sizer_1 = wx.FlexGridSizer(1, 2, 4, 4)
sizer_16 = wx.BoxSizer(wx.HORIZONTAL)
grid_sizer_3 = wx.FlexGridSizer(2, 1, 0, 0)
sizer_9_copy_1 = wx.FlexGridSizer(1, 6, 0, 0)
grid_sizer_4 = wx.FlexGridSizer(5, 1, 4, 0)
sizer_9 = wx.StaticBoxSizer(self.sizer_9_staticbox, wx.HORIZONTAL)
grid_sizer_5 = wx.FlexGridSizer(4, 2, 0, 2)
sizer_17 = wx.StaticBoxSizer(self.sizer_17_staticbox, wx.HORIZONTAL)
grid_sizer_2 = wx.FlexGridSizer(2, 2, 2, 4)
sizer_14 = wx.GridSizer(1, 3, 0, 0)
sizer_13 = wx.GridSizer(1, 3, 0, 0)
grid_sizer_1_copy_1 = wx.FlexGridSizer(1, 3, 0, 4)
sizer_15 = wx.StaticBoxSizer(self.sizer_15_staticbox, wx.VERTICAL)
sizer_10 = wx.StaticBoxSizer(self.sizer_10_staticbox, wx.VERTICAL)
sizer_18 = wx.StaticBoxSizer(self.sizer_18_staticbox, wx.HORIZONTAL)
grid_sizer_3_copy_copy = wx.FlexGridSizer(3, 1, 4, 4)
grid_sizer_4_copy_copy = wx.FlexGridSizer(1, 4, 4, 4)
sizer_11_copy_copy_1 = wx.StaticBoxSizer(self.sizer_11_copy_copy_1_staticbox, wx.HORIZONTAL)
sizer_10_copy_copy = wx.StaticBoxSizer(self.sizer_10_copy_copy_staticbox, wx.HORIZONTAL)
sizer_9_copy_copy = wx.StaticBoxSizer(self.sizer_9_copy_copy_staticbox, wx.HORIZONTAL)
sizer_7 = wx.StaticBoxSizer(self.sizer_7_staticbox, wx.HORIZONTAL)
sizer_8 = wx.BoxSizer(wx.VERTICAL)
grid_sizer_3_copy = wx.FlexGridSizer(3, 1, 4, 4)
grid_sizer_4_copy = wx.FlexGridSizer(1, 3, 4, 4)
sizer_11_copy_copy = wx.StaticBoxSizer(self.sizer_11_copy_copy_staticbox, wx.HORIZONTAL)
sizer_10_copy = wx.StaticBoxSizer(self.sizer_10_copy_staticbox, wx.HORIZONTAL)
sizer_9_copy = wx.StaticBoxSizer(self.sizer_9_copy_staticbox, wx.HORIZONTAL)
grid_sizer_1_copy = wx.FlexGridSizer(3, 1, 4, 4)
grid_sizer_2_copy = wx.FlexGridSizer(1, 2, 4, 4)
sizer_8_copy = wx.StaticBoxSizer(self.sizer_8_copy_staticbox, wx.HORIZONTAL)
sizer_7_copy = wx.StaticBoxSizer(self.sizer_7_copy_staticbox, wx.HORIZONTAL)
sizer_2_copy = wx.FlexGridSizer(3, 1, 0, 0)
sizer_3_copy = wx.FlexGridSizer(1, 4, 0, 0)
sizer_11 = wx.StaticBoxSizer(self.sizer_11_staticbox, wx.HORIZONTAL)
sizer_6_copy = wx.StaticBoxSizer(self.sizer_6_copy_staticbox, wx.HORIZONTAL)
sizer_5_copy = wx.StaticBoxSizer(self.sizer_5_copy_staticbox, wx.HORIZONTAL)
sizer_4_copy = wx.StaticBoxSizer(self.sizer_4_copy_staticbox, wx.HORIZONTAL)
sizer_2 = wx.FlexGridSizer(3, 1, 0, 0)
sizer_3 = wx.FlexGridSizer(1, 4, 0, 0)
sizer_11_copy = wx.StaticBoxSizer(self.sizer_11_copy_staticbox, wx.HORIZONTAL)
sizer_6 = wx.StaticBoxSizer(self.sizer_6_staticbox, wx.HORIZONTAL)
sizer_5 = wx.StaticBoxSizer(self.sizer_5_staticbox, wx.HORIZONTAL)
sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.HORIZONTAL)
sizer_2.Add(self.text_ctrl_1_copy, 0, wx.TOP|wx.EXPAND, 4)
sizer_2.Add(self.olvSimple, 1, wx.ALL|wx.EXPAND, 4)
sizer_4.Add(self.radio_btn_1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_4.Add(self.radio_btn_2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_4.Add(self.radio_btn_3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_4.Add(self.radio_btn_4, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_3.Add(sizer_4, 1, wx.ALL|wx.EXPAND, 4)
sizer_5.Add(self.button_1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_5.Add(self.button_2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_5.Add(self.button_6, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_5.Add(self.button_7, 0, wx.ALL, 4)
sizer_3.Add(sizer_5, 1, wx.ALL|wx.EXPAND, 4)
sizer_6.Add(self.button_3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_6.Add(self.button_4, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_6.Add(self.button_5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_3.Add(sizer_6, 1, wx.ALL|wx.EXPAND, 4)
sizer_11_copy.Add(self.searchCtrlSimple, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_3.Add(sizer_11_copy, 1, wx.ALL|wx.EXPAND, 4)
sizer_2.Add(sizer_3, 1, wx.EXPAND, 4)
self.notebook_1_pane_1.SetSizer(sizer_2)
sizer_2.AddGrowableRow(1)
sizer_2.AddGrowableCol(0)
sizer_2_copy.Add(self.text_ctrl_1_copy_copy, 0, wx.TOP|wx.EXPAND, 4)
sizer_2_copy.Add(self.olvComplex, 1, wx.ALL|wx.EXPAND, 4)
sizer_4_copy.Add(self.radio_btn_1_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_4_copy.Add(self.radio_btn_2_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_4_copy.Add(self.radio_btn_3_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_4_copy.Add(self.radio_btn_4_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_3_copy.Add(sizer_4_copy, 1, wx.ALL|wx.EXPAND, 4)
sizer_5_copy.Add(self.button_1_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_5_copy.Add(self.button_2_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_5_copy.Add(self.button_6_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_5_copy.Add(self.button_7_copy_1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_3_copy.Add(sizer_5_copy, 1, wx.ALL|wx.EXPAND, 4)
sizer_6_copy.Add(self.button_3_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_6_copy.Add(self.button_4_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_6_copy.Add(self.button_5_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_3_copy.Add(sizer_6_copy, 1, wx.ALL|wx.EXPAND, 4)
sizer_11.Add(self.searchCtrlComplex, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_3_copy.Add(sizer_11, 1, wx.ALL|wx.EXPAND, 4)
sizer_2_copy.Add(sizer_3_copy, 1, wx.EXPAND, 4)
self.notebook_1_pane_2.SetSizer(sizer_2_copy)
sizer_2_copy.AddGrowableRow(1)
sizer_2_copy.AddGrowableCol(0)
grid_sizer_1_copy.Add(self.text_ctrl_1_copy_1_copy, 0, wx.TOP|wx.EXPAND, 4)
grid_sizer_1_copy.Add(self.olvVirtual, 1, wx.EXPAND, 0)
sizer_7_copy.Add(self.button_7_copy, 0, wx.ALL, 4)
sizer_7_copy.Add(self.button_8_copy, 0, wx.ALL, 4)
sizer_7_copy.Add(self.button_9_copy, 0, wx.ALL, 4)
sizer_7_copy.Add(self.button_7_copy_2, 0, wx.ALL, 4)
grid_sizer_2_copy.Add(sizer_7_copy, 1, wx.EXPAND, 0)
sizer_8_copy.Add(self.button_10_copy, 0, wx.ALL, 4)
sizer_8_copy.Add(self.button_11_copy, 0, wx.ALL, 4)
grid_sizer_2_copy.Add(sizer_8_copy, 1, wx.EXPAND, 0)
grid_sizer_1_copy.Add(grid_sizer_2_copy, 1, wx.EXPAND, 0)
self.notebook_1_pane_3.SetSizer(grid_sizer_1_copy)
grid_sizer_1_copy.AddGrowableRow(1)
grid_sizer_1_copy.AddGrowableCol(0)
grid_sizer_3_copy.Add(self.text_ctrl_1_copy_2, 0, wx.TOP|wx.EXPAND, 4)
grid_sizer_3_copy.Add(self.olvFast, 1, wx.EXPAND, 0)
sizer_9_copy.Add(self.button_12_copy, 0, wx.ALL, 4)
sizer_9_copy.Add(self.button_13_copy, 0, wx.ALL, 4)
sizer_9_copy.Add(self.button_14_copy, 0, wx.ALL, 4)
sizer_9_copy.Add(self.button_7_copy_3, 0, wx.ALL, 4)
grid_sizer_4_copy.Add(sizer_9_copy, 1, wx.EXPAND, 0)
sizer_10_copy.Add(self.button_15_copy, 0, wx.ALL, 4)
sizer_10_copy.Add(self.button_16_copy, 0, wx.ALL, 4)
sizer_10_copy.Add(self.button_17_copy, 0, wx.ALL, 4)
grid_sizer_4_copy.Add(sizer_10_copy, 1, wx.EXPAND, 0)
sizer_11_copy_copy.Add(self.searchCtrlFast, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_4_copy.Add(sizer_11_copy_copy, 1, wx.ALL|wx.EXPAND, 4)
grid_sizer_3_copy.Add(grid_sizer_4_copy, 1, wx.EXPAND, 0)
self.notebook_1_pane_4.SetSizer(grid_sizer_3_copy)
grid_sizer_3_copy.AddGrowableRow(1)
grid_sizer_3_copy.AddGrowableCol(0)
grid_sizer_3_copy_copy.Add(self.text_ctrl_1_copy_2_copy, 0, wx.TOP|wx.EXPAND, 4)
grid_sizer_3_copy_copy.Add(self.olvGroup, 1, wx.EXPAND, 0)
sizer_8.Add(self.cbShowGroups, 0, wx.ALL, 2)
sizer_8.Add(self.cbLockGroup, 0, wx.ALL, 2)
sizer_8.Add(self.cbShowItemCount, 0, wx.ALL, 2)
sizer_7.Add(sizer_8, 1, wx.EXPAND, 0)
sizer_7.Add(self.button_8, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_7.Add(self.button_9, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_4_copy_copy.Add(sizer_7, 1, wx.EXPAND, 0)
sizer_9_copy_copy.Add(self.button_12_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_9_copy_copy.Add(self.button_13_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_9_copy_copy.Add(self.button_14_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_9_copy_copy.Add(self.button_7_copy_3_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_4_copy_copy.Add(sizer_9_copy_copy, 1, wx.EXPAND, 0)
sizer_10_copy_copy.Add(self.button_15_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_10_copy_copy.Add(self.button_16_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_10_copy_copy.Add(self.button_17_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_4_copy_copy.Add(sizer_10_copy_copy, 1, wx.EXPAND, 0)
sizer_11_copy_copy_1.Add(self.searchCtrlGroup, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_4_copy_copy.Add(sizer_11_copy_copy_1, 1, wx.ALL|wx.EXPAND, 4)
grid_sizer_3_copy_copy.Add(grid_sizer_4_copy_copy, 1, wx.EXPAND, 0)
self.notebook_1_pane_5.SetSizer(grid_sizer_3_copy_copy)
grid_sizer_3_copy_copy.AddGrowableRow(1)
grid_sizer_3_copy_copy.AddGrowableCol(0)
grid_sizer_4.Add(self.text_ctrl_1_copy_2_copy_copy, 0, wx.BOTTOM|wx.EXPAND, 4)
sizer_18.Add(self.button_10, 0, wx.ALL, 4)
sizer_18.Add(self.button_11, 0, wx.ALL, 4)
sizer_18.Add(self.button_12, 0, wx.ALL, 4)
grid_sizer_4.Add(sizer_18, 1, wx.EXPAND, 0)
sizer_10.Add(self.cbSimple, 0, wx.ALL, 4)
sizer_10.Add(self.cbComplex, 0, wx.ALL, 4)
sizer_10.Add(self.cbFast, 0, wx.ALL, 4)
sizer_10.Add(self.cbGroups, 0, wx.ALL, 4)
grid_sizer_1_copy_1.Add(sizer_10, 1, wx.EXPAND, 0)
grid_sizer_1_copy_1.Add(self.radioBoxFormatting, 0, wx.EXPAND, 0)
sizer_15.Add(self.cbShrinkToFit, 0, wx.ALL, 4)
sizer_15.Add(self.cbIncludeImages, 0, wx.ALL, 4)
sizer_15.Add(self.cbWrapCells, 0, wx.ALL, 4)
sizer_15.Add(self.cbColumnHeaderOnEachPage, 0, wx.ALL, 4)
sizer_15.Add(self.cbUseListCtrlTextFormat, 0, wx.ALL, 4)
grid_sizer_1_copy_1.Add(sizer_15, 1, wx.EXPAND, 0)
grid_sizer_4.Add(grid_sizer_1_copy_1, 1, 0, 0)
label_2 = wx.StaticText(self.notebook_1_pane_6, -1, "Page Header:")
grid_sizer_2.Add(label_2, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_13.Add(self.tcPageHeaderLeft, 0, wx.ALL|wx.EXPAND, 2)
sizer_13.Add(self.tcPageHeaderCenter, 0, wx.ALL|wx.EXPAND, 2)
sizer_13.Add(self.tcPageHeaderRight, 0, wx.ALL|wx.EXPAND, 2)
grid_sizer_2.Add(sizer_13, 1, wx.EXPAND, 0)
label_3 = wx.StaticText(self.notebook_1_pane_6, -1, "Page Footer:")
grid_sizer_2.Add(label_3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_14.Add(self.tcPageFooterLeft, 0, wx.ALL|wx.EXPAND, 2)
sizer_14.Add(self.tcPageFooterCenter, 0, wx.ALL|wx.EXPAND, 2)
sizer_14.Add(self.tcPageFooterRight, 0, wx.ALL|wx.EXPAND, 2)
grid_sizer_2.Add(sizer_14, 1, wx.EXPAND, 0)
grid_sizer_2.AddGrowableCol(1)
sizer_17.Add(grid_sizer_2, 1, wx.EXPAND, 0)
grid_sizer_4.Add(sizer_17, 1, wx.EXPAND, 0)
label_2_copy_copy = wx.StaticText(self.notebook_1_pane_6, -1, "Watermark Text:")
grid_sizer_5.Add(label_2_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_5.Add(self.tcWatermark, 0, wx.ALL|wx.EXPAND, 2)
label_2_copy_copy_copy = wx.StaticText(self.notebook_1_pane_6, -1, "Font:")
grid_sizer_5.Add(label_2_copy_copy_copy, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_5.Add(self.watermarkFontCtrl, 1, wx.ALL|wx.EXPAND, 2)
label_2_copy_copy_copy_1 = wx.StaticText(self.notebook_1_pane_6, -1, "Color:")
grid_sizer_5.Add(label_2_copy_copy_copy_1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
grid_sizer_5.Add(self.watermarkColorCtrl, 1, wx.ALL|wx.EXPAND, 2)
grid_sizer_5.Add((16, 20), 0, 0, 0)
grid_sizer_5.Add(self.cbWatermarkOnTop, 0, wx.ALL, 2)
grid_sizer_5.AddGrowableCol(1)
sizer_9.Add(grid_sizer_5, 1, wx.EXPAND, 0)
grid_sizer_4.Add(sizer_9, 1, wx.EXPAND, 0)
grid_sizer_1.Add(grid_sizer_4, 1, wx.EXPAND, 0)
sizer_9_copy_1.Add(self.button_13, 0, wx.ALL, 4)
sizer_9_copy_1.Add(self.button_13_copy_1, 0, wx.ALL, 4)
sizer_9_copy_1.Add(self.button_13_copy_2, 0, wx.ALL, 4)
sizer_9_copy_1.Add(self.button_13_copy_2_copy, 0, wx.ALL, 4)
label_4 = wx.StaticText(self.notebook_1_pane_6, -1, "Zoom:")
sizer_9_copy_1.Add(label_4, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4)
sizer_9_copy_1.Add(self.choiceZoom, 0, wx.ALL, 4)
grid_sizer_3.Add(sizer_9_copy_1, 1, wx.EXPAND, 0)
grid_sizer_3.Add(self.previewCanvas, 1, wx.EXPAND, 0)
grid_sizer_3.AddGrowableRow(1)
grid_sizer_3.AddGrowableCol(0)
sizer_16.Add(grid_sizer_3, 1, wx.EXPAND, 0)
grid_sizer_1.Add(sizer_16, 1, wx.EXPAND, 0)
self.notebook_1_pane_6.SetSizer(grid_sizer_1)
grid_sizer_1.AddGrowableRow(0)
grid_sizer_1.AddGrowableCol(1)
self.notebook_1.AddPage(self.notebook_1_pane_1, "Simple")
self.notebook_1.AddPage(self.notebook_1_pane_2, "Complex")
self.notebook_1.AddPage(self.notebook_1_pane_3, "Virtual")
self.notebook_1.AddPage(self.notebook_1_pane_4, "Fast")
self.notebook_1.AddPage(self.notebook_1_pane_5, "Groups")
self.notebook_1.AddPage(self.notebook_1_pane_6, "ListCtrl Printing")
sizer_1.Add(self.notebook_1, 1, wx.ALL|wx.EXPAND, 4)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
#----------------------------------------------------------------------
# Initialize
def PreInit(self):
"Do these initializations before creating any widgets"
self.InitPrinting()
def Init(self):
"Initialize the application once the UI widgets have been constructed"
self.InitModel()
self.InitUI()
self.InitSearchCtrls()
self.InitPrintPreview()
def InitModel(self):
"Initialize the model objects that the app will use. These would normally be stored in a db"
self.counter = 0
self.dataObjects = [
Track(title="Zoo Station", artist="U2", size=5.5, album="Achtung Baby", genre="Rock", rating=60, duration="4:37", lastPlayed="21/10/2007 5:42"),
Track(title="Who's Gonna Ride Your Wild Horses", artist="U2", size=6.3, album="Achtung Baby", genre="Rock", rating=80, duration="5:17", lastPlayed="9/10/2007 11:32"),
Track(title="So Cruel", artist="U2", size=6.9, album="Achtung Baby", genre="Rock", rating=60, duration="5:49", lastPlayed="9/10/2007 11:38"),
Track(title="The Fly", artist="U2", size=5.4, album="Achtung Baby", genre="Rock", rating=60, duration="4:29", lastPlayed="9/10/2007 11:42"),
Track(title="Tryin' To Throw Your Arms Around The World", artist="U2", size=4.7, album="Achtung Baby", genre="Rock", rating=60, duration="3:53", lastPlayed="9/10/2007 11:46"),
Track(title="Ultraviolet (Light My Way)", artist="U2", size=6.6, album="Achtung Baby", genre="Rock", rating=60, duration="5:31", lastPlayed="9/10/2007 11:52"),
Track(title="Acrobat", artist="U2", size=5.4, album="Achtung Baby", genre="Rock", rating=60, duration="4:30", lastPlayed="9/10/2007 11:56"),
Track(title="Love Is Blindness", artist="U2", size=5.3, album="Achtung Baby", genre="Rock", rating=60, duration="4:26", lastPlayed="9/10/2007 12:00"),
Track(title="Elevation", artist="U2", size=4.5, album="All That You Can't Leave Behind", genre="Rock", rating=60, duration="3:48", lastPlayed="25/01/2008 11:46"),
Track(title="Walk On", artist="U2", size=5.8, album="All That You Can't Leave Behind", genre="Rock", rating=100, duration="4:56", lastPlayed="18/03/2008 11:39"),
Track(title="Kite", artist="U2", size=5.2, album="All That You Can't Leave Behind", genre="Rock", rating=40, duration="4:27", lastPlayed="23/01/2008 10:36"),
Track(title="In A Little While", artist="U2", size=4.3, album="All That You Can't Leave Behind", genre="Rock", rating=60, duration="3:39", lastPlayed="20/01/2008 7:48"),
Track(title="Wild Honey", artist="U2", size=4.5, album="All That You Can't Leave Behind", genre="Rock", rating=40, duration="3:47", lastPlayed="13/04/2007 11:50"),
Track(title="Peace On Earth", artist="U2", size=5.6, album="All That You Can't Leave Behind", genre="Rock", rating=40, duration="4:48", lastPlayed="22/12/2007 2:51"),
Track(title="When I Look At The World", artist="U2", size=5.1, album="All That You Can't Leave Behind", genre="Rock", rating=40, duration="4:18", lastPlayed="22/12/2007 2:55"),
Track(title="New York", artist="U2", size=6.4, album="All That You Can't Leave Behind", genre="Rock", rating=60, duration="5:30", lastPlayed="22/12/2007 3:01"),
Track(title="Grace", artist="U2", size=6.5, album="All That You Can't Leave Behind", genre="Rock", rating=40, duration="5:32", lastPlayed="22/12/2007 3:06"),
Track(title="The Ground Beneath Her Feet(Bonus Track)", artist="U2", size=4.4, album="All That You Can't Leave Behind", genre="Rock", rating=40, duration="3:44", lastPlayed="22/12/2007 3:10"),
Track(title="Follow You Home", artist="Nickelback", size=6, album="All The Right Reasons", genre="Rock", rating=40, duration="4:20", lastPlayed="6/03/2008 10:42"),
Track(title="Fight For All The Wrong Reason", artist="Nickelback", size=5.2, album="All The Right Reasons", genre="Rock", rating=60, duration="3:44", lastPlayed="15/03/2008 5:04"),
Track(title="Photograph", artist="Nickelback", size=6, album="All The Right Reasons", genre="Rock", rating=60, duration="4:19", lastPlayed="15/03/2008 5:08"),
Track(title="Animals", artist="Nickelback", size=4.3, album="All The Right Reasons", genre="Rock", rating=40, duration="3:07", lastPlayed="16/02/2008 12:12"),
Track(title="Savin' Me", artist="Nickelback", size=5.1, album="All The Right Reasons", genre="Rock", rating=80, duration="3:39", lastPlayed="24/03/2008 10:41"),
Track(title="Far Away", artist="Nickelback", size=5.5, album="All The Right Reasons", genre="Rock", rating=40, duration="3:58", lastPlayed="15/03/2008 5:30"),
Track(title="Next Contestant", artist="Nickelback", size=5, album="All The Right Reasons", genre="Rock", rating=80, duration="3:35", lastPlayed="24/03/2008 9:47"),
Track(title="Side Of A Bullet", artist="Nickelback", size=4.2, album="All The Right Reasons", genre="Rock", rating=40, duration="3:01", lastPlayed="6/03/2008 11:00"),
Track(title="If Everyone Cared", artist="Nickelback", size=5, album="All The Right Reasons", genre="Rock", rating=60, duration="3:38", lastPlayed="6/03/2008 11:03"),
Track(title="Someone That You're With", artist="Nickelback", size=5.6, album="All The Right Reasons", genre="Rock", rating=40, duration="4:02", lastPlayed="16/02/2008 12:34"),
Track(title="Rockstar", artist="Nickelback", size=5.9, album="All The Right Reasons", genre="Rock", rating=60, duration="4:16", lastPlayed="16/02/2008 12:38"),
Track(title="Lelani", artist="Hoodoo Gurus", size=5.9, album="Ampology", genre="Rock", rating=60, duration="4:55", lastPlayed="22/10/2007 8:45"),
Track(title="Tojo", artist="Hoodoo Gurus", size=4.1, album="Ampology", genre="Rock", rating=60, duration="3:22", lastPlayed="22/10/2007 8:48"),
Track(title="My Girl", artist="Hoodoo Gurus", size=3.3, album="Ampology", genre="Rock", rating=80, duration="2:39", lastPlayed="12/11/2007 7:57"),
Track(title="Be My Guru", artist="Hoodoo Gurus", size=3.3, album="Ampology", genre="Rock", rating=100, duration="2:39", lastPlayed="20/03/2008 12:15"),
Track(title="I Want You Back", artist="Hoodoo Gurus", size=3.9, album="Ampology", genre="Rock", rating=80, duration="3:12", lastPlayed="12/11/2007 7:42"),
Track(title="I Was A Kamikaze Pilot", artist="Hoodoo Gurus", size=3.9, album="Ampology", genre="Rock", rating=60, duration="3:10", lastPlayed="22/10/2007 9:00"),
Track(title="Bittersweet", artist="Hoodoo Gurus", size=4.7, album="Ampology", genre="Rock", rating=60, duration="3:52", lastPlayed="22/10/2007 9:04"),
Track(title="Poison Pen", artist="Hoodoo Gurus", size=5, album="Ampology", genre="Rock", rating=60, duration="4:11", lastPlayed="22/10/2007 9:11"),
Track(title="In The Wild", artist="Hoodoo Gurus", size=3.9, album="Ampology", genre="Rock", rating=60, duration="3:12", lastPlayed="22/10/2007 9:14"),
Track(title="Whats My Scene?", artist="Hoodoo Gurus", size=4.6, album="Ampology", genre="Rock", rating=100, duration="3:49", lastPlayed="12/11/2007 7:51"),
Track(title="Heart Of Darkness", artist="Hoodoo Gurus", size=3.8, album="Ampology", genre="Rock", rating=60, duration="3:04", lastPlayed="22/10/2007 9:21"),
Track(title="Good Times", artist="Hoodoo Gurus", size=3.7, album="Ampology", genre="Rock", rating=80, duration="3:02", lastPlayed="20/03/2008 12:18"),
Track(title="Cajun Country", artist="Hoodoo Gurus", size=4.9, album="Ampology", genre="Rock", rating=60, duration="4:06", lastPlayed="22/10/2007 9:28"),
Track(title="Axegrinder", artist="Hoodoo Gurus", size=4.2, album="Ampology", genre="Rock", rating=60, duration="3:26", lastPlayed="22/10/2007 9:32"),
Track(title="Another World", artist="Hoodoo Gurus", size=4, album="Ampology", genre="Rock", rating=80, duration="3:16", lastPlayed="20/03/2008 12:21"),
Track(title="Meant To Live", artist="Switchfoot", size=4, album="The Beautiful Letdown", genre="Gospel & Religious", rating=100, duration="3:26", lastPlayed="3/03/2008 1:46"),
Track(title="This Is Your Life", artist="Switchfoot", size=4, album="The Beautiful Letdown", genre="Gospel & Religious", rating=100, duration="4:18", lastPlayed="3/03/2008 2:11"),
Track(title="More than fine", artist="Switchfoot", size=4.9, album="The Beautiful Letdown", genre="Gospel & Religious", rating=60, duration="4:15", lastPlayed="3/03/2008 2:16"),
Track(title="Ammunition", artist="Switchfoot", size=4.4, album="The Beautiful Letdown", genre="Gospel & Religious", rating=40, duration="3:46", lastPlayed="3/03/2008 1:58"),
Track(title="Dare you to move", artist="Switchfoot", size=4.9, album="The Beautiful Letdown", genre="Gospel & Religious", rating=80, duration="4:15", lastPlayed="3/03/2008 2:20"),
Track(title="Redemption", artist="Switchfoot", size=3.6, album="The Beautiful Letdown", genre="Gospel & Religious", rating=80, duration="3:07", lastPlayed="19/03/2008 5:19"),
Track(title="The beautiful letdown", artist="Switchfoot", size=6.2, album="The Beautiful Letdown", genre="Gospel & Religious", rating=60, duration="5:21", lastPlayed="3/03/2008 2:29"),
Track(title="Gone", artist="Switchfoot", size=4.4, album="The Beautiful Letdown", genre="Gospel & Religious", rating=80, duration="3:46", lastPlayed="3/03/2008 2:33"),
Track(title="On Fire", artist="Switchfoot", size=4.3, album="The Beautiful Letdown", genre="Gospel & Religious", rating=80, duration="4:39", lastPlayed="3/03/2008 2:37"),
Track(title="Adding to the noise", artist="Switchfoot", size=3.3, album="The Beautiful Letdown", genre="Gospel & Religious", rating=60, duration="2:51", lastPlayed="19/03/2008 5:42"),
Track(title="Twenty-four", artist="Switchfoot", size=5.7, album="The Beautiful Letdown", genre="Gospel & Religious", rating=60, duration="4:54", lastPlayed="3/03/2008 2:45"),
Track(title="Gap That Opened", artist="Boom Crash Opera", size=4.7, album="Boom Crash Opera", genre="Rock", rating=40, duration="4:02", lastPlayed="13/01/2008 10:11"),
Track(title="Hands Up In The Air", artist="Boom Crash Opera", size=4.5, album="Boom Crash Opera", genre="Rock", rating=80, duration="3:53", lastPlayed="24/03/2008 3:19"),
Track(title="Love Me To Death", artist="Boom Crash Opera", size=5.2, album="Boom Crash Opera", genre="Rock", rating=40, duration="4:27", lastPlayed="13/01/2008 10:20"),
Track(title="City Fist", artist="Boom Crash Opera", size=4.9, album="Boom Crash Opera", genre="Rock", rating=40, duration="4:11", lastPlayed="13/01/2008 10:24"),
Track(title="Her Charity", artist="Boom Crash Opera", size=5.8, album="Boom Crash Opera", genre="Rock", rating=40, duration="5:01", lastPlayed="13/01/2008 10:29"),
Track(title="Sleeping Time", artist="Boom Crash Opera", size=5.2, album="Boom Crash Opera", genre="Rock", rating=40, duration="4:26", lastPlayed="13/01/2008 10:33"),
Track(title="Great Wall", artist="Boom Crash Opera", size=4.5, album="Boom Crash Opera", genre="Rock", rating=80, duration="3:51", lastPlayed="24/03/2008 3:22"),
Track(title="Bombshell", artist="Boom Crash Opera", size=4.5, album="Boom Crash Opera", genre="Rock", rating=40, duration="3:50", lastPlayed="13/01/2008 10:41"),
Track(title="Caught Between Two Towns", artist="Boom Crash Opera", size=4, album="Boom Crash Opera", genre="Rock", rating=40, duration="3:28", lastPlayed="13/01/2008 10:44"),
Track(title="Too Hot To Think", artist="Boom Crash Opera", size=6.3, album="Boom Crash Opera", genre="Rock", rating=40, duration="5:26", lastPlayed="13/01/2008 10:50"),
Track(title="Starting Today", artist="Natalie Imbruglia", size=6.8, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=0, duration="2:56", lastPlayed="19/03/2008 9:48"),
Track(title="Shiver", artist="Natalie Imbruglia", size=8.6, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=80, duration="3:45", lastPlayed="19/03/2008 9:51"),
Track(title="Satisfied", artist="Natalie Imbruglia", size=8.1, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=0, duration="3:30", lastPlayed="19/03/2008 9:55"),
Track(title="Counting Down the Days", artist="Natalie Imbruglia", size=9.6, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=60, duration="4:09", lastPlayed="26/03/2008 10:33"),
Track(title="I Won't Be Lost", artist="Natalie Imbruglia", size=9, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=60, duration="3:53", lastPlayed="26/03/2008 10:37"),
Track(title="Slow Down", artist="Natalie Imbruglia", size=8.1, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=60, duration="3:32", lastPlayed="26/03/2008 10:41"),
Track(title="Sanctuary", artist="Natalie Imbruglia", size=7.3, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=60, duration="3:09", lastPlayed="26/03/2008 10:44"),
Track(title="Perfectly", artist="Natalie Imbruglia", size=7.8, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=80, duration="3:24", lastPlayed="26/03/2008 10:47"),
Track(title="On the Run", artist="Natalie Imbruglia", size=8.4, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=60, duration="3:38", lastPlayed="26/03/2008 10:51"),
Track(title="Come on Home", artist="Natalie Imbruglia", size=9.1, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=60, duration="3:56", lastPlayed="26/03/2008 10:55"),
Track(title="When You're Sleeping", artist="Natalie Imbruglia", size=7.2, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=60, duration="3:07", lastPlayed="26/03/2008 10:58"),
Track(title="Honeycomb Child", artist="Natalie Imbruglia", size=9.8, album="Counting Down the Days", genre="Adult Alternative Pop/Rock", rating=0, duration="4:15", lastPlayed="26/03/2008 11:02"),
Track(title="Last Living Souls", artist="Gorillaz", size=4.5, album="Demon Days", genre="Hip-Hop", rating=80, duration="3:11", lastPlayed="12/01/2008 9:55"),
Track(title="Kids With Guns", artist="Gorillaz", size=5.3, album="Demon Days", genre="Hip-Hop", rating=80, duration="3:46", lastPlayed="24/03/2008 12:52"),
Track(title="O Green World", artist="Gorillaz", size=6.3, album="Demon Days", genre="Hip-Hop", rating=80, duration="4:32", lastPlayed="24/03/2008 12:45"),
Track(title="Dirty Harry", artist="Gorillaz", size=5.2, album="Demon Days", genre="Hip-Hop", rating=80, duration="3:44", lastPlayed="24/03/2008 12:48"),
Track(title="Feel Good Inc.", artist="Gorillaz", size=5.4, album="Demon Days", genre="Hip-Hop", rating=100, duration="3:41", lastPlayed="24/03/2008 1:07"),
Track(title="El Manana", artist="Gorillaz", size=5.4, album="Demon Days", genre="Hip-Hop", rating=40, duration="3:50", lastPlayed="17/03/2008 5:45"),
Track(title="Every Plant We Reach Is Dead", artist="Gorillaz", size=6.8, album="Demon Days", genre="Hip-Hop", rating=80, duration="4:53", lastPlayed="24/03/2008 12:57"),
Track(title="November Has Come", artist="Gorillaz", size=3.8, album="Demon Days", genre="Hip-Hop", rating=80, duration="2:41", lastPlayed="24/03/2008 12:59"),
Track(title="All Alone", artist="Gorillaz", size=4.9, album="Demon Days", genre="Hip-Hop", rating=80, duration="3:30", lastPlayed="12/01/2008 9:49"),
Track(title="White Light", artist="Gorillaz", size=3, album="Demon Days", genre="Hip-Hop", rating=80, duration="2:09", lastPlayed="17/02/2008 3:30"),
Track(title="DARE", artist="Gorillaz", size=5.7, album="Demon Days", genre="Hip-Hop", rating=80, duration="4:05", lastPlayed="24/03/2008 1:03"),
Track(title="Don't Get Lost In Heaven", artist="Gorillaz", size=2.9, album="Demon Days", genre="Hip-Hop", rating=80, duration="2:01", lastPlayed="24/03/2008 12:36"),
Track(title="Demon Days", artist="Gorillaz", size=6.3, album="Demon Days", genre="Hip-Hop", rating=80, duration="4:29", lastPlayed="24/03/2008 12:40"),
Track(title="The Pretender", artist="Foo Fighters", size=8.3, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=60, duration="4:29", lastPlayed="24/03/2008 11:20"),
Track(title="Let It Die", artist="Foo Fighters", size=7.6, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=40, duration="4:05", lastPlayed="24/03/2008 11:24"),
Track(title="Erase/Replace", artist="Foo Fighters", size=7.8, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=60, duration="4:13", lastPlayed="24/03/2008 11:28"),
Track(title="Long Road To Ruin", artist="Foo Fighters", size=7, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=60, duration="3:45", lastPlayed="24/03/2008 11:31"),
Track(title="Come Alive", artist="Foo Fighters", size=9.6, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=60, duration="5:10", lastPlayed="24/03/2008 11:37"),
Track(title="Stranger Things Have Happened", artist="Foo Fighters", size=9.9, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=80, duration="5:21", lastPlayed="24/03/2008 11:42"),
Track(title="Cheer Up, Boys (Your Makeup Is Running)", artist="Foo Fighters", size=6.8, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=40, duration="3:41", lastPlayed="24/03/2008 11:45"),
Track(title="Summer's End", artist="Foo Fighters", size=8.6, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=60, duration="4:38", lastPlayed="24/03/2008 11:50"),
Track(title="The Ballad Of The Beaconsfield", artist="Foo Fighters", size=4.7, album="Echoes, Silence, Patience & Grace", genre="Instrumental", rating=80, duration="2:32", lastPlayed="24/03/2008 11:53"),
Track(title="Statues", artist="Foo Fighters", size=7, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=60, duration="3:48", lastPlayed="24/03/2008 11:57"),
Track(title="But, Honestly", artist="Foo Fighters", size=8.5, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=40, duration="4:35", lastPlayed="24/03/2008 12:01"),
Track(title="Home", artist="Foo Fighters", size=9, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=80, duration="4:52", lastPlayed="24/03/2008 12:06"),
Track(title="Once And For All (Demo) (Bonus Track)", artist="Foo Fighters", size=7, album="Echoes, Silence, Patience & Grace", genre="Alternative", rating=0, duration="3:48", lastPlayed="24/03/2008 12:10"),
Track(title="Going Under", artist="Evanescence", size=4.2, album="Fallen", genre="Metal", rating=0, duration="3:35", lastPlayed="4/02/2008 6:09"),
Track(title="Bring Me To Life", artist="Evanescence", size=4.6, album="Fallen", genre="Metal", rating=100, duration="3:57", lastPlayed="25/03/2008 12:56"),
Track(title="Everybody's Fool", artist="Evanescence", size=3.8, album="Fallen", genre="Metal", rating=0, duration="3:16", lastPlayed="4/02/2008 6:16"),
Track(title="Haunted", artist="Evanescence", size=3.6, album="Fallen", genre="Metal", rating=0, duration="3:07", lastPlayed="4/02/2008 6:19"),
Track(title="Tourniquet", artist="Evanescence", size=5.4, album="Fallen", genre="Metal", rating=0, duration="4:38", lastPlayed="4/02/2008 6:24"),
Track(title="Imaginary", artist="Evanescence", size=5, album="Fallen", genre="Metal", rating=0, duration="4:18", lastPlayed="4/02/2008 6:28"),
Track(title="Taking Over Me", artist="Evanescence", size=4.4, album="Fallen", genre="Metal", rating=0, duration="3:50", lastPlayed="15/03/2008 4:57"),
Track(title="Hello", artist="Evanescence", size=4.3, album="Fallen", genre="Metal", rating=0, duration="3:40", lastPlayed="4/02/2008 6:35"),
Track(title="My Last Breath", artist="Evanescence", size=4.8, album="Fallen", genre="Metal", rating=0, duration="4:07", lastPlayed="15/03/2008 4:23"),
Track(title="Whisper", artist="Evanescence", size=6.3, album="Fallen", genre="Metal", rating=0, duration="5:30", lastPlayed="4/02/2008 6:45"),
Track(title="My Immortal", artist="Evanescence", size=5.3, album="Fallen", genre="Metal", rating=0, duration="4:33", lastPlayed="4/02/2008 6:50"),
Track(title="One-Trick Pony", artist="Nelly Furtado", size=5, album="Folklore", genre="Pop", rating=80, duration="4:47", lastPlayed="15/03/2008 6:46"),
Track(title="Powerless (Say What You Want)", artist="Nelly Furtado", size=4.2, album="Folklore", genre="Pop", rating=80, duration="3:52", lastPlayed="15/03/2008 6:50"),
Track(title="Explode", artist="Nelly Furtado", size=4.1, album="Folklore", genre="Pop", rating=80, duration="3:44", lastPlayed="15/03/2008 6:53"),
Track(title="Try", artist="Nelly Furtado", size=4.9, album="Folklore", genre="Pop", rating=80, duration="4:39", lastPlayed="15/03/2008 11:49"),
Track(title="Fresh off the Boat", artist="Nelly Furtado", size=3.7, album="Folklore", genre="Pop", rating=60, duration="3:16", lastPlayed="22/02/2008 12:49"),
Track(title=u"Força", artist="Nelly Furtado", size=4, album="Folklore", genre="Pop", rating=40, duration="3:40", lastPlayed="22/02/2008 12:53"),
Track(title="The Grass Is Green", artist="Nelly Furtado", size=4.2, album="Folklore", genre="Pop", rating=40, duration="3:50", lastPlayed="22/02/2008 12:57"),
Track(title="Picture Perfect", artist="Nelly Furtado", size=5.5, album="Folklore", genre="Pop", rating=40, duration="5:15", lastPlayed="19/01/2008 12:08"),
Track(title="Saturdays", artist="Jarvis Church/Nelly Furtado", size=2.6, album="Folklore", genre="Pop", rating=40, duration="2:05", lastPlayed="7/01/2008 7:33"),
Track(title="Build You Up", artist="Nelly Furtado", size=5.2, album="Folklore", genre="Pop", rating=40, duration="4:58", lastPlayed="22/02/2008 1:03"),
Track(title="Island of Wonder", artist="Caetano Veloso/Nelly Furtado", size=4.2, album="Folklore", genre="Pop", rating=40, duration="3:49", lastPlayed="7/01/2008 7:42"),
Track(title="The Boy In The Bubble", artist="Paul Simon", size=5.6, album="Graceland", genre="Alternative", rating=60, duration="3:58", lastPlayed="24/01/2008 6:02"),
Track(title="Graceland", artist="Paul Simon", size=6.7, album="Graceland", genre="Alternative", rating=60, duration="4:48", lastPlayed="24/01/2008 6:07"),
Track(title="I Know What I Know", artist="Paul Simon", size=4.5, album="Graceland", genre="Alternative", rating=60, duration="3:12", lastPlayed="22/01/2008 5:27"),
Track(title="Gumboots", artist="Paul Simon", size=3.9, album="Graceland", genre="Alternative", rating=60, duration="2:43", lastPlayed="22/01/2008 5:30"),
Track(title="Diamonds On The Soles Of Her Shoes", artist="Paul Simon", size=8.1, album="Graceland", genre="Pop", rating=80, duration="5:46", lastPlayed="20/02/2008 9:44"),
Track(title="You Can Call Me Al", artist="Paul Simon", size=6.5, album="Graceland", genre="Alternative", rating=60, duration="4:39", lastPlayed="22/01/2008 5:40"),
Track(title="Under African Skies", artist="Paul Simon", size=5.1, album="Graceland", genre="Alternative", rating=60, duration="3:35", lastPlayed="19/03/2008 5:27"),
Track(title="Homeless", artist="Paul Simon", size=5.3, album="Graceland", genre="Alternative", rating=60, duration="3:47", lastPlayed="23/11/2007 7:01"),
Track(title="Crazy Love Vol II", artist="Paul Simon", size=6, album="Graceland", genre="Alternative", rating=60, duration="4:16", lastPlayed="22/01/2008 5:44"),
Track(title="That Was Your Mother", artist="Paul Simon", size=4.1, album="Graceland", genre="Alternative", rating=60, duration="2:53", lastPlayed="22/01/2008 5:47"),
Track(title="All Around The World Or The Myth of Fingerprints", artist="Paul Simon", size=4.6, album="Graceland", genre="Pop", rating=60, duration="3:13", lastPlayed="19/03/2008 5:31"),
Track(title="Vertigo", artist="U2", size=3.8, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=100, duration="3:15", lastPlayed="18/12/2007 12:11"),
Track(title="Miracle Drug", artist="U2", size=4.7, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=100, duration="3:59", lastPlayed="19/03/2008 12:04"),
Track(title="Sometimes You Can't Make It On Your Own", artist="U2", size=6, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=60, duration="5:09", lastPlayed="18/12/2007 12:20"),
Track(title="Love And Peace Or Else", artist="U2", size=5.6, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=60, duration="4:51", lastPlayed="15/03/2008 4:16"),
Track(title="City Of Blinding Lights", artist="U2", size=6.7, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=80, duration="5:48", lastPlayed="19/03/2008 12:10"),
Track(title="All Because Of You", artist="U2", size=4.3, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=60, duration="3:39", lastPlayed="6/11/2007 11:02"),
Track(title="A Man And A Woman", artist="U2", size=5.3, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=100, duration="4:30", lastPlayed="19/03/2008 12:00"),
Track(title="Crumbs From Your Table", artist="U2", size=5.9, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=60, duration="5:04", lastPlayed="6/11/2007 11:12"),
Track(title="One Step Closer", artist="U2", size=4.5, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=40, duration="3:52", lastPlayed="6/11/2007 11:16"),
Track(title="Original Of The Species", artist="U2", size=5.5, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=40, duration="4:41", lastPlayed="6/11/2007 11:20"),
Track(title="Yahweh", artist="U2", size=5.1, album="How To Dismantle An Atomic Bomb", genre="Rock", rating=80, duration="4:22", lastPlayed="18/03/2008 11:56"),
Track(title="Grim Travellers", artist="Bruce Cockburn", size=5.6, album="Humans", genre="Folk", rating=60, duration="4:50", lastPlayed="15/03/2008 4:31"),
Track(title="Rumours Of Glory", artist="Bruce Cockburn", size=4.3, album="Humans", genre="Folk", rating=80, duration="3:40", lastPlayed="25/03/2008 1:25"),
Track(title="More Not More", artist="Bruce Cockburn", size=4.4, album="Humans", genre="Folk", rating=60, duration="3:46", lastPlayed="27/10/2007 7:47"),
Track(title="You Get Bigger As You Go", artist="Bruce Cockburn", size=5.3, album="Humans", genre="Folk", rating=40, duration="4:36", lastPlayed="27/10/2007 7:51"),
Track(title="What About The Bond", artist="Bruce Cockburn", size=5.7, album="Humans", genre="Folk", rating=40, duration="4:56", lastPlayed="27/10/2007 7:56"),
Track(title="How I Spent My Fall Vacation", artist="Bruce Cockburn", size=5.9, album="Humans", genre="Folk", rating=60, duration="5:04", lastPlayed="27/10/2007 8:01"),
Track(title="Guerilla Betrayed", artist="Bruce Cockburn", size=4.6, album="Humans", genre="Folk", rating=60, duration="3:58", lastPlayed="27/10/2007 8:05"),
Track(title="Tokyo", artist="Bruce Cockburn", size=4.1, album="Humans", genre="Folk", rating=60, duration="3:29", lastPlayed="27/10/2007 8:09"),
Track(title="Fascist Architecture", artist="Bruce Cockburn", size=3.1, album="Humans", genre="Folk", rating=60, duration="2:38", lastPlayed="15/11/2007 3:40"),
Track(title="The Rose Above The Sky", artist="Bruce Cockburn", size=7.4, album="Humans", genre="Folk", rating=80, duration="6:22", lastPlayed="25/03/2008 1:22"),
Track(title="Torn", artist="Natalie Imbruglia", size=5.6, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=100, duration="4:04", lastPlayed="26/03/2008 11:06"),
Track(title="One More Addiction", artist="Natalie Imbruglia", size=4.9, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=60, duration="3:30", lastPlayed="26/03/2008 11:09"),
Track(title="Big Mistake", artist="Natalie Imbruglia", size=6.3, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=80, duration="4:32", lastPlayed="26/03/2008 11:14"),
Track(title="Leave Me Alone", artist="Natalie Imbruglia", size=6, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=60, duration="4:21", lastPlayed="26/03/2008 11:18"),
Track(title="Wishing I Was There", artist="Natalie Imbruglia", size=5.3, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=80, duration="3:51", lastPlayed="26/03/2008 11:22"),
Track(title="Smoke", artist="Natalie Imbruglia", size=6.4, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=60, duration="4:37", lastPlayed="26/03/2008 11:26"),
Track(title="Pigeons And Crumbs", artist="Natalie Imbruglia", size=7.4, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=0, duration="5:20", lastPlayed="26/03/2008 11:32"),
Track(title="Don't You Think", artist="Natalie Imbruglia", size=5.4, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=80, duration="3:55", lastPlayed="26/03/2008 11:36"),
Track(title="Impressed", artist="Natalie Imbruglia", size=6.6, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=80, duration="4:48", lastPlayed="26/03/2008 11:40"),
Track(title="Intuition", artist="Natalie Imbruglia", size=4.7, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=80, duration="3:22", lastPlayed="26/03/2008 11:44"),
Track(title="City", artist="Natalie Imbruglia", size=6.3, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=0, duration="4:33", lastPlayed="26/03/2008 11:48"),
Track(title="Left Of The Middle", artist="Natalie Imbruglia", size=5.2, album="Left Of The Middle", genre="Adult Alternative Pop/Rock", rating=60, duration="3:46", lastPlayed="26/03/2008 11:52"),
Track(title="Life For Rent", artist="Dido", size=4.3, album="Life For Rent", genre="Pop", rating=80, duration="3:43", lastPlayed="20/02/2008 9:35"),
Track(title="Mary's In India", artist="Dido", size=4.3, album="Life For Rent", genre="Pop", rating=80, duration="3:44", lastPlayed="20/02/2008 9:39"),
Track(title="See You When You're 40", artist="Dido", size=6.2, album="Life For Rent", genre="Pop", rating=80, duration="5:22", lastPlayed="20/02/2008 9:15"),
Track(title="Don't Leave Home", artist="Dido", size=4.4, album="Life For Rent", genre="Pop", rating=80, duration="3:49", lastPlayed="20/02/2008 9:31"),
Track(title="Who Makes You Feel", artist="Dido", size=5.1, album="Life For Rent", genre="Pop", rating=80, duration="4:23", lastPlayed="20/02/2008 9:09"),
Track(title="Sand In My Shoes", artist="Dido", size=5.8, album="Life For Rent", genre="Pop", rating=80, duration="5:02", lastPlayed="20/02/2008 9:24"),
Track(title="Do You Have A Little Time", artist="Dido", size=4.6, album="Life For Rent", genre="Pop", rating=80, duration="3:57", lastPlayed="20/02/2008 9:19"),
Track(title="This Land Is Mine", artist="Dido", size=4.4, album="Life For Rent", genre="Pop", rating=80, duration="3:48", lastPlayed="20/02/2008 9:27"),
Track(title="See The Sun", artist="Dido", size=12.2, album="Life For Rent", genre="Pop", rating=60, duration="10:36", lastPlayed="22/12/2007 10:28"),
Track(title="Lifesong", artist="Casting Crowns", size=4.9, album="Lifesong", genre="Religious", rating=80, duration="5:17", lastPlayed="24/03/2008 2:36"),
Track(title="Praise You in This Storm", artist="Casting Crowns", size=4.6, album="Lifesong", genre="Religious", rating=100, duration="4:59", lastPlayed="24/03/2008 2:17"),
Track(title="Does Anybody Hear Her", artist="Casting Crowns", size=4.2, album="Lifesong", genre="Religious", rating=60, duration="4:30", lastPlayed="26/12/2007 3:07"),
Track(title="Stained Glass Masquerade", artist="Casting Crowns", size=3.6, album="Lifesong", genre="Religious", rating=60, duration="3:52", lastPlayed="26/12/2007 3:11"),
Track(title="Love Them Like Jesus", artist="Casting Crowns", size=4.2, album="Lifesong", genre="Religious", rating=60, duration="4:32", lastPlayed="4/11/2007 3:00"),
Track(title="Set Me Free", artist="Casting Crowns", size=4.1, album="Lifesong", genre="Religious", rating=80, duration="4:27", lastPlayed="24/03/2008 2:12"),
Track(title="While You Were Sleeping", artist="Casting Crowns", size=4.5, album="Lifesong", genre="Religious", rating=60, duration="4:55", lastPlayed="1/01/2008 12:39"),
Track(title="Father, Spirit, Jesus", artist="Casting Crowns", size=4.8, album="Lifesong", genre="Religious", rating=80, duration="5:11", lastPlayed="24/03/2008 2:41"),
Track(title="In Me", artist="Casting Crowns", size=4.4, album="Lifesong", genre="Religious", rating=80, duration="4:44", lastPlayed="24/03/2008 2:31"),
Track(title="Prodigal", artist="Casting Crowns", size=5.3, album="Lifesong", genre="Religious", rating=60, duration="5:45", lastPlayed="26/12/2007 3:36"),
Track(title="And Now My Lifesong Sings", artist="Casting Crowns", size=3.8, album="Lifesong", genre="Religious", rating=60, duration="4:03", lastPlayed="1/01/2008 12:54"),
Track(title="Afraid", artist="Nelly Furtado", size=3.3, album="Loose", genre="Pop", rating=80, duration="3:35", lastPlayed="15/03/2008 11:41"),
Track(title="Maneater", artist="Nelly Furtado", size=4.1, album="Loose", genre="Pop", rating=40, duration="4:25", lastPlayed="19/01/2008 12:20"),
Track(title="Promiscuous", artist="Nelly Furtado", size=3.7, album="Loose", genre="Pop", rating=60, duration="4:02", lastPlayed="21/01/2008 5:01"),
Track(title="Glow", artist="Nelly Furtado", size=3.7, album="Loose", genre="Pop", rating=80, duration="4:02", lastPlayed="15/03/2008 11:45"),
Track(title="Showtime", artist="Nelly Furtado", size=3.9, album="Loose", genre="Pop", rating=80, duration="4:15", lastPlayed="15/03/2008 6:37"),
Track(title="No Hay Igual", artist="Nelly Furtado", size=3.3, album="Loose", genre="Pop", rating=80, duration="3:35", lastPlayed="15/03/2008 11:33"),
Track(title="Te Busque", artist="Nelly Furtado", size=3.4, album="Loose", genre="Pop", rating=60, duration="3:38", lastPlayed="21/01/2008 5:17"),
Track(title="Say It Right", artist="Nelly Furtado", size=3.4, album="Loose", genre="Pop", rating=60, duration="3:43", lastPlayed="21/01/2008 5:21"),
Track(title="Do It", artist="Nelly Furtado", size=3.4, album="Loose", genre="Pop", rating=60, duration="3:41", lastPlayed="21/01/2008 5:24"),
Track(title="In God's Hands", artist="Nelly Furtado", size=4.5, album="Loose", genre="Pop", rating=40, duration="4:54", lastPlayed="21/01/2008 5:29"),
Track(title="Wait for You", artist="Nelly Furtado", size=4.8, album="Loose", genre="Pop", rating=40, duration="5:11", lastPlayed="21/01/2008 5:34"),
Track(title="Somebody to Love", artist="Nelly Furtado", size=4.6, album="Loose", genre="Pop", rating=40, duration="4:56", lastPlayed="21/01/2008 5:39"),
Track(title="All Good Things (Come to an End)", artist="Nelly Furtado", size=4.8, album="Loose", genre="Pop", rating=40, duration="5:10", lastPlayed="21/01/2008 5:44"),
Track(title="Someone Somewhere In Summertime", artist="Simple Minds", size=6.5, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=60, duration="4:38", lastPlayed="1/09/2007 9:11"),
Track(title="Colours Fly And Catherine Wheel", artist="Simple Minds", size=5.4, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=80, duration="3:50", lastPlayed="19/11/2007 8:34"),
Track(title="Big Sleep", artist="Simple Minds", size=6.9, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=40, duration="4:58", lastPlayed="1/09/2007 9:20"),
Track(title="Somebody Up There Likes You", artist="Simple Minds", size=7, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=40, duration="5:02", lastPlayed="1/09/2007 9:25"),
Track(title="New Gold Dream (81-82-83-84)", artist="Simple Minds", size=7.9, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=60, duration="5:39", lastPlayed="1/09/2007 9:30"),
Track(title="Glittering Prize", artist="Simple Minds", size=6.4, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=60, duration="4:34", lastPlayed="13/08/2007 8:24"),
Track(title="Hunter And The Hunted", artist="Simple Minds", size=8.3, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=60, duration="5:56", lastPlayed="13/08/2007 8:30"),
Track(title="King Is White And In The Crowd", artist="Simple Minds", size=9.7, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=20, duration="7:00", lastPlayed="13/08/2007 8:37"),
Track(title="Promised you a miracle", artist="Simple Minds", size=4.7, album="New Gold Gream (81/82/83/84)", genre="Rock", rating=40, duration="4:01", lastPlayed="10/01/2008 12:01"),
Track(title="Psycho Killer", artist="Talking Heads", size=5.2, album="Once In A Lifetime", genre="Alternative", rating=40, duration="4:22", lastPlayed="4/02/2008 5:06"),
Track(title="Take Me To The River", artist="Talking Heads", size=6, album="Once In A Lifetime", genre="Alternative", rating=40, duration="5:03", lastPlayed="4/02/2008 5:11"),
Track(title="Once In A Lifetime", artist="Talking Heads", size=5.2, album="Once In A Lifetime", genre="Alternative", rating=80, duration="4:20", lastPlayed="4/02/2008 5:15"),
Track(title="Burning Down The House", artist="Talking Heads", size=4.8, album="Once In A Lifetime", genre="Alternative", rating=100, duration="4:02", lastPlayed="10/02/2008 12:19"),
Track(title="This Must Be The Place (Naive Melody)", artist="Talking Heads", size=5.9, album="Once In A Lifetime", genre="Alternative", rating=40, duration="4:55", lastPlayed="4/02/2008 5:24"),
Track(title="Slippery People (Live)", artist="Talking Heads", size=5.1, album="Once In A Lifetime", genre="Alternative", rating=40, duration="4:14", lastPlayed="4/02/2008 5:28"),
Track(title="Life During Wartime (Live)", artist="Talking Heads", size=6, album="Once In A Lifetime", genre="Alternative", rating=40, duration="5:05", lastPlayed="4/02/2008 5:34"),
Track(title="And She Was", artist="Talking Heads", size=4.4, album="Once In A Lifetime", genre="Alternative", rating=60, duration="3:39", lastPlayed="4/02/2008 5:37"),
Track(title="Road To Nowhere", artist="Talking Heads", size=5.2, album="Once In A Lifetime", genre="Alternative", rating=80, duration="4:20", lastPlayed="4/02/2008 5:42"),
Track(title="Wild Wild Life", artist="Talking Heads", size=4.4, album="Once In A Lifetime", genre="Alternative", rating=60, duration="3:42", lastPlayed="4/02/2008 5:45"),
Track(title="Blind", artist="Talking Heads", size=5.9, album="Once In A Lifetime", genre="Alternative", rating=40, duration="5:00", lastPlayed="4/02/2008 5:50"),
Track(title="Nothing But Flowers", artist="Talking Heads", size=6.6, album="Once In A Lifetime", genre="Alternative", rating=40, duration="5:35", lastPlayed="4/02/2008 5:56"),
Track(title="Sax And Violins", artist="Talking Heads", size=6.3, album="Once In A Lifetime", genre="Alternative", rating=60, duration="5:18", lastPlayed="4/02/2008 6:01"),
Track(title="Lifetime Piling Up", artist="Talking Heads", size=4.6, album="Once In A Lifetime", genre="Alternative", rating=80, duration="3:52", lastPlayed="4/02/2008 6:05"),
Track(title="Honey", artist="Moby", size=4.8, album="Play", genre="Alternative", rating=80, duration="3:29", lastPlayed="22/02/2008 10:59"),
Track(title="Find My Baby", artist="Moby", size=5.5, album="Play", genre="Alternative", rating=60, duration="3:59", lastPlayed="22/02/2008 11:03"),
Track(title="Porcelain", artist="Moby", size=5.6, album="Play", genre="Alternative", rating=40, duration="4:01", lastPlayed="14/03/2008 11:34"),
Track(title="Why Does My Heart Feel So Bad?", artist="Moby", size=6.1, album="Play", genre="Alternative", rating=80, duration="4:25", lastPlayed="22/02/2008 11:12"),
Track(title="Southside", artist="Moby", size=5.3, album="Play", genre="Alternative", rating=80, duration="3:50", lastPlayed="3/03/2008 4:20"),
Track(title="Rushing", artist="Moby", size=4.2, album="Play", genre="Instrumental", rating=60, duration="3:00", lastPlayed="14/03/2008 11:30"),
Track(title="Bodyrock", artist="Moby", size=5, album="Play", genre="Alternative", rating=100, duration="3:36", lastPlayed="14/03/2008 11:27"),
Track(title="Natural Blues", artist="Moby", size=5.9, album="Play", genre="Alternative", rating=40, duration="4:14", lastPlayed="22/02/2008 11:27"),
Track(title="Machete", artist="Moby", size=5.1, album="Play", genre="Alternative", rating=20, duration="3:38", lastPlayed="22/02/2008 11:30"),
Track(title="7", artist="Moby", size=1.5, album="Play", genre="Instrumental", rating=20, duration="1:02", lastPlayed="14/03/2008 11:23"),
Track(title="Run On", artist="Moby", size=5.2, album="Play", genre="Alternative", rating=40, duration="3:45", lastPlayed="19/03/2008 5:52"),
Track(title="Down Slow", artist="Moby", size=2.2, album="Play", genre="Instrumental", rating=40, duration="1:35", lastPlayed="14/03/2008 11:22"),
Track(title="If Things Were Perfect", artist="Moby", size=6, album="Play", genre="Alternative", rating=60, duration="4:19", lastPlayed="22/02/2008 11:40"),
Track(title="Everloving", artist="Moby", size=4.8, album="Play", genre="Alternative", rating=40, duration="3:26", lastPlayed="27/12/2007 11:06"),
Track(title="Inside", artist="Moby", size=6.7, album="Play", genre="Alternative", rating=60, duration="4:49", lastPlayed="27/12/2007 11:10"),
Track(title="Guitar Flute And String", artist="Moby", size=3, album="Play", genre="Alternative", rating=60, duration="2:09", lastPlayed="27/12/2007 11:12"),
Track(title="The Sky Is Broken", artist="Moby", size=6, album="Play", genre="Alternative", rating=60, duration="4:19", lastPlayed="4/11/2007 2:22"),
Track(title="My Weakness", artist="Moby", size=5, album="Play", genre="Alternative", rating=40, duration="3:38", lastPlayed="4/11/2007 2:26"),
Track(title="Discotheque", artist="U2", size=6.1, album="Pop", genre="Rock", rating=100, duration="5:19", lastPlayed="3/03/2008 4:16"),
Track(title="Do You Feel Loved", artist="U2", size=5.9, album="Pop", genre="Rock", rating=60, duration="5:07", lastPlayed="7/02/2008 11:04"),
Track(title="Mofo", artist="U2", size=6.7, album="Pop", genre="Rock", rating=60, duration="5:49", lastPlayed="7/02/2008 11:10"),
Track(title="If God Will Send His Angels", artist="U2", size=6.2, album="Pop", genre="Rock", rating=80, duration="5:23", lastPlayed="7/02/2008 11:16"),
Track(title="Staring At The Sun", artist="U2", size=5.3, album="Pop", genre="Rock", rating=80, duration="4:37", lastPlayed="19/03/2008 12:15"),
Track(title="Last Night On Earth", artist="U2", size=5.5, album="Pop", genre="Rock", rating=100, duration="4:46", lastPlayed="7/02/2008 11:25"),
Track(title="Gone", artist="U2", size=5.1, album="Pop", genre="Rock", rating=60, duration="4:27", lastPlayed="7/02/2008 11:29"),
Track(title="Miami", artist="U2", size=5.6, album="Pop", genre="Rock", rating=40, duration="4:53", lastPlayed="14/11/2007 5:53"),
Track(title="The Playboy Mansion", artist="U2", size=5.4, album="Pop", genre="Rock", rating=40, duration="4:41", lastPlayed="14/11/2007 5:58"),
Track(title="If You Wear That Velvet Dress", artist="U2", size=6.1, album="Pop", genre="Rock", rating=60, duration="5:15", lastPlayed="14/11/2007 6:03"),
Track(title="Please", artist="U2", size=5.8, album="Pop", genre="Rock", rating=40, duration="5:03", lastPlayed="6/02/2008 11:28"),
Track(title="Wake Up Dead Man", artist="U2", size=5.6, album="Pop", genre="Rock", rating=40, duration="4:53", lastPlayed="6/02/2008 11:20"),
Track(title="The River", artist="Live", size=4.1, album="Songs From Black Mountain", genre="Gospel & Religious", rating=80, duration="2:58", lastPlayed="24/03/2008 10:55"),
Track(title="Mystery", artist="Live", size=5.2, album="Songs From Black Mountain", genre="Gospel & Religious", rating=80, duration="3:45", lastPlayed="24/03/2008 10:59"),
Track(title="Get Ready", artist="Live", size=4.9, album="Songs From Black Mountain", genre="Gospel & Religious", rating=60, duration="3:32", lastPlayed="23/03/2008 1:02"),
Track(title="Show", artist="Live", size=4.7, album="Songs From Black Mountain", genre="Gospel & Religious", rating=80, duration="3:25", lastPlayed="24/03/2008 11:03"),
Track(title="Wings", artist="Live", size=5.3, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:51", lastPlayed="23/03/2008 1:09"),
Track(title="Sofia", artist="Live", size=5.4, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:54", lastPlayed="23/03/2008 1:13"),
Track(title="Love Shines (A Song For My Daughters About God)", artist="Live", size=4.6, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:21", lastPlayed="23/03/2008 1:16"),
Track(title="Where Do We Go From Here", artist="Live", size=5.2, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:46", lastPlayed="23/03/2008 1:20"),
Track(title="Home", artist="Live", size=4.7, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:23", lastPlayed="23/03/2008 1:23"),
Track(title="All I Need", artist="Live", size=4.5, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:14", lastPlayed="23/03/2008 1:26"),
Track(title="You Are Not Alone", artist="Live", size=5.2, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:44", lastPlayed="19/02/2008 12:05"),
Track(title="Night Of Nights", artist="Live", size=4.9, album="Songs From Black Mountain", genre="Gospel & Religious", rating=0, duration="3:33", lastPlayed="19/02/2008 12:08"),
Track(title="All For Believing", artist="Missy Higgins", size=4.2, album="The Sound Of White", genre="Folk", rating=80, duration="3:30", lastPlayed="30/01/2008 4:21"),
Track(title="Don't Ever", artist="Missy Higgins", size=3.5, album="The Sound Of White", genre="Folk", rating=40, duration="2:54", lastPlayed="30/01/2008 4:24"),
Track(title="Scar", artist="Missy Higgins", size=4.3, album="The Sound Of White", genre="Folk", rating=80, duration="3:36", lastPlayed="30/01/2008 4:28"),
Track(title="Ten Days", artist="Missy Higgins", size=4.5, album="The Sound Of White", genre="Folk", rating=80, duration="3:48", lastPlayed="30/01/2008 5:10"),
Track(title="Nightminds", artist="Missy Higgins", size=4, album="The Sound Of White", genre="Folk", rating=60, duration="3:21", lastPlayed="30/01/2008 5:13"),
Track(title="Casualty", artist="Missy Higgins", size=5, album="The Sound Of White", genre="Folk", rating=60, duration="4:15", lastPlayed="15/03/2008 4:43"),
Track(title="Any Day Now", artist="Missy Higgins", size=4.6, album="The Sound Of White", genre="Folk", rating=60, duration="3:54", lastPlayed="30/12/2007 2:35"),
Track(title="Katie", artist="Missy Higgins", size=4.3, album="The Sound Of White", genre="Folk", rating=60, duration="3:37", lastPlayed="30/12/2007 2:38"),
Track(title="The River", artist="Missy Higgins", size=5.3, album="The Sound Of White", genre="Folk", rating=60, duration="4:30", lastPlayed="16/11/2007 9:06"),
Track(title="The Special Two", artist="Missy Higgins", size=5.2, album="The Sound Of White", genre="Folk", rating=100, duration="4:25", lastPlayed="30/01/2008 5:18"),
Track(title="This Is How It Goes", artist="Missy Higgins", size=4.2, album="The Sound Of White", genre="Folk", rating=60, duration="3:35", lastPlayed="30/01/2008 5:22"),
Track(title="The Sound Of White", artist="Missy Higgins", size=5.7, album="The Sound Of White", genre="Folk", rating=80, duration="4:52", lastPlayed="30/01/2008 5:27"),
Track(title="They Weren't There", artist="Missy Higgins", size=4.9, album="The Sound Of White", genre="Folk", rating=60, duration="4:08", lastPlayed="30/12/2007 2:56"),
]
fe = wx.FontEnumerator()
fe.EnumerateFacenames()
fontFaces = fe.GetFacenames()
colours = [wx.Colour(*x[1:]) for x in colourdb.getColourInfoList()]
for x in self.dataObjects:
# Convert the 'duration' and 'lastPlayed' attributes into a time() and a datetime() respectively
minsAndSeconds = x.duration.split(":")
x.duration = time(minute=int(minsAndSeconds[0]), second=int(minsAndSeconds[1]))
x.lastPlayed = datetime(*(strptime(x.lastPlayed, "%d/%m/%Y %H:%M")[0:6]))
# Give some tracks a dark colour that can be used for the text
x.trackColour = random.choice(colours)
if sum(x.trackColour.Get()) > 255*3/2:
x.trackColour = None
# Give some tracks a funny font
if random.random() > 0.75:
x.font = wx.FFont(11, wx.DEFAULT, face=random.choice(fontFaces))
else:
x.font = None
def InitSearchCtrls(self):
"""Initialize the search controls"""
for (searchCtrl, olv) in [(self.searchCtrlSimple, self.olvSimple),
(self.searchCtrlComplex, self.olvComplex),
(self.searchCtrlFast, self.olvFast),
(self.searchCtrlGroup, self.olvGroup)]:
# Use default parameters to pass extra information to the event handler
def _handleText(evt, searchCtrl=searchCtrl, olv=olv):
self.OnTextSearchCtrl(evt, searchCtrl, olv)
def _handleCancel(evt, searchCtrl=searchCtrl, olv=olv):
self.OnCancelSearchCtrl(evt, searchCtrl, olv)
searchCtrl.Bind(wx.EVT_TEXT, _handleText)
searchCtrl.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, _handleCancel)
olv.SetFilter(Filter.TextSearch(olv, olv.columns[0:4]))
def InitUI(self):
"""Initialize the UI portion of the application.
This is the part that shows how to use the various flavours of ObjectListView.
"""
# Setup some images. It's almost always more convenient to use named images
# rather than using the image indicies. But both names and indicies can be used
musicImageIndex = self.olvSimple.AddNamedImages("music", self._imagePath("music16.png"), self._imagePath("music32.png"))
self.olvSimple.AddNamedImages("group", self._imagePath("Group16.bmp"), self._imagePath("Group32.bmp"))
self.olvSimple.AddNamedImages("user", self._imagePath("User16.bmp"), self._imagePath("User32.bmp"))
self.olvSimple.AddNamedImages("star", self._imagePath("star16.png"), self._imagePath("star32.png"))
self.olvSimple.AddNamedImages("ok", self._imagePath("tick16.png"), self._imagePath("tick32.png"))
self.olvSimple.AddNamedImages("dud", self._imagePath("no16.png"), self._imagePath("no32.png"))
self.olvSimple.AddNamedImages("undecided", self._imagePath("question16.png"))
# This function is an "editor factory" that creates and returns a widget that
# will correctly edit wx.Colour objects
def makeColourEditor(olv, rowIndex, subItemIndex):
odcb = OwnerDrawnEditor.ColourComboBox(olv)
# OwnerDrawnComboxBoxes don't generate EVT_CHAR so look for keydown instead
odcb.Bind(wx.EVT_KEY_DOWN, olv._HandleChar)
return odcb
# Register the "editor factory" for wx.Colour objects
CellEditorRegistry().RegisterCreatorFunction(type(wx.BLACK), makeColourEditor)
#----------------------------------------------------------------------
# Init Simple list
# These columns are defined without any callbacks.
# Note: the "Album" column is space filling, so it will get larger and smaller as the window resizes
simpleColumns = [
ColumnDefn("Title", "left", 160, valueGetter="title", imageGetter=musicImageIndex, minimumWidth=40, maximumWidth=200),
ColumnDefn("Artist", "left", 150, valueGetter="artist", minimumWidth=40, maximumWidth=200, autoCompleteCellEditor=True, headerImage="star"),
ColumnDefn("Album", "left", 150, valueGetter="album", maximumWidth=250, isSpaceFilling=True, autoCompleteCellEditor=True, headerImage=2),
ColumnDefn("Genre", "left", 60, valueGetter="genre", autoCompleteComboBoxCellEditor=True),
ColumnDefn("Size", "right", 60, valueGetter="size"),
ColumnDefn("Rating", "center", 60, valueGetter="rating"),
ColumnDefn("Duration", "center", 150, valueGetter="duration", stringConverter="%S seconds and %M minutes"),
ColumnDefn("Date Played", "left", 150, valueGetter="dateLastPlayed", stringConverter="%x", valueSetter="SetDateLastPlayed"),
ColumnDefn("Last Played", "left", 150, valueGetter="lastPlayed", stringConverter="%x %X", maximumWidth=100),
ColumnDefn("Colour", "left", 60, valueGetter="trackColour", minimumWidth=40),
]
self.olvSimple.SetColumns(simpleColumns)
self.olvSimple.CreateCheckStateColumn(1)
self.olvSimple.SetObjects(self.dataObjects)
# Allow the cell values to be edited when double-clicked
self.olvSimple.cellEditMode = ObjectListView.CELLEDIT_SINGLECLICK
#----------------------------------------------------------------------
# Init Complex list
# In the complex tab, we use lots of callbacks
# For callbacks it is always easier to use image names rather than image indicies
soloArtists = ["Nelly Furtado", "Missy Higgins", "Moby", "Natalie Imbruglia", "Dido", "Paul Simon", "Bruce Cockburn"]
def artistImageGetter(track):
if track.artist in soloArtists:
return "user"
else:
return "group"
def ratingImageGetter(track):
if track.rating > 80:
return "star"
elif track.rating > 20:
return "ok"
elif track.rating > 0:
return "dud"
else:
return "undecided"
def fontToStringConverter(aFont):
if aFont:
return aFont.GetFaceName()
else:
return ""
# Give rows the color and font stored in the model. Old songs are drawn in Impact
# The "Update Selection" command changes the last played date, which should remove
# the Impact font. This is a way to test row updating.
def rowFormatter(listItem, track):
if track.trackColour:
listItem.SetTextColour(track.trackColour)
if track.font:
listItem.SetFont(track.font)
def colourToString(colour):
return wx.TheColourDatabase.FindName(colour) or str(colour)
# Just to show it can be done, we prevent all edits on the second row.
def handleCellEditStarting(evt):
if evt.rowIndex == 1:
evt.Veto()
if evt.subItemIndex in (1, 2):
evt.cellBounds[3] += 2 # Make the textbox a bit taller
def handleCellEditFinishing(evt):
pass
# This is an "cell editor factory" that we install in just one column
def makeFontEditor(olv, rowIndex, subItemIndex):
odcb = OwnerDrawnEditor.FontFaceComboBox(olv)
# OwnerDrawnComboxBoxes don't generate EVT_CHAR so look for keydown instead
odcb.Bind(wx.EVT_KEY_DOWN, olv._HandleChar)
return odcb
# Reuse the same images as the simple list
self.olvComplex.SetImageLists(self.olvSimple.smallImageList, self.olvSimple.normalImageList)
# This list is similar to the Simple columns, but it uses a lot of callbacks
columns = [
ColumnDefn("Title", "left", 200, valueGetter="title", imageGetter=musicImageIndex,
minimumWidth=40, maximumWidth=200),
ColumnDefn("Artist", "left", 150, valueGetter="artist", imageGetter=artistImageGetter,
minimumWidth=40, maximumWidth=200, autoCompleteCellEditor=True),
ColumnDefn("Album", "left", 150, valueGetter="album", maximumWidth=250, isSpaceFilling=True, autoCompleteCellEditor=True),
ColumnDefn("Genre", "left", 100, valueGetter="genre", autoCompleteComboBoxCellEditor=True),
ColumnDefn("Size", "right", 50, valueGetter="size"),
ColumnDefn("Rating", "center", 50, valueGetter="rating", imageGetter=ratingImageGetter),
ColumnDefn("Duration", "center", 150, valueGetter="duration", stringConverter="%S seconds and %M minutes"),
ColumnDefn("Date Played", "left", 150, valueGetter="dateLastPlayed", stringConverter="%x", valueSetter="SetDateLastPlayed"),
ColumnDefn("Last Played", "left", 150, valueGetter="lastPlayed", stringConverter="%x %X", maximumWidth=150),