Exemplo n.º 1
0
    def InitializeColours(self):
        """Initializes the pens."""

        self._pen = wx.Pen(COLOUR, 1, wx.SOLID)
        self._brush = wx.Brush(COLOUR, wx.SOLID)

        contrast = colorutils.ContrastiveColour(COLOUR)
        self._movbrush = wx.Brush(contrast, wx.SOLID)
        self._movpen = wx.Pen(colorutils.ContrastiveColour(contrast), 1,
                              wx.SOLID)
Exemplo n.º 2
0
    def SetColour(self, colour):
        """
        Change the color of the SeparatorCtrl.

        @param colour (wx.Colour)

        """

        self._pen = wx.Pen(colour, 1, wx.SOLID)
        self._brush = wx.Brush(colour, wx.SOLID)

        contrast = colorutils.ContrastiveColour(colour)
        self._movpen = wx.Pen(colorutils.ContrastiveColour(contrast), 1,
                              wx.SOLID)
        self._movbrush = wx.Brush(contrast, wx.SOLID)

        self.Refresh()
Exemplo n.º 3
0
    def __initializeColours(self):
        """Create the pens and brush with default colors."""

        self._highlight = False
        self._colourmidpoint = COLOUR_MID
        self._colourradius = COLOUR_RADIUS

        self._penmidpoint = wx.Pen(COLOUR_MID, 1, wx.SOLID)
        self._penbounds = wx.Pen(colorutils.ContrastiveColour(COLOUR_RADIUS),
                                 1, wx.SOLID)
Exemplo n.º 4
0
    def SetColours(self, colourmidpoint=None, colourradius=None):
        """
        Change the color settings of the PointCtrl.
        Repaint only if necessary.

        @param colourmidpoint (wx.Colour) Color to fill the center
        @param colourradius (wx.Colour) Color to fill the gradient

        """
        torepaint = False

        if colourmidpoint is not None and colourmidpoint != self._colourmidpoint:
            self._penmidpoint = wx.Pen(colourmidpoint, 1, wx.SOLID)
            self._colourmidpoint = colourmidpoint
            torepaint = True

        if colourradius is not None and colourradius != self._colourradius:
            self._penbounds = wx.Pen(
                colorutils.ContrastiveColour(colourradius), 1, wx.SOLID)
            self._colourradius = colourradius
            torepaint = True

        if torepaint: self.Refresh()