48
48
from diffpy .pdfgui .gui .rseriespanel import RSeriesPanel
49
49
from diffpy .pdfgui .gui .temperatureseriespanel import TemperatureSeriesPanel
50
50
from diffpy .pdfgui .gui .welcomepanel import WelcomePanel
51
- from diffpy .pdfgui .gui .wxextensions import wx12
52
51
53
52
(PDFCustomEvent , EVT_PDFCUSTOM ) = wx .lib .newevent .NewEvent ()
54
53
@@ -234,14 +233,14 @@ def __defineLocalIds(self):
234
233
"""
235
234
# Functions that modify the tree.
236
235
# These are used in the fitting right-click menu and the main menu.
237
- self .newFitId = wx12 .NewIdRef () # New Fit
238
- self .newCalcId = wx12 .NewIdRef () # New Calculation
239
- self .newPhaseId = wx12 .NewIdRef () # New Phase
240
- self .newDataId = wx12 .NewIdRef () # New Data Set
236
+ self .newFitId = wx .NewIdRef () # New Fit
237
+ self .newCalcId = wx .NewIdRef () # New Calculation
238
+ self .newPhaseId = wx .NewIdRef () # New Phase
239
+ self .newDataId = wx .NewIdRef () # New Data Set
241
240
self .deleteId = wx .ID_DELETE # Delete tree item
242
241
self .copyId = wx .ID_COPY # Copy a tree item
243
242
self .pasteId = wx .ID_PASTE # Paste a tree item into tree
244
- self .pasteLinkId = wx12 .NewIdRef () # Paste and link a fit node
243
+ self .pasteLinkId = wx .NewIdRef () # Paste and link a fit node
245
244
246
245
# Misc. functions, these are exclusive to the main menu.
247
246
self .newId = wx .ID_NEW # Start a new Project
@@ -250,19 +249,19 @@ def __defineLocalIds(self):
250
249
self .saveId = wx .ID_SAVE # Save the project
251
250
self .saveAsId = wx .ID_SAVEAS # Save the project as...
252
251
self .quitId = wx .ID_CLOSE # Quit the program
253
- self .runFitId = wx12 .NewIdRef () # Run a fit
254
- self .stopFitId = wx12 .NewIdRef () # Stop a fit
255
- self .quickPlotId = wx12 .NewIdRef () # Quick plot a fit
256
- self .exportFitPDFId = wx12 .NewIdRef () # Save a fit PDF
257
- self .exportFitStruId = wx12 .NewIdRef () # Save a fit structure
258
- self .exportNewStruId = wx12 .NewIdRef () # Export a 'new' structure
259
- self .plotIStructId = wx12 .NewIdRef () # Plot initial structure
260
- self .plotFStructId = wx12 .NewIdRef () # Plot final structure
261
- self .printBLId = wx12 .NewIdRef () # Print the bond lengths of a structure
262
- self .printBAId = wx12 .NewIdRef () # Print the bond angles of a structure
263
- self .exportResId = wx12 .NewIdRef () # Save the results file
264
- self .runCalcId = wx12 .NewIdRef () # Run a calculation
265
- self .exportCalcPDFId = wx12 .NewIdRef () # Save a calculated PDF
252
+ self .runFitId = wx .NewIdRef () # Run a fit
253
+ self .stopFitId = wx .NewIdRef () # Stop a fit
254
+ self .quickPlotId = wx .NewIdRef () # Quick plot a fit
255
+ self .exportFitPDFId = wx .NewIdRef () # Save a fit PDF
256
+ self .exportFitStruId = wx .NewIdRef () # Save a fit structure
257
+ self .exportNewStruId = wx .NewIdRef () # Export a 'new' structure
258
+ self .plotIStructId = wx .NewIdRef () # Plot initial structure
259
+ self .plotFStructId = wx .NewIdRef () # Plot final structure
260
+ self .printBLId = wx .NewIdRef () # Print the bond lengths of a structure
261
+ self .printBAId = wx .NewIdRef () # Print the bond angles of a structure
262
+ self .exportResId = wx .NewIdRef () # Save the results file
263
+ self .runCalcId = wx .NewIdRef () # Run a calculation
264
+ self .exportCalcPDFId = wx .NewIdRef () # Save a calculated PDF
266
265
return
267
266
268
267
def __customProperties (self ):
@@ -438,12 +437,12 @@ def __setupMainMenu(self):
438
437
self .SetMenuBar (self .menuBar )
439
438
440
439
# File Menu
441
- self .fileMenu = wx12 .Menu ()
440
+ self .fileMenu = wx .Menu ()
442
441
self .newItem = wx .MenuItem (self .fileMenu , self .newId , "&New Project\t Ctrl+n" , "" , wx .ITEM_NORMAL )
443
442
self .fileMenu .Append (self .newItem )
444
443
self .openItem = wx .MenuItem (self .fileMenu , self .openId , "&Open Project\t Ctrl+o" , "" , wx .ITEM_NORMAL )
445
444
self .fileMenu .Append (self .openItem )
446
- self .recentMenu = wx12 .Menu ()
445
+ self .recentMenu = wx .Menu ()
447
446
msub = self .fileMenu .AppendSubMenu (self .recentMenu , "&Recent Files" )
448
447
self .recentId = msub .Id
449
448
self .fileMenu .AppendSeparator ()
@@ -464,7 +463,7 @@ def __setupMainMenu(self):
464
463
# End File Menu
465
464
466
465
# Edit Menu
467
- self .editMenu = wx12 .Menu ()
466
+ self .editMenu = wx .Menu ()
468
467
self .delItem = wx .MenuItem (self .editMenu , self .deleteId , "&Delete Item(s)\t Ctrl+X" , "" , wx .ITEM_NORMAL )
469
468
self .editMenu .Append (self .delItem )
470
469
self .copyItem = wx .MenuItem (self .editMenu , self .copyId , "&Copy Item\t Ctrl+C" , "" , wx .ITEM_NORMAL )
@@ -474,33 +473,33 @@ def __setupMainMenu(self):
474
473
self .pasteLinkItem = wx .MenuItem (self .editMenu , self .pasteLinkId , "Paste &Linked Fit" , "" , wx .ITEM_NORMAL )
475
474
self .editMenu .Append (self .pasteLinkItem )
476
475
self .editMenu .AppendSeparator ()
477
- self .prefItem = wx .MenuItem (self .editMenu , wx12 .NewIdRef (), "&Preferences" , "" , wx .ITEM_NORMAL )
476
+ self .prefItem = wx .MenuItem (self .editMenu , wx .NewIdRef (), "&Preferences" , "" , wx .ITEM_NORMAL )
478
477
self .editMenu .Append (self .prefItem )
479
478
self .menuBar .Append (self .editMenu , "&Edit" )
480
479
# End Edit Menu
481
480
482
481
# View Menu
483
- self .viewMenu = wx12 .Menu ()
482
+ self .viewMenu = wx .Menu ()
484
483
self .defaultLayoutItem = wx .MenuItem (
485
- self .editMenu , wx12 .NewIdRef (), "Default Window Layout" , "" , wx .ITEM_NORMAL
484
+ self .editMenu , wx .NewIdRef (), "Default Window Layout" , "" , wx .ITEM_NORMAL
486
485
)
487
486
self .viewMenu .Append (self .defaultLayoutItem )
488
487
self .viewMenu .AppendSeparator ()
489
488
# These items are context sensitive.
490
- self .showFitItem = wx .MenuItem (self .viewMenu , wx12 .NewIdRef (), "Show Fit Tree" , "" , wx .ITEM_NORMAL )
489
+ self .showFitItem = wx .MenuItem (self .viewMenu , wx .NewIdRef (), "Show Fit Tree" , "" , wx .ITEM_NORMAL )
491
490
self .viewMenu .Append (self .showFitItem )
492
- self .showPlotItem = wx .MenuItem (self .viewMenu , wx12 .NewIdRef (), "Show Plot Control" , "" , wx .ITEM_NORMAL )
491
+ self .showPlotItem = wx .MenuItem (self .viewMenu , wx .NewIdRef (), "Show Plot Control" , "" , wx .ITEM_NORMAL )
493
492
self .viewMenu .Append (self .showPlotItem )
494
- self .showOutputItem = wx .MenuItem (self .viewMenu , wx12 .NewIdRef (), "Show Output" , "" , wx .ITEM_NORMAL )
493
+ self .showOutputItem = wx .MenuItem (self .viewMenu , wx .NewIdRef (), "Show Output" , "" , wx .ITEM_NORMAL )
495
494
self .viewMenu .Append (self .showOutputItem )
496
495
self .showJournalItem = wx .MenuItem (
497
- self .viewMenu , wx12 .NewIdRef (), "Show Journal\t Ctrl+j" , "" , wx .ITEM_NORMAL
496
+ self .viewMenu , wx .NewIdRef (), "Show Journal\t Ctrl+j" , "" , wx .ITEM_NORMAL
498
497
)
499
498
self .viewMenu .Append (self .showJournalItem )
500
499
self .menuBar .Append (self .viewMenu , "&View" )
501
500
502
501
# Fits Menu
503
- self .fitsMenu = wx12 .Menu ()
502
+ self .fitsMenu = wx .Menu ()
504
503
self .newFitItem = wx .MenuItem (self .fitsMenu , self .newFitId , "&New Fit\t Ctrl+t" , "" , wx .ITEM_NORMAL )
505
504
self .fitsMenu .Append (self .newFitItem )
506
505
self .fitsMenu .AppendSeparator ()
@@ -513,19 +512,19 @@ def __setupMainMenu(self):
513
512
self .fitsMenu .Append (self .expResItem )
514
513
self .fitsMenu .AppendSeparator ()
515
514
# Macros sub-menu
516
- self .macrosMenu = wx12 .Menu ()
517
- self .rseriesItem = wx .MenuItem (self .macrosMenu , wx12 .NewIdRef (), "r-Series" , "" , wx .ITEM_NORMAL )
515
+ self .macrosMenu = wx .Menu ()
516
+ self .rseriesItem = wx .MenuItem (self .macrosMenu , wx .NewIdRef (), "r-Series" , "" , wx .ITEM_NORMAL )
518
517
self .macrosMenu .Append (self .rseriesItem )
519
- self .tseriesItem = wx .MenuItem (self .macrosMenu , wx12 .NewIdRef (), "Temperature Series" , "" , wx .ITEM_NORMAL )
518
+ self .tseriesItem = wx .MenuItem (self .macrosMenu , wx .NewIdRef (), "Temperature Series" , "" , wx .ITEM_NORMAL )
520
519
self .macrosMenu .Append (self .tseriesItem )
521
- self .dseriesItem = wx .MenuItem (self .macrosMenu , wx12 .NewIdRef (), "Doping Series" , "" , wx .ITEM_NORMAL )
520
+ self .dseriesItem = wx .MenuItem (self .macrosMenu , wx .NewIdRef (), "Doping Series" , "" , wx .ITEM_NORMAL )
522
521
self .macrosMenu .Append (self .dseriesItem )
523
522
self .fitsMenu .AppendSubMenu (self .macrosMenu , "Macros" )
524
523
self .menuBar .Append (self .fitsMenu , "Fi&ts" )
525
524
# End Fits Menu
526
525
527
526
# Phases Menu
528
- self .phasesMenu = wx12 .Menu ()
527
+ self .phasesMenu = wx .Menu ()
529
528
self .newPhaseItem = wx .MenuItem (self .phasesMenu , self .newPhaseId , "&New Phase\t Ctrl+p" , "" , wx .ITEM_NORMAL )
530
529
self .phasesMenu .Append (self .newPhaseItem )
531
530
self .phasesMenu .AppendSeparator ()
@@ -580,7 +579,7 @@ def __setupMainMenu(self):
580
579
# End Phases Menu
581
580
582
581
# Data Menu
583
- self .dataMenu = wx12 .Menu ()
582
+ self .dataMenu = wx .Menu ()
584
583
self .newDataItem = wx .MenuItem (self .dataMenu , self .newDataId , "&New Data Set\t Ctrl+d" , "" , wx .ITEM_NORMAL )
585
584
self .dataMenu .Append (self .newDataItem )
586
585
self .dataMenu .AppendSeparator ()
@@ -590,7 +589,7 @@ def __setupMainMenu(self):
590
589
# End Data Menu
591
590
592
591
# Calculations Menu
593
- self .calcMenu = wx12 .Menu ()
592
+ self .calcMenu = wx .Menu ()
594
593
self .newCalcItem = wx .MenuItem (
595
594
self .calcMenu ,
596
595
self .newCalcId ,
@@ -621,20 +620,20 @@ def __setupMainMenu(self):
621
620
# End Calculations Menu
622
621
623
622
# Help Menu
624
- self .helpMenu = wx12 .Menu ()
625
- self .docItem = wx .MenuItem (self .helpMenu , wx12 .NewIdRef (), "&Documentation\t F1" , "" , wx .ITEM_NORMAL )
623
+ self .helpMenu = wx .Menu ()
624
+ self .docItem = wx .MenuItem (self .helpMenu , wx .NewIdRef (), "&Documentation\t F1" , "" , wx .ITEM_NORMAL )
626
625
self .helpMenu .Append (self .docItem )
627
626
self .requestItem = wx .MenuItem (
628
627
self .helpMenu ,
629
- wx12 .NewIdRef (),
628
+ wx .NewIdRef (),
630
629
"Request a Feature / Report a Bug" ,
631
630
"" ,
632
631
wx .ITEM_NORMAL ,
633
632
)
634
633
self .helpMenu .Append (self .requestItem )
635
- self .communityItem = wx .MenuItem (self .helpMenu , wx12 .NewIdRef (), "PDFgui Community" , "" , wx .ITEM_NORMAL )
634
+ self .communityItem = wx .MenuItem (self .helpMenu , wx .NewIdRef (), "PDFgui Community" , "" , wx .ITEM_NORMAL )
636
635
self .helpMenu .Append (self .communityItem )
637
- self .aboutItem = wx .MenuItem (self .helpMenu , wx12 .NewIdRef (), "&About" , "" , wx .ITEM_NORMAL )
636
+ self .aboutItem = wx .MenuItem (self .helpMenu , wx .NewIdRef (), "&About" , "" , wx .ITEM_NORMAL )
638
637
self .helpMenu .Append (self .aboutItem )
639
638
self .menuBar .Append (self .helpMenu , "&Help" )
640
639
# End Help Menu
@@ -648,7 +647,6 @@ def __setupMainMenu(self):
648
647
def __setupToolBar (self ):
649
648
"""This sets up the tool bar in the parent window."""
650
649
self .toolBar = self .CreateToolBar ()
651
- wx12 .patchToolBarMethods (self .toolBar )
652
650
size = (16 , 16 )
653
651
bitmap = wx .ArtProvider .GetBitmap (wx .ART_NEW , wx .ART_TOOLBAR , size )
654
652
self .toolBar .AddTool (
@@ -1312,7 +1310,7 @@ def onRightClick(self, event): # wxGlade: MainPanel.<event_handler>
1312
1310
if self .mode == "fitting" :
1313
1311
1314
1312
# The menu Ids are defined in __defineLocalIds.
1315
- menu = wx12 .Menu ()
1313
+ menu = wx .Menu ()
1316
1314
menu .Append (self .newFitId , "New Fit" )
1317
1315
menu .AppendSeparator ()
1318
1316
menu .Append (self .copyId , "Copy" )
@@ -2546,11 +2544,11 @@ def showMessage(self, info, title="PDF Control Error"):
2546
2544
2547
2545
# control items
2548
2546
def lock (self ):
2549
- if not wx12 .IsMainThread ():
2547
+ if not wx .IsMainThread ():
2550
2548
wx .MutexGuiEnter ()
2551
2549
2552
2550
def unlock (self ):
2553
- if not wx12 .IsMainThread ():
2551
+ if not wx .IsMainThread ():
2554
2552
wx .MutexGuiLeave ()
2555
2553
2556
2554
def postEvent (self , type , info ):
0 commit comments