Ejemplo n.º 1
0
 def validate(self):
     intVal = IntFormatter()
     msg = []
     
     if not intVal.validate(self.txtBins.Value):
         msg.append("A valid integer must be entered.")
     else:
         val = int(self.txtBins.Value)
         if val < 10 or val > 1000:
             msg.append("A value between 10 and 1000 must be entered.")
         
     return msg
Ejemplo n.º 2
0
    def OnClick(self, event):
        try:
            if event.inaxes is not None:
                intVal = IntFormatter()
                plotNum = event.inaxes.get_title().split(":")[0]
                if intVal.validate(plotNum):
                    self.SelectedSubplotIndex = int(plotNum)

                # Right click
                if event.button == 3:
                    pt = event.guiEvent.GetPosition()
                    self.PopupMenuXY(SubplotPopupMenu(self), pt.x, pt.y)
        except wx.PyAssertionError as pae:
            print pae
Ejemplo n.º 3
0
    def validate(self):
        intVal = IntFormatter()
        msg = []
        
        # validate X bins 
        if not intVal.validate(self.txtXBins.Value):
            msg.append("Bins: A valid integer must be entered.")
        else:
            val = int(self.txtXBins.Value)
            if val < 10:
                msg.append("Bins: A value of at least 10 must be entered.")
            
        # validate Y bins
#        if self.cbxType.StringSelection != self.HEXBINS:
#            if not intVal.validate(self.txtYBins.Value):
#                msg.append("Y Bins: A valid integer must be entered.")
#            else:
#                val = int(self.txtYBins.Value)
#                if val < 10:
#                    msg.append("A value of at least 10 must be entered.")
            
        return msg