From 08fcfa3290b64aec7717e3c380cdc95960b605a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 10 Jan 2018 04:36:39 +0100 Subject: [PATCH] MiRCART{Canvas,Frame}.py: include canvas width and height in status bar. --- MiRCARTCanvas.py | 3 ++- MiRCARTFrame.py | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/MiRCARTCanvas.py b/MiRCARTCanvas.py index 6a3f73e..a00e5d7 100644 --- a/MiRCARTCanvas.py +++ b/MiRCARTCanvas.py @@ -150,7 +150,8 @@ class MiRCARTCanvas(wx.Panel): self.canvasBackend.cellSize)]) self.canvasBackend.reset(self.canvasSize, self.canvasBackend.cellSize) self.canvasJournal.resetCursor(); self.canvasJournal.resetUndo(); - self.parentFrame.onCanvasUpdate(newUndoLevel=-1) + self.parentFrame.onCanvasUpdate( \ + newSize=self.canvasSize, newUndoLevel=-1) # }}} # diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 4a76177..3cf26e9 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -34,7 +34,7 @@ import os, wx class MiRCARTFrame(MiRCARTGeneralFrame): """XXX""" panelCanvas = None - lastCellPos = lastColours = lastPathName = lastUndoLevel = None + lastCellPos = lastColours = lastPathName = lastSize = lastUndoLevel = None # {{{ Commands # Id Type Id Labels Icon bitmap Accelerator [Initial state] @@ -158,20 +158,24 @@ class MiRCARTFrame(MiRCARTGeneralFrame): else: self.itemsById[eventId][7](self.panelCanvas.canvasInterface, event) # }}} - # {{{ onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newUndoLevel=None): XXX - def onCanvasUpdate(self, newCellPos=None, newColours=None, newPathName=None, newUndoLevel=None): + # {{{ 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): if newCellPos != None: self.lastCellPos = newCellPos if newColours != None: self.lastColours = newColours if newPathName != None: self.lastPathName = newPathName + if newSize != None: + self.lastSize = newSize if newUndoLevel != None: self.lastUndoLevel = newUndoLevel textItems = [] if self.lastCellPos != None: textItems.append("X: {:03d} Y: {:03d}".format( \ *self.lastCellPos)) + if self.lastSize != None: + textItems.append("W: {:03d} H: {:03d}".format(*self.lastSize)) if self.lastColours != None: textItems.append("FG: {:02d}, BG: {:02d}".format( \ *self.lastColours))