Changeset 115


Ignore:
Timestamp:
Jul 16, 2010 10:15:20 AM (11 years ago)
Author:
vondreel
Message:

implement "KILL_FOCUS" for all TextCtrl? windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r98 r115  
    2525    def OnNewColorBar(event):
    2626        data['color'] = colSel.GetValue()
    27         G2plt.PlotExposedImage(self)
     27        G2plt.PlotExposedImage(self,event=event)
    2828       
    2929    def OnNewCalibrant(event):
     
    3838        data['range'][1][1] = imax**2+data['range'][0][0]
    3939        data['range'][1][0] = min(data['range'][1][1]-1,data['range'][1][0])
    40         G2plt.PlotExposedImage(self)
     40        G2plt.PlotExposedImage(self,event=event)
    4141       
    4242    def OnMinSlider(event):
     
    4444        imin = int(minSel.GetValue())*DeltOne/100.
    4545        data['range'][1][0] = min(data['range'][1][1]-1,imin+data['range'][0][0])
    46         G2plt.PlotExposedImage(self)
     46        G2plt.PlotExposedImage(self,event=event)
    4747       
    4848    def OnNumOutChans(event):
     
    9191        else:
    9292            data['showLines'] = True
    93         G2plt.PlotExposedImage(self)
     93        G2plt.PlotExposedImage(self,event=event)
    9494       
    9595    def OnFullIntegrate(event):
     
    103103            self.Razim.SetEditable(False)           
    104104        self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_SAVEINTG,enable=False)   
    105         G2plt.PlotExposedImage(self)
     105        G2plt.PlotExposedImage(self,event=event)
    106106       
    107107    def OnSetDefault(event):
     
    122122        self.InnerTth.SetValue("%8.2f" % (Ltth))
    123123        self.OuterTth.SetValue("%8.2f" % (Utth))
    124         self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_SAVEINTG,enable=False)   
    125         G2plt.PlotExposedImage(self)
     124        self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_SAVEINTG,enable=False)
     125        G2plt.PlotExposedImage(self,event=event)
    126126       
    127127    def OnLRazim(event):
     
    129129        Razm = int(self.Razim.GetValue())
    130130        data['LRazimuth'] = [Lazm,Razm]
    131         self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_SAVEINTG,enable=False)   
    132         G2plt.PlotExposedImage(self)
     131        self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_SAVEINTG,enable=False)
     132        G2plt.PlotExposedImage(self,event=event)
    133133           
    134134    def OnSetRings(event):
     
    138138            data['setRings'] = True
    139139        setRings.SetValue(data['setRings'])
    140         G2plt.PlotExposedImage(self)
     140        G2plt.PlotExposedImage(self,event=event)
    141141           
    142142    def OnClearCalib(event):
     
    145145        data['ellipses'] = []
    146146        self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMCLEARCALIB,enable=False)   
    147         G2plt.PlotExposedImage(self)
     147        G2plt.PlotExposedImage(self,event=event)
    148148           
    149149    def OnCalibrate(event):       
     
    212212                                    G2gd.GetPatternTreeItemId(self,self.Image, 'Masks'),Masks)                               
    213213                            G2img.ImageIntegrate(self,Data,Masks)
    214                             G2plt.PlotIntegration(self,newPlot=True)
     214                            G2plt.PlotIntegration(self,newPlot=True,event=event)
    215215                            self.dataFrame.ImageEdit.Enable(id=G2gd.wxID_SAVEINTG,enable=True)
    216216                            G2IO.SaveIntegration(self,Id,Data)
     
    325325        style=wx.TE_PROCESS_ENTER)
    326326    cutOff.Bind(wx.EVT_TEXT_ENTER,OnCutOff)
     327    cutOff.Bind(wx.EVT_KILL_FOCUS,OnCutOff)
    327328    comboSizer.Add(cutOff,0,wx.ALIGN_CENTER_VERTICAL)
    328329
     
    353354        value=("%8.2f" % (IOtth[0])),style=wx.TE_PROCESS_ENTER)
    354355    self.InnerTth.Bind(wx.EVT_TEXT_ENTER,OnIOtth)
     356    self.InnerTth.Bind(wx.EVT_KILL_FOCUS,OnIOtth)
    355357    littleSizer.Add(self.InnerTth,0,wx.ALIGN_CENTER_VERTICAL)
    356358    self.OuterTth = wx.TextCtrl(parent=self.dataDisplay,
    357359        value=("%8.2f" % (IOtth[1])),style=wx.TE_PROCESS_ENTER)
    358360    self.OuterTth.Bind(wx.EVT_TEXT_ENTER,OnIOtth)
     361    self.OuterTth.Bind(wx.EVT_KILL_FOCUS,OnIOtth)
    359362    littleSizer.Add(self.OuterTth,0,wx.ALIGN_CENTER_VERTICAL)
    360363    dataSizer.Add(littleSizer,0,)
     
    365368        style=wx.TE_PROCESS_ENTER)
    366369    waveSel.Bind(wx.EVT_TEXT_ENTER,OnWavelength)
     370    waveSel.Bind(wx.EVT_KILL_FOCUS,OnWavelength)
    367371    dataSizer.Add(waveSel,0,wx.ALIGN_CENTER_VERTICAL)
    368372         
     
    374378        value=("%6d" % (LRazim[0])),style=wx.TE_PROCESS_ENTER)
    375379    self.Lazim.Bind(wx.EVT_TEXT_ENTER,OnLRazim)
     380    self.Lazim.Bind(wx.EVT_KILL_FOCUS,OnLRazim)
    376381    littleSizer.Add(self.Lazim,0,wx.ALIGN_CENTER_VERTICAL)
    377382    self.Razim = wx.TextCtrl(parent=self.dataDisplay,
    378383        value=("%6d" % (LRazim[1])),style=wx.TE_PROCESS_ENTER)
    379384    self.Razim.Bind(wx.EVT_TEXT_ENTER,OnLRazim)
     385    self.Razim.Bind(wx.EVT_KILL_FOCUS,OnLRazim)
    380386    littleSizer.Add(self.Razim,0,wx.ALIGN_CENTER_VERTICAL)
    381387    dataSizer.Add(littleSizer,0,)
     
    392398    outChan = wx.TextCtrl(parent=self.dataDisplay,value=str(data['outChannels']),style=wx.TE_PROCESS_ENTER)
    393399    outChan.Bind(wx.EVT_TEXT_ENTER,OnNumOutChans)
     400    outChan.Bind(wx.EVT_KILL_FOCUS,OnNumOutChans)
    394401    littleSizer.Add(outChan,0,wx.ALIGN_CENTER_VERTICAL)
    395402    outAzim = wx.TextCtrl(parent=self.dataDisplay,value=str(data['outAzimuths']),style=wx.TE_PROCESS_ENTER)
    396403    outAzim.Bind(wx.EVT_TEXT_ENTER,OnNumOutAzms)
     404    outAzim.Bind(wx.EVT_KILL_FOCUS,OnNumOutAzms)
    397405    littleSizer.Add(outAzim,0,wx.ALIGN_CENTER_VERTICAL)
    398406    dataSizer.Add(littleSizer,0,)
     
    451459        lowerThreshold.SetValue("%8d" % (lower))
    452460        upperThreshold.SetValue("%8d" % (upper))
    453         G2plt.PlotExposedImage(self)
     461        G2plt.PlotExposedImage(self,event=event)
    454462       
    455463    def OnSpotDiameter(event):
     
    461469        Obj.SetValue("%.2f"%(diameter))
    462470        data['Points'][spotIds.index(Obj.GetId())][2] = diameter
    463         G2plt.PlotExposedImage(self)
     471        G2plt.PlotExposedImage(self,event=event)
    464472       
    465473    def OnDeleteSpot(event):
     
    467475        del(data['Points'][delSpotId.index(Obj)])
    468476        UpdateMasks(self,data)           
    469         G2plt.PlotExposedImage(self)
     477        G2plt.PlotExposedImage(self,event=event)
    470478       
    471479    def OnRingThickness(event):
     
    477485        Obj.SetValue("%.3f"%(thick))
    478486        data['Rings'][ringIds.index(Obj.GetId())][1] = thick
    479         G2plt.PlotExposedImage(self)
     487        G2plt.PlotExposedImage(self,event=event)
    480488       
    481489    def OnDeleteRing(event):
     
    483491        del(data['Rings'][delRingId.index(Obj)])
    484492        UpdateMasks(self,data)           
    485         G2plt.PlotExposedImage(self)
     493        G2plt.PlotExposedImage(self,event=event)
    486494
    487495    def OnArcThickness(event):
     
    493501        Obj.SetValue("%.3f"%(thick))
    494502        data['Arcs'][arcIds.index(Obj.GetId())][2] = thick
    495         G2plt.PlotExposedImage(self)
     503        G2plt.PlotExposedImage(self,event=event)
    496504       
    497505    def OnDeleteArc(event):
     
    499507        del(data['Arcs'][delArcId.index(Obj)])
    500508        UpdateMasks(self,data)           
    501         G2plt.PlotExposedImage(self)
     509        G2plt.PlotExposedImage(self,event=event)
    502510
    503511    def OnDeletePoly(event):
     
    505513        del(data['Polygons'][delPolyId.index(Obj)])
    506514        UpdateMasks(self,data)           
    507         G2plt.PlotExposedImage(self)
     515        G2plt.PlotExposedImage(self,event=event)
    508516
    509517    def OnCopyMask(event):
     
    567575        value=("%8d" % (thresh[1][0])),style=wx.TE_PROCESS_ENTER)
    568576    lowerThreshold.Bind(wx.EVT_TEXT_ENTER,OnThreshold)
     577    lowerThreshold.Bind(wx.EVT_KILL_FOCUS,OnThreshold)
    569578    littleSizer.Add(lowerThreshold,0,wx.ALIGN_CENTER_VERTICAL)
    570579    upperThreshold = wx.TextCtrl(parent=self.dataDisplay,
    571580        value=("%8d" % (thresh[1][1])),style=wx.TE_PROCESS_ENTER)
    572581    upperThreshold.Bind(wx.EVT_TEXT_ENTER,OnThreshold)
     582    upperThreshold.Bind(wx.EVT_KILL_FOCUS,OnThreshold)
    573583    littleSizer.Add(upperThreshold,0,wx.ALIGN_CENTER_VERTICAL)
    574584    mainSizer.Add(littleSizer,0,)
     
    596606            littleSizer.Add(spotDiameter,0,wx.ALIGN_CENTER_VERTICAL)
    597607            spotDiameter.Bind(wx.EVT_TEXT_ENTER,OnSpotDiameter)
     608            spotDiameter.Bind(wx.EVT_KILL_FOCUS,OnSpotDiameter)
    598609            spotIds.append(spotDiameter.GetId())
    599610            spotDelete = wx.CheckBox(parent=self.dataDisplay,label='delete?')
     
    625636            littleSizer.Add(ringThick,0,wx.ALIGN_CENTER_VERTICAL)
    626637            ringThick.Bind(wx.EVT_TEXT_ENTER,OnRingThickness)
     638            ringThick.Bind(wx.EVT_KILL_FOCUS,OnRingThickness)
    627639            ringIds.append(ringThick.GetId())
    628640            ringDelete = wx.CheckBox(parent=self.dataDisplay,label='delete?')
     
    662674            littleSizer.Add(arcThick,0,wx.ALIGN_CENTER_VERTICAL)
    663675            arcThick.Bind(wx.EVT_TEXT_ENTER,OnArcThickness)
     676            arcThick.Bind(wx.EVT_KILL_FOCUS,OnArcThickness)
    664677            arcIds.append(arcThick.GetId())
    665678            arcDelete = wx.CheckBox(parent=self.dataDisplay,label='delete?')
Note: See TracChangeset for help on using the changeset viewer.