Changeset 3177


Ignore:
Timestamp:
Dec 6, 2017 2:34:23 PM (4 years ago)
Author:
vondreele
Message:

fix bug involving load image controls - update of min/max slider values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r3174 r3177  
    235235        data['range'] = [(0,Imax),[Imin,Imax]]
    236236        masks['Thresholds'] = [(0,Imax),[Imin,Imax]]
    237         MaxSizer.GetChildren()[2].Window.SetValue(Imax)   #tricky
    238         MaxSizer.GetChildren()[5].Window.SetValue(Imin)   #tricky
     237        G2frame.slideSizer.GetChildren()[1].Window.SetValue(Imax)   #tricky
     238        G2frame.slideSizer.GetChildren()[4].Window.SetValue(Imin)   #tricky
    239239         
    240240    def OnIntegrate(event,useTA=None):
     
    723723        #   [Imin, Imax] => Range[1] = data['range'][1] #   lowest to highest pixel intensity on cmap scale
    724724        maxSizer = wx.BoxSizer(wx.VERTICAL)
    725         slideSizer = wx.FlexGridSizer(2,3,5,5)
    726         slideSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=' Max intensity'),0,WACV)
     725        G2frame.slideSizer = wx.FlexGridSizer(2,3,5,5)
     726        G2frame.slideSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=' Max intensity'),0,WACV)
    727727        # maxSel is a slider with 101 steps scaled from Imin+1 to Imax0 with sqrt scaling
    728728        # slider value = sv = 100 * sqrt((Imax-Imin-1)/(Imax0-Imin-1))
     
    732732        sv1 = min(100,max(0,int(0.5+100.*sqrtDeltOne/sqrtDeltZero)))
    733733        maxSel = wx.Slider(parent=G2frame.dataWindow,style=wx.SL_HORIZONTAL,value=sv1)
    734         slideSizer.AddGrowableCol(2)
     734        G2frame.slideSizer.AddGrowableCol(2)
    735735        maxSel.Bind(wx.EVT_SLIDER, OnMaxSlider)
    736736        maxVal = G2G.ValidatedTxtCtrl(G2frame.dataWindow,Range[1],1,min=Range[0][0]+1,
    737737            max=Range[0][1],OnLeave=OnNewVal)
    738         slideSizer.Add(maxVal,0,WACV)
    739         slideSizer.Add(maxSel,flag=wx.EXPAND|wx.ALL)
    740         slideSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=' Min intensity'),0,WACV)
     738        G2frame.slideSizer.Add(maxVal,0,WACV)
     739        G2frame.slideSizer.Add(maxSel,flag=wx.EXPAND|wx.ALL)
     740        G2frame.slideSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=' Min intensity'),0,WACV)
    741741        # minSel is a slider with 101 steps scaled from Imin0 to Imax-1 with linear scaling
    742742        # slider value = sv0 = 100 * (Imin-Imin0)/(Imax-Imin0-1)
     
    748748        minVal = G2G.ValidatedTxtCtrl(G2frame.dataWindow,Range[1],0,
    749749            max=Range[0][1],typeHint=int,OnLeave=OnNewVal)
    750         slideSizer.Add(minVal,0,WACV)
    751         slideSizer.Add(minSel,flag=wx.EXPAND|wx.ALL)
    752         maxSizer.Add(slideSizer,flag=wx.EXPAND|wx.ALL)
     750        G2frame.slideSizer.Add(minVal,0,WACV)
     751        G2frame.slideSizer.Add(minSel,flag=wx.EXPAND|wx.ALL)
     752        maxSizer.Add(G2frame.slideSizer,flag=wx.EXPAND|wx.ALL)
    753753        autoSizer = wx.BoxSizer(wx.HORIZONTAL)
    754754        autoSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Auto scaler '),0,WACV)
Note: See TracChangeset for help on using the changeset viewer.