Changeset 2416 for trunk/GSASII.py


Ignore:
Timestamp:
Aug 10, 2016 10:35:06 AM (5 years ago)
Author:
vondreele
Message:

fix issues with summing images & powder patterns - SumDialog? is now a scrolled window & image sum files now opened correctly after sum is finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2412 r2416  
    2929import scipy as sp
    3030import wx
     31import wx.lib.scrolledpanel as wxscroll
    3132try:  # patch for LANG environment var problem on occasional OSX machines
    3233    import locale
     
    26322633        'Allows user to supply scale factor(s) when summing data'
    26332634        def __init__(self,parent,title,text,dataType,data):
    2634             wx.Dialog.__init__(self,parent,-1,title, 
    2635                 pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE)
     2635            wx.Dialog.__init__(self,parent,-1,title,size=(400,250),
     2636                pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
    26362637            self.data = data
    2637             panel = wx.Panel(self)
     2638            size = (400,250)
     2639            panel = wxscroll.ScrolledPanel(self, wx.ID_ANY,size=size,
     2640                style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER)
    26382641            mainSizer = wx.BoxSizer(wx.VERTICAL)
    26392642            topLabl = wx.StaticText(panel,-1,text)
     
    26432646            dataGridSizer = wx.FlexGridSizer(cols=2,hgap=2,vgap=2)
    26442647            for id,item in enumerate(self.data[:-1]):
    2645                 name = wx.TextCtrl(panel,-1,item[1],size=wx.Size(200,20))
     2648                name = wx.TextCtrl(panel,-1,item[1],size=wx.Size(300,20))
    26462649                name.SetEditable(False)
    26472650                scale = wx.TextCtrl(panel,id,'%.3f'%(item[0]),style=wx.TE_PROCESS_ENTER)
     
    26532656                dataGridSizer.Add(wx.StaticText(panel,-1,'Sum result name: '+dataType),0, \
    26542657                    wx.LEFT|wx.TOP|wx.ALIGN_CENTER_VERTICAL,10)
    2655                 self.name = wx.TextCtrl(panel,-1,self.data[-1],size=wx.Size(200,20),style=wx.TE_PROCESS_ENTER)
     2658                self.name = wx.TextCtrl(panel,-1,self.data[-1],size=wx.Size(300,20),style=wx.TE_PROCESS_ENTER)
    26562659                self.name.Bind(wx.EVT_TEXT_ENTER,self.OnNameChange)
    26572660                self.name.Bind(wx.EVT_KILL_FOCUS,self.OnNameChange)
     
    26692672            btnSizer.Add((20,20),1)
    26702673           
     2674            panel.SetSizer(mainSizer)
     2675            panel.SetAutoLayout(1)
     2676            panel.SetupScrolling()
    26712677            mainSizer.Add(btnSizer,0,wx.EXPAND|wx.BOTTOM|wx.TOP, 10)
    26722678            panel.SetSizer(mainSizer)
     
    28052811
    28062812    def OnImageSum(self,event):
    2807         'Sum together image data(?)'
     2813        'Sum together image data'
    28082814        TextList = []
    28092815        DataList = []
     
    28752881                    if Id:
    28762882                        pth = G2G.GetExportPath(self)
    2877                         dlg = wx.FileDialog(self, 'Choose sum image filename', pth, '',
     2883                        dlg = wx.FileDialog(self, 'Choose sum image filename', pth,outname.split('IMG ')[1],
    28782884                            'G2img files (*.G2img)|*.G2img',
    28792885                            wx.SAVE|wx.FD_OVERWRITE_PROMPT)
     
    28902896                        if self.imageDefault:
    28912897                            Data = copy.copy(self.imageDefault)
     2898                        Data['formatName'] = 'GSAS-II image'
    28922899                        Data['showLines'] = True
    28932900                        Data['ring'] = []
Note: See TracChangeset for help on using the changeset viewer.