|
From: Kevin A. <ka...@us...> - 2004-10-10 01:20:31
|
Update of /cvsroot/pythoncard/PythonCard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15974/components Modified Files: bitmapcanvas.py Log Message: added fileMode, fillColor, logicalCopyMode attributes to BitmapCanvas removed setFillMode, setFillColor, setCopyMode methods Index: bitmapcanvas.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/components/bitmapcanvas.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** bitmapcanvas.py 28 Sep 2004 03:12:55 -0000 1.43 --- bitmapcanvas.py 10 Oct 2004 01:20:20 -0000 1.44 *************** *** 31,81 **** ! """ ! wxAND src AND dst ! wxAND_INVERT (NOT src) AND dst ! wxAND_REVERSE src AND (NOT dst) ! wxCLEAR 0 ! wxCOPY src ! wxEQUIV (NOT src) XOR dst ! wxINVERT NOT dst ! wxNAND (NOT src) OR (NOT dst) ! wxNOR (NOT src) AND (NOT dst) ! wxNO_OP dst ! wxOR src OR dst ! wxOR_INVERT (NOT src) OR dst ! wxOR_REVERSE src OR (NOT dst) ! wxSET 1 ! wxSRC_INVERT NOT src ! wxXOR src XOR dst ! """ ! LogicalCopyModes = { ! "AND" : wx.AND, ! "AND_INVERT" : wx.AND_INVERT, ! "AND_REVERSE": wx.AND_REVERSE, ! "CLEAR" : wx.CLEAR, ! "COPY": wx.COPY, ! "EQUIV" : wx.EQUIV, ! "INVERT": wx.INVERT, ! "NAND" : wx.NAND, ! "NOR" : wx.NOR, ! "NO_OP" : wx.NO_OP, ! "OR" : wx.OR, ! "OR_INVERT" : wx.OR_INVERT, ! "OR_REVERSE" : wx.OR_REVERSE, ! "SET" : wx.SET, ! "SRC_INVERT" : wx.SRC_INVERT, ! "XOR" : wx.XOR, } BrushFillStyleList = { ! "Transparent" : wx.TRANSPARENT, ! "Solid" : wx.SOLID, ! "BiDiagonalHatch": wx.BDIAGONAL_HATCH, ! "CrossDiagHatch" : wx.CROSSDIAG_HATCH, ! "FDiagonal_Hatch": wx.FDIAGONAL_HATCH, ! "CrossHatch" : wx.CROSS_HATCH, ! "HorizontalHatch": wx.HORIZONTAL_HATCH, ! "VerticalHatch" : wx.VERTICAL_HATCH } --- 31,64 ---- ! # are NOR and NAND descriptions reversed?! ! # double-check wxWidgets docs and/or wxPython source again LogicalCopyModes = { ! "AND" : wx.AND, # src AND dst ! "AND_INVERT" : wx.AND_INVERT, # (NOT src) AND dst ! "AND_REVERSE" : wx.AND_REVERSE, # src AND (NOT dst) ! "CLEAR" : wx.CLEAR, # 0 ! "COPY" : wx.COPY, # src ! "EQUIV" : wx.EQUIV, # (NOT src) XOR dst ! "INVERT" : wx.INVERT, # NOT dst ! "NAND" : wx.NAND, # (NOT src) OR (NOT dst) ! "NOR" : wx.NOR, # (NOT src) AND (NOT dst) ! "NO_OP" : wx.NO_OP, # dst ! "OR" : wx.OR, # src OR dst ! "OR_INVERT" : wx.OR_INVERT, # (NOT src) OR dst ! "OR_REVERSE" : wx.OR_REVERSE, # src OR (NOT dst) ! "SET" : wx.SET, # 1 ! "SRC_INVERT" : wx.SRC_INVERT, # NOT src ! "XOR" : wx.XOR, # src XOR dst } BrushFillStyleList = { ! "TRANSPARENT" : wx.TRANSPARENT, ! "SOLID" : wx.SOLID, ! "BDIAGONAL_HATCH": wx.BDIAGONAL_HATCH, ! "CROSSDIAG_HATCH" : wx.CROSSDIAG_HATCH, ! "FDIAGONAL_HATCH": wx.FDIAGONAL_HATCH, ! "CROSS_HATCH" : wx.CROSS_HATCH, ! "HORIZONTAL_HATCH": wx.HORIZONTAL_HATCH, ! "VERTICAL_HATCH" : wx.VERTICAL_HATCH } *************** *** 120,123 **** --- 103,110 ---- self.clear() self._setForegroundColor((0,0,0)) # 'black' + # these are the defaults for a new MemoryDC + self._fillColor = 'WHITE' + self._fillMode = 'SOLID' + self._logicalCopyMode = 'COPY' self._bindEvents(event.WIDGET_EVENTS) *************** *** 130,143 **** event.Skip() ! def setCopyMode(self, copyMode): ! self._bufImage.SetLogicalFunction(LogicalCopyModes[copyMode.upper()]) ! def _getBackgroundColor( self ) : if self._bufImage is not None: brush = self._bufImage.GetBackground() return brush.GetColour() ! def _setBackgroundColor( self, aColor ) : ! aColor = self._getDefaultColor( aColor ) if self._bufImage is not None: brush = self._bufImage.GetBackground() --- 117,133 ---- event.Skip() ! def _getLogicalCopyMode(self): ! return self._logicalCopyMode ! ! def _setLogicalCopyMode(self, logicalCopyMode): ! self._bufImage.SetLogicalFunction(LogicalCopyModes[logicalCopyMode.upper()]) ! def _getBackgroundColor(self): if self._bufImage is not None: brush = self._bufImage.GetBackground() return brush.GetColour() ! def _setBackgroundColor(self, aColor): ! aColor = self._getDefaultColor(aColor) if self._bufImage is not None: brush = self._bufImage.GetBackground() *************** *** 145,150 **** self._bufImage.SetBackground(brush) ! def setFillColor(self, aColor): ! aColor = self._getDefaultColor( aColor ) if self._bufImage is not None: # KEA 2004-03-01 --- 135,143 ---- self._bufImage.SetBackground(brush) ! def _getFillColor(self): ! return self._fillColor ! ! def _setFillColor(self, aColor): ! aColor = self._getDefaultColor(aColor) if self._bufImage is not None: # KEA 2004-03-01 *************** *** 162,174 **** self._bufImage.SetBrush(nb) ! def setFillMode(self, fillStyle): brush = self._bufImage.GetBrush() ! brush.SetStyle(BrushFillStyleList[fillStyle]) self._bufImage.SetBrush(brush) ! def _getForegroundColor( self ) : return self._penColor ! def _setForegroundColor( self, aColor ) : aColor = self._getDefaultColor( aColor ) self._penColor = aColor --- 155,170 ---- self._bufImage.SetBrush(nb) ! def _getFillMode(self): ! return self._fillMode ! ! def _setFillMode(self, fillStyle): brush = self._bufImage.GetBrush() ! brush.SetStyle(BrushFillStyleList[fillStyle.upper()]) self._bufImage.SetBrush(brush) ! def _getForegroundColor(self): return self._penColor ! def _setForegroundColor(self, aColor): aColor = self._getDefaultColor( aColor ) self._penColor = aColor *************** *** 474,479 **** --- 470,478 ---- backgroundColor = property(_getBackgroundColor, _setBackgroundColor) + fillColor = property(_getFillColor, _setFillColor) + fillMode = property(_getFillMode, _setFillMode) font = property(_getFont, _setFont) foregroundColor = property(_getForegroundColor, _setForegroundColor) + logicalCopyMode = property(_getLogicalCopyMode, _setLogicalCopyMode) thickness = property(_getThickness, _setThickness) |