''' called by pressing the OK button - validates data, and if no error
sets a good return code and dismisses the dialog by calling OnCancel
'''
try:
X = self.GridLinesX.get()
except ValueError:
X = 0
try:
Y = self.GridLinesY.get()
except ValueError:
Y = 0
try:
Pad = self.PadAmount.get()
except ValueError:
Pad = -1
if X < 1 or X > self.ImageCount:
tkMessageBox.showerror( 'Cells across invalid',
'Cells across must be less than %d' % self.ImageCount )
return
if Y < 1 or Y > self.ImageCount:
tkMessageBox.showerror( 'Cells down invalid',
'Cells down must be less than %d' % self.ImageCount )
return
if X * Y < self.ImageCount:
tkMessageBox.showerror( 'Not enough cells',
'Cells across x cells down must be at least %d' % self.ImageCount )
return
if Pad < 0 or Pad > 25:
tkMessageBox.showerror( 'Pad amount invalid',
'The per cell pad amount must be between 0 and 25 pixels' )
returnclickhere www.netlog.com/le_polomar








