@@ -6031,7 +6031,7 @@ def UpdateRMC(event=None):
6031
6031
global runFile
6032
6032
def OnRMCselect(event):
6033
6033
G2frame.RMCchoice = RMCsel.GetStringSelection()
6034
- wx.CallLater(100 ,UpdateRMC)
6034
+ wx.CallLater(200 ,UpdateRMC)
6035
6035
6036
6036
def GetAtmChoice(pnl,RMCPdict):
6037
6037
@@ -10388,40 +10388,42 @@ def SetChoice(name,c,n=0):
10388
10388
elif r < 0: #dclick on col label
10389
10389
sel = -1
10390
10390
if drawAtoms.GetColLabelValue(c) == 'Style':
10391
- dlg = wx.SingleChoiceDialog(G2frame,'Select','Atom drawing style',styleChoice)
10392
- if dlg.ShowModal() == wx.ID_OK:
10393
- sel = dlg.GetSelection()
10394
- parms = styleChoice[sel]
10395
- for r in range(len(atomData)):
10396
- atomData[r][c] = parms
10397
- drawAtoms.SetCellValue(r,c,parms)
10398
- FindBondsDraw(data)
10399
- # G2plt.PlotStructure(G2frame,data)
10400
- dlg.Destroy()
10391
+ DrawAtomStyle(event)
10392
+ # dlg = wx.SingleChoiceDialog(G2frame,'Select','Atom drawing style',styleChoice)
10393
+ # if dlg.ShowModal() == wx.ID_OK:
10394
+ # sel = dlg.GetSelection()
10395
+ # parms = styleChoice[sel]
10396
+ # for r in range(len(atomData)):
10397
+ # atomData[r][c] = parms
10398
+ # drawAtoms.SetCellValue(r,c,parms)
10399
+ # FindBondsDraw(data)
10400
+ # # G2plt.PlotStructure(G2frame,data)
10401
+ # dlg.Destroy()
10401
10402
elif drawAtoms.GetColLabelValue(c) == 'Label':
10402
- dlg = wx.SingleChoiceDialog(G2frame,'Select','Atom labelling style',labelChoice)
10403
- if dlg.ShowModal() == wx.ID_OK:
10404
- sel = dlg.GetSelection()
10405
- parms = labelChoice[sel]
10406
- for r in range(len(atomData)):
10407
- atomData[r][c] = parms
10408
- drawAtoms.SetCellValue(r,c,parms)
10409
- dlg.Destroy()
10403
+ DrawAtomLabel(event)
10404
+ # dlg = wx.SingleChoiceDialog(G2frame,'Select','Atom labelling style',labelChoice)
10405
+ # if dlg.ShowModal() == wx.ID_OK:
10406
+ # sel = dlg.GetSelection()
10407
+ # parms = labelChoice[sel]
10408
+ # for r in range(len(atomData)):
10409
+ # atomData[r][c] = parms
10410
+ # drawAtoms.SetCellValue(r,c,parms)
10411
+ # dlg.Destroy()
10410
10412
elif drawAtoms.GetColLabelValue(c) == 'Color':
10411
- colors = wx.ColourData( )
10412
- colors.SetChooseFull(True )
10413
- dlg = wx.ColourDialog(G2frame.GetParent(),colors )
10414
- if dlg.ShowModal() == wx.ID_OK:
10415
- color = dlg.GetColourData().GetColour()[:3]
10416
- attr = wg.GridCellAttr() #needs to be here - gets lost if outside loop!
10417
- attr.SetReadOnly(True )
10418
- attr.SetBackgroundColour(color)
10419
- for r in range(len(atomData)):
10420
- atomData[r][c] = color
10421
- drawingData['Atoms'][r][c] = color
10422
- drawAtoms.SetAttr(r,c,attr)
10423
- UpdateDrawAtoms()
10424
- dlg.Destroy( )
10413
+ DrawAtomColor(event )
10414
+ # colors = wx.ColourData( )
10415
+ # colors.SetChooseFull(True )
10416
+ # dlg = wx.ColourDialog(G2frame.GetParent(),colors)
10417
+ # if dlg.ShowModal() == wx.ID_OK:
10418
+ # color = dlg.GetColourData().GetColour()[:3]
10419
+ # dlg.Destroy( )
10420
+ # attr = wg.GridCellAttr() #needs to be here - gets lost if outside loop!
10421
+ # attr.SetReadOnly(True)
10422
+ # attr.SetBackgroundColour( color)
10423
+ # for r in range(len(atomData)):
10424
+ # atomData[r][c] = color
10425
+ # drawingData['Atoms'][r][c] = color
10426
+ # drawAtoms.SetAttr(r,c,attr )
10425
10427
elif drawAtoms.GetColLabelValue(c) == 'Residue':
10426
10428
SetChoice('Residue',c,3)
10427
10429
elif drawAtoms.GetColLabelValue(c) == '1-letter':
@@ -10453,7 +10455,8 @@ def SetChoice(name,c,n=0):
10453
10455
drawingData['Atoms'][r][c] = color
10454
10456
drawAtoms.SetAttr(i,cs+2,attr)
10455
10457
dlg.Destroy()
10456
- UpdateDrawAtoms()
10458
+ # UpdateDrawAtoms()
10459
+ wx.CallLater(100,UpdateDrawAtoms)
10457
10460
G2plt.PlotStructure(G2frame,data)
10458
10461
10459
10462
def NextAtom(event):
@@ -10673,8 +10676,9 @@ def DrawAtomColor(event):
10673
10676
colors.SetChooseFull(True)
10674
10677
dlg = wx.ColourDialog(None,colors)
10675
10678
if dlg.ShowModal() == wx.ID_OK:
10679
+ color = dlg.GetColourData().GetColour()[:3]
10676
10680
for i in range(len(atmColors)):
10677
- atmColors[i] = dlg.GetColourData().GetColour()[:3]
10681
+ atmColors[i] = color
10678
10682
colorDict = dict(zip(atmTypes,atmColors))
10679
10683
for r in indx:
10680
10684
color = colorDict[atomData[r][ct]]
@@ -10684,6 +10688,7 @@ def DrawAtomColor(event):
10684
10688
drawAtoms.SetAttr(r,cs+2,attr)
10685
10689
data['Drawing']['Atoms'][r][cs+2] = color
10686
10690
dlg.Destroy()
10691
+ UpdateDrawAtoms()
10687
10692
drawAtoms.ClearSelection()
10688
10693
G2plt.PlotStructure(G2frame,data)
10689
10694
0 commit comments