Changeset 2416


Ignore:
Timestamp:
Aug 10, 2016 10:35:06 AM (7 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

Location:
trunk
Files:
2 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'] = []
  • trunk/GSASIIctrls.py

    r2407 r2416  
    11511151                if sizevals[i]: kargs['size']=sizevals[i]
    11521152            if CopyButton:
    1153                 import wx.lib.colourselect as wscs
     1153                import wx.lib.colourselect as wscs  # is there a way to test?
    11541154                but = wscs.ColourSelect(label='v', # would like to use u'\u2193' or u'\u25BC' but not in WinXP
    1155                                         # is there a way to test?
    1156                                         parent=panel,
    1157                                         colour=(255,255,200),
    1158                                         size=wx.Size(30,23),
    1159                                         style=wx.RAISED_BORDER)
     1155                    parent=panel,colour=(255,255,200),size=wx.Size(30,23),
     1156                    style=wx.RAISED_BORDER)
    11601157                but.Bind(wx.EVT_BUTTON, self._OnCopyButton)
    11611158                but.SetToolTipString('Press to copy adjacent value to all rows below')
Note: See TracChangeset for help on using the changeset viewer.