parameters: (self, event)
docstring: Process zoom combo-box event. Either a list selection or value entered
docstring_summary: Process zoom combo-box event. Either a list selection or value entered
docstring_tokens: Process zoom combo - box event . Either a list selection or value entered
function: def OnZoomSet(self, event):
          " Process zoom combo-box event. Either a list selection or value entered"
          MINZ = 0
          MAXZ = 1000
          newzoom_scale = None
          num =  self.zoom.GetSelection()
          if num >= 0:            # selection from list
              newzoom_scale = self.zoom.GetClientData(num)
          else:                   # combo text 
              astring = self.zoom.GetValue().strip().replace('%','')  # ignore percent sign
              try:
                  numvalue = float(astring)
                  if numvalue < MINZ or numvalue > MAXZ:
                      numvalue = None
              except ValueError:
                  numvalue = None
              if numvalue:        # numeric value
                  newzoom_scale = numvalue/100.0
              else:               # valid text?
                  textvalue = self.zoom.GetValue()
                  for k in range(len(self.comboval)):
                      if textvalue.lower() == self.comboval[k][0].lower():
                          newzoom_scale = self.comboval[k][1]
                          break
                      
          if newzoom_scale:
              self.viewer.SetZoom(newzoom_scale)      # will send update to set zoomtext
          else:
              self.zoom.SetValue(self.zoomtext)       # restore last good value
          event.Skip()
function_tokens: def OnZoomSet ( self , event ) : MINZ = 0 MAXZ = 1000 newzoom_scale = None num = self . zoom . GetSelection ( ) if num >= 0 : # selection from list newzoom_scale = self . zoom . GetClientData ( num ) else : # combo text  astring = self . zoom . GetValue ( ) . strip ( ) . replace ( '%' , '' ) # ignore percent sign try : numvalue = float ( astring ) if numvalue < MINZ or numvalue > MAXZ : numvalue = None except ValueError : numvalue = None if numvalue : # numeric value newzoom_scale = numvalue / 100.0 else : # valid text? textvalue = self . zoom . GetValue ( ) for k in range ( len ( self . comboval ) ) : if textvalue . lower ( ) == self . comboval [ k ] [ 0 ] . lower ( ) : newzoom_scale = self . comboval [ k ] [ 1 ] break if newzoom_scale : self . viewer . SetZoom ( newzoom_scale ) # will send update to set zoomtext else : self . zoom . SetValue ( self . zoomtext ) # restore last good value event . Skip ( )