def __init__(self, glyph, callback, x, y): self.glyph = glyph self.callback = callback # create the modal dialog (from dialogKit) self.w = ModalDialog((200, 150), "Shapes Tool", okCallback=self.okCallback, cancelCallback=self.cancelCallback) # add some text boxes self.w.xText = TextBox((10, 43, 100, 22), "x") self.w.wText = TextBox((10, 13, 100, 22), "w") self.w.yText = TextBox((100, 43, 100, 22), "y") self.w.hText = TextBox((100, 13, 100, 22), "h") # adding input boxes self.w.xInput = EditText((30, 40, 50, 22), "%i" % x) self.w.wInput = EditText((30, 10, 50, 22)) self.w.yInput = EditText((120, 40, 50, 22), "%i" % y) self.w.hInput = EditText((120, 10, 50, 22)) # a radio shape choice group # (the RadioGroup isn't standaard in dialogKit, this is a vanilla object) self.shapes = ["oval", "rect"] self.w.shape = RadioGroup((10, 70, -10, 22), self.shapes, isVertical=False) self.w.shape.set(0) self.w.open()
def __init__(self, message, value, title): self.w = ModalDialog((360, 140), title) self.w.button1 = Button((-100, -300, 80, 24), 'OK', callback=self.buttonCallback) self.w.t = TextBox((5, 10, -5, 27), message) self.w.inputValue = EditText((5, 35, -5, 50), value) self.w.open()
def __init__(self, message, default=None, title="RoboFab"): # default is ignord? self.answer = -1 self.w = ModalDialog((360, 140), title, okCallback=self.buttonOKCallback) self.w.noButton = Button((10, -35, 80, 24), 'No', callback=self.buttonNoCallback) self.w.t = TextBox((5, 10, -5, 27), message) self.w.open()
def __init__(self, message, title): self.w = ModalDialog((360, 100), title) self.w.t = TextBox((5, 10, -5, -40), message) self.w.open()