Example #1
0
    def __init__ ( self, parent, id = -1, pos = wx.DefaultPosition,
                   size = wx.DefaultSize, style = wx.TAB_TRAVERSAL,
                   name = "scrolledpanel" ):
        from facets.extra.helper.debug import created_from; created_from( self )

        wx.PyScrolledWindow.__init__( self, parent, id, pos = pos, size = size,
                                      style = style, name = name )
        self.SetInitialSize( size )
        self.SetBackgroundColour( parent.GetBackgroundColour() )

        # Override the C++ ChildFocus event handler:
        ChildFocusOverride( self )
Example #2
0
    def __init__ ( self, parent, *args, **kw ):
        """ Creates a wx.Panel that correctly sets its background color to be
            the same as its parents.
        """
        from facets.extra.helper.debug import created_from; created_from( self )

        wx.Panel.__init__( self, parent, *args, **kw )

        wx.EVT_CHILD_FOCUS(      self, self.OnChildFocus )
        wx.EVT_ERASE_BACKGROUND( self, self.OnEraseBackground )
        wx.EVT_PAINT(            self, self.OnPaint )

        self.SetBackgroundColour( parent.GetBackgroundColour() )

        # Make sure that we have an associated GUI toolkit neutral adapter
        # defined so we don't have to check in the paint handler each time:
        toolkit().control_adapter_for( self )
Example #3
0
    def create_control ( self, parent, tab_stop = False, handle_keys = False ):
        """ Returns an adapted control suitable for use as a base for creating
            custom controls.
        """
        policy = Qt.NoFocus
        if tab_stop:
            policy = Qt.TabFocus
            if handle_keys:
                policy = Qt.StrongFocus
        elif handle_keys:
            policy = Qt.ClickFocus

        control = Widget( check_parent( parent ) )
        control.setFocusPolicy( policy )
        control.setMouseTracking( True )
        control._auto_fill = False

        from facets.extra.helper.debug import created_from
        created_from( control )

        return control_adapter_for( control )
Example #4
0
    def __init__ ( self, *args, **kw ):
        from facets.extra.helper.debug import created_from; created_from(self,2)

        super( WxControl, self ).__init__( *args, **kw )