# 1. Iterate open images and verify that each meets the requirement of being
# a single raster layer with transparency. If not, give the user the choice
# of fixing the image, skipping the image, or canceling the export entirely.
# During this phase we find the largest source image, since we need to know
# how big the tube cells are.
# 2. Next compute the best fit for tube layout - best fit is described as closest
# to square, but the user can override these choices in a dialog. They number
# of cells they create must be sufficient for the number of images that will be
# tubed. clickhere www.polomar23.skyblog.com
# 3. Create a new image big enough to hold all of the images.
# 4. For possible future editing, define the grid on the image to match the number of cells
# 5. Iterate all the images that will be in the tube, copy them to the clipboard,
# then paste them into the tube image as a new selection. We set the offset on the
# paste operation so that each lands in the right spot.
# 6. Invoke the tube exporter, with cells across, cells down and total cells set properly.
# Step size is initialized to the cell width.
class CellCountDlg(Frame):
''' define the dialog used to prompt the user for the number of cells'''
def __init__( self, parent, title, NumCols, NumRows, TotalCells ):
Frame.__init__(self) # init our parent
# if we exit with OK this will be set to 1. A zero means we pressed cancel
self.OKPressed = 0
self.ImageCount = TotalCells
# define all the variables attached to the controls
self.GridLinesX = IntVar()
self.GridLinesX.set( NumCols )
self.GridLinesY = IntVar()
self.GridLinesY.set( NumRows )
self.PadAmount = IntVar()
self.PadAmount.set( 2 )
# define the basics of the window
self.pack(expand=YES, fill=BOTH)
self.master.title('Define Cells')



