diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index a00e5d7..7c4c67e 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -163,7 +163,8 @@ class MiRCARTCanvas(wx.Panel): self.parentFrame = parentFrame self.canvasMap = None; self.canvasPos = canvasPos; self.canvasSize = canvasSize; self.brushColours = [4, 1]; self.brushPos = [0, 0]; self.brushSize = [1, 1]; - self.parentFrame.onCanvasUpdate(newColours=self.brushColours) + self.parentFrame.onCanvasUpdate( \ + newBrushSize=self.brushSize, newColours=self.brushColours) self.canvasBackend = MiRCARTCanvasBackend(canvasSize, cellSize) self.canvasJournal = MiRCARTCanvasJournal() self.canvasExportStore = MiRCARTCanvasExportStore(parentCanvas=self) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 6b60b67..1b3b8cb 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -85,6 +85,7 @@ class MiRCARTCanvasInterface(): and self.parentCanvas.brushSize[1] > 1: self.parentCanvas.brushSize = \ [a-1 for a in self.parentCanvas.brushSize] + self.parentFrame.onCanvasUpdate(newBrushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasDecrCanvasHeight(self, event): XXX def canvasDecrCanvasHeight(self, event): @@ -165,6 +166,7 @@ class MiRCARTCanvasInterface(): def canvasIncrBrush(self, event): self.parentCanvas.brushSize = \ [a+1 for a in self.parentCanvas.brushSize] + self.parentFrame.onCanvasUpdate(newBrushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasIncrCanvasHeight(self, event): XXX def canvasIncrCanvasHeight(self, event): diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 3cf26e9..e2278b5 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -34,7 +34,7 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = None - lastCellPos = lastColours = lastPathName = lastSize = lastUndoLevel = None + lastBrushSize = lastCellPos = lastColours = lastPathName = lastSize = lastUndoLevel = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -158,8 +158,10 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} - # {{{ onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): XXX - def onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): + # {{{ onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): XXX + def onCanvasUpdate(self, newBrushSize=None, newCellPos=None, newColours=None, newPathName=None, newSize=None, newUndoLevel=None): + if newBrushSize != None: + self.lastBrushSize = newBrushSize if newCellPos != None: self.lastCellPos = newCellPos if newColours != None: @@ -175,22 +177,24 @@ class MiRCARTFrame(MiRCARTGeneralFrame): textItems.append("X: {:03d} Y: {:03d}".format( \ *self.lastCellPos)) if self.lastSize != None: - textItems.append("W: {:03d} H: {:03d}".format(*self.lastSize)) + textItems.append("W: {:03d} H: {:03d}".format( \ + *self.lastSize)) + if self.lastBrushSize != None: + textItems.append("Brush: {:02d}x{:02d}".format( \ + *self.lastBrushSize)) if self.lastColours != None: textItems.append("FG: {:02d}, BG: {:02d}".format( \ *self.lastColours)) textItems.append("{} on {}".format( \ MiRCARTColours[self.lastColours[0]][4], \ MiRCARTColours[self.lastColours[1]][4])) - if self.lastPathName != None: + if self.lastPathName != None: if self.lastPathName != "": basePathName = os.path.basename(self.lastPathName) textItems.append("Current file: {}".format(basePathName)) self.SetTitle("{} - MiRCART".format(basePathName)) else: self.SetTitle("MiRCART") - if self.lastUndoLevel != None: - textItems.append("Undo level: {}".format(self.lastUndoLevel)) self.statusBar.SetStatusText(" | ".join(textItems)) if self.lastUndoLevel != None: if self.lastUndoLevel >= 0: