def __init__(self, master, gradient_table, color_space, width, height): """Initialize a function control widget on tkframe master. Parameters: ----------- master: The master widget. Note that this widget *must* have the methods specified in the `AbstractGradientEditorWidget` interface. on_table_changed: Callback function taking a bool argument of meaning 'FinalUpdate'. FinalUpdate is true if a control point is dropped, created or removed and false if the update is due to a control point currently beeing dragged (but not yet dropped) color_space: String which specifies the channels painted on this control. May be any combination of h,s,v,r,g,b,a in which each channel occurs only once. set_status_text: a callback used to set the status text when using the editor. """ FunctionControl.__init__(self, master, gradient_table, color_space, width, height) QtGui.QWidget.__init__(self, parent=master) self.resize(width, height) self.setMinimumSize(100, 50)
def __init__(self, master, gradient_table, color_space, width, height): """Initialize a function control widget on tkframe master. Parameters: ----------- master: The master widget. Note that this widget *must* have the methods specified in the `AbstractGradientEditorWidget` interface. on_table_changed: Callback function taking a bool argument of meaning 'FinalUpdate'. FinalUpdate is true if a control point is dropped, created or removed and false if the update is due to a control point currently beeing dragged (but not yet dropped) color_space: String which specifies the channels painted on this control. May be any combination of h,s,v,r,g,b,a in which each channel occurs only once. set_status_text: a callback used to set the status text when using the editor. """ FunctionControl.__init__(self, master, gradient_table, color_space, width, height) wx.Panel.__init__(self, master, size=wx.Size(width, height), name="RGBHSVA Editor") self.update() wx.EVT_LEFT_DOWN(self, self.on_left_button_down) wx.EVT_LEFT_UP(self, self.on_left_button_up) wx.EVT_RIGHT_DOWN(self, self.on_right_button_down) wx.EVT_RIGHT_UP(self, self.on_right_button_up) wx.EVT_MOTION(self, self.on_mouse_move) wx.EVT_PAINT(self, self.on_paint) wx.EVT_LEAVE_WINDOW(self, self.on_leave_window)