def popup_editor ( self, event ): """ Invokes the pop-up editor for an object trait. """ color_data = wx.ColourData() color_data.SetColour( self.factory.to_wx_color( self ) ) color_data.SetChooseFull( True ) dialog = wx.ColourDialog( self.control, color_data ) position_window(dialog, self.control) if dialog.ShowModal() == wx.ID_OK: self.value = self.factory.from_wx_color( dialog.GetColourData().GetColour() ) dialog.Destroy()
def popup_editor(self, event): """ Invokes the pop-up editor for an object trait. """ color_data = wx.ColourData() color_data.SetColour(self.factory.to_wx_color(self)) color_data.SetChooseFull(True) dialog = wx.ColourDialog(self.control, color_data) position_window(dialog, self.control) if dialog.ShowModal() == wx.ID_OK: self.value = self.factory.from_wx_color(dialog.GetColourData() .GetColour()) dialog.Destroy()
def __init__(self, editor): """ Initializes the object. """ wx.Frame.__init__(self, editor.control, -1, '', style=wx.SIMPLE_BORDER) el.Bind(wx.EVT_ACTIVATE, self._on_close_dialog) self._closed = False self._closeable = True panel = color_editor_for(editor, self, self._close_dialog) self._swatch_editor = panel._swatch_editor sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(panel) self.SetSizerAndFit(sizer) position_window(self, parent=editor.control) self.Show()
def __init__ ( self, editor ): """ Initializes the object. """ wx.Frame.__init__( self, editor.control, -1, '', style = wx.SIMPLE_BORDER ) wx.EVT_ACTIVATE( self, self._on_close_dialog ) self._closed = False self._closeable = True panel = color_editor_for( editor, self, self._close_dialog ) self._swatch_editor = panel._swatch_editor sizer = wx.BoxSizer( wx.VERTICAL ) sizer.Add( panel ) self.SetSizerAndFit( sizer ) position_window(self, parent=editor.control) self.Show()
def popup_editor(self, event): """ Invokes the pop-up editor for an object trait. """ if not hasattr(self.control, 'is_custom'): self._popup_dialog = ColorDialog(self) else: update_handler = self.control.update_handler if update_handler is not None: update_handler(False) color_data = wx.ColourData() color_data.SetColour(self.factory.to_wx_color(self)) color_data.SetChooseFull(True) dialog = wx.ColourDialog(self.control, color_data) position_window(dialog, parent=self.control) if dialog.ShowModal() == wx.ID_OK: self.value = self.factory.from_wx_color( dialog.GetColourData().GetColour()) self.update_editor() dialog.Destroy() if update_handler is not None: update_handler(True)
def popup_editor ( self, event ): """ Invokes the pop-up editor for an object trait. """ if not hasattr( self.control, 'is_custom' ): self._popup_dialog = ColorDialog( self ) else: update_handler = self.control.update_handler if update_handler is not None: update_handler( False ) color_data = wx.ColourData() color_data.SetColour( self.factory.to_wx_color( self ) ) color_data.SetChooseFull( True ) dialog = wx.ColourDialog( self.control, color_data ) position_window(dialog, parent=self.control) if dialog.ShowModal() == wx.ID_OK: self.value = self.factory.from_wx_color( dialog.GetColourData().GetColour() ) self.update_editor() dialog.Destroy() if update_handler is not None: update_handler( True )