Skip to content

Commit fa1cddd

Browse files
committed
show message when delta-inst table would be empty
1 parent e158411 commit fa1cddd

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

GSASII/GSASIIgroupGUI.py

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -740,28 +740,37 @@ def HistFrame(G2frame,Histograms,Phases):
740740
midPanel.SetSizer(mainSizer)
741741
deltaMode = "\u0394" in G2frame.GroupInfo['displayMode']
742742
if CopyCtrl and len(prmArray) > 2: n += 1 # add column for copy (when more than one histogram)
743-
valSizer = wx.FlexGridSizer(0,len(prmArray)+n-1,3,10)
744-
mainSizer.Add(valSizer,1,wx.EXPAND)
745-
valSizer.Add(wx.StaticText(midPanel,label=' '))
746-
if '\u0394' in G2frame.GroupInfo['displayMode']:
747-
valSizer.Add(wx.StaticText(midPanel,label='Reset'))
748-
valSizer.Add(wx.StaticText(midPanel,label=' Ref '))
749-
for i,hist in enumerate(histLabels(G2frame)[1]):
750-
if i == 1 and CopyCtrl:
751-
if deltaMode:
752-
valSizer.Add((-1,-1))
753-
elif CopyCtrl:
754-
valSizer.Add(wx.StaticText(midPanel,label=' Copy '))
755-
valSizer.Add(wx.StaticText(midPanel,
756-
label=f"\u25A1 = {hist}"),
757-
0,wx.ALIGN_CENTER)
758-
firstentry,lblDict = displayDataArray(rowLabels,prmArray,valSizer,midPanel,
759-
deltaMode=deltaMode,CopyCtrl=CopyCtrl,
760-
)
761-
if firstentry is not None: # prevent scroll to show last entry
762-
wx.Window.SetFocus(firstentry)
763-
firstentry.SetInsertionPoint(0) # prevent selection of text in widget
764-
colorCaption(G2frame)
743+
if deltaMode and not rowLabels:
744+
mainSizer.Add(wx.StaticText(midPanel,
745+
label='No parameters deviate from initial values'),
746+
0,wx.ALL,10)
747+
elif not rowLabels: # I don't think this can happen
748+
mainSizer.Add(wx.StaticText(midPanel,label='No parameters to display'))
749+
else:
750+
valSizer = wx.FlexGridSizer(0,len(prmArray)+n-1,3,10)
751+
mainSizer.Add(valSizer,1,wx.EXPAND)
752+
# place column headers into table
753+
valSizer.Add(wx.StaticText(midPanel,label=' '))
754+
if '\u0394' in G2frame.GroupInfo['displayMode']:
755+
valSizer.Add(wx.StaticText(midPanel,label='Reset'))
756+
valSizer.Add(wx.StaticText(midPanel,label=' Ref '))
757+
for i,hist in enumerate(histLabels(G2frame)[1]):
758+
if i == 1 and CopyCtrl:
759+
if deltaMode:
760+
valSizer.Add((-1,-1))
761+
elif CopyCtrl:
762+
valSizer.Add(wx.StaticText(midPanel,label=' Copy '))
763+
valSizer.Add(wx.StaticText(midPanel,
764+
label=f"\u25A1 = {hist}"),
765+
0,wx.ALIGN_CENTER)
766+
# fill the remaining rows in the table
767+
firstentry,lblDict = displayDataArray(rowLabels,prmArray,valSizer,midPanel,
768+
deltaMode=deltaMode,CopyCtrl=CopyCtrl)
769+
770+
if firstentry is not None: # prevent scroll to show last entry
771+
wx.Window.SetFocus(firstentry)
772+
firstentry.SetInsertionPoint(0) # prevent selection of text in widget
773+
colorCaption(G2frame)
765774

766775
def getSampleVals(G2frame,Histograms):
767776
'''Generate the Parameter Data Table (a dict of dicts) with

0 commit comments

Comments
 (0)