예제 #1
0
 def _showerror_fired(self,evt):
     if self.tmodel.lastfitfailure:
         ex = self.tmodel.lastfitfailure
         dialog = HasTraits(s=ex.__class__.__name__+': '+str(ex))
         view = View(Item('s',style='custom',show_label=False),
                     resizable=True,buttons=['OK'],title='Fitting error message')
         dialog.edit_traits(view=view)
예제 #2
0
파일: fitgui.py 프로젝트: eteq/pymodelfit
 def _showerror_fired(self,evt):
     if self.tmodel.lastfitfailure:
         ex = self.tmodel.lastfitfailure
         dialog = HasTraits(s=ex.__class__.__name__+': '+str(ex))
         view = View(Item('s',style='custom',show_label=False),
                     resizable=True,buttons=['OK'],title='Fitting error message')
         dialog.edit_traits(view=view)
예제 #3
0
  def edit_traits(self, *args, **kwargs):
    """Extend to set up the view and bind key events."""

    if self.parent:
      # Allow the inspector to handle key events
      self.parent.Bind(wx.EVT_CHAR, self.handleKeyEvent)
      self.parent.SetFocusFromKbd()

    # Set the view to the traits_view attribute if it is not specified
    # Necessary because traits_view is created as an instance attribute
    # at runtime, rather than as part of the class definition
    if not kwargs.get('view', None):
      kwargs['view'] = self.traits_view

    # Set handler and buttons if they are not specified
    if not kwargs['view'].handler:
      kwargs['view'].handler = RegionInspectorHandler
    if not kwargs['view'].buttons:
      kwargs['view'].buttons = NoButtons

    if self.parent:
      # Inspector is being embedded - don't show the title
      self.traits_view.title = ""

    #if 'level1' in self.region.getName():
    #  from dbgp.client import brk; brk(port=9011)

    return HasTraits.edit_traits(self, *args, **kwargs)
예제 #4
0
    def edit_traits(self, *args, **kwargs):
        """Extend to set up the view and bind key events."""

        if self.parent:
            # Allow the inspector to handle key events
            self.parent.Bind(wx.EVT_CHAR, self.handleKeyEvent)
            self.parent.SetFocusFromKbd()

        # Set the view to the traits_view attribute if it is not specified
        # Necessary because traits_view is created as an instance attribute
        # at runtime, rather than as part of the class definition
        if not kwargs.get('view', None):
            kwargs['view'] = self.traits_view

        # Set handler and buttons if they are not specified
        if not kwargs['view'].handler:
            kwargs['view'].handler = RegionInspectorHandler
        if not kwargs['view'].buttons:
            kwargs['view'].buttons = NoButtons

        if self.parent:
            # Inspector is being embedded - don't show the title
            self.traits_view.title = ""

        #if 'level1' in self.region.getName():
        #  from dbgp.client import brk; brk(port=9011)

        return HasTraits.edit_traits(self, *args, **kwargs)
예제 #5
0
    def edit_traits(self, *args, **kwargs):
        """Extend to set the current view."""

        if self.parent:
            # Allow the inspector to handle key events
            self.parent.Bind(wx.EVT_CHAR, self.handleKeyEvent)

        # Set the view to the traits_view attribute if it is not specified
        # Necessary because traits_view is created as an instance attribute
        # at runtime, rather than as part of the class definition
        if not kwargs.get('view', None):
            kwargs['view'] = self.traits_view

        # Set handler and buttons if they are not specified
        if not kwargs['view'].handler:
            kwargs['view'].handler = NetworkInspectorHandler
        if not kwargs['view'].buttons:
            kwargs['view'].buttons = NoButtons

        # Remove the title if the inspector is being embedded
        if self.parent:
            self.traits_view.title = ""

        return HasTraits.edit_traits(self, *args, **kwargs)
예제 #6
0
  def edit_traits(self, *args, **kwargs):
    """Extend to set the current view."""

    if self.parent:
      # Allow the inspector to handle key events
      self.parent.Bind(wx.EVT_CHAR, self.handleKeyEvent)

    # Set the view to the traits_view attribute if it is not specified
    # Necessary because traits_view is created as an instance attribute
    # at runtime, rather than as part of the class definition
    if not kwargs.get('view', None):
      kwargs['view'] = self.traits_view

    # Set handler and buttons if they are not specified
    if not kwargs['view'].handler:
      kwargs['view'].handler = NetworkInspectorHandler
    if not kwargs['view'].buttons:
      kwargs['view'].buttons = NoButtons

    # Remove the title if the inspector is being embedded
    if self.parent:
      self.traits_view.title = ""

    return HasTraits.edit_traits(self, *args, **kwargs)