diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index c9f932b..c95a524 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -106,12 +106,21 @@ class MiRCARTCanvasInterface(): def canvasCut(self, event): pass # }}} - # {{{ canvasDecrBrush(self, event): XXX - def canvasDecrBrush(self, event): - if self.parentCanvas.brushSize[0] > 1 \ - and self.parentCanvas.brushSize[1] > 1: - self.parentCanvas.brushSize = \ - [a-1 for a in self.parentCanvas.brushSize] + # {{{ canvasDecrBrushHeight(self, event): XXX + def canvasDecrBrushHeight(self, event): + if self.parentCanvas.brushSize[1] > 1: + self.parentCanvas.brushSize[1] -= 1 + self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) + # }}} + # {{{ canvasDecrBrushHeightWidth(self, event): XXX + def canvasDecrBrushHeightWidth(self, event): + self.canvasDecrBrushHeight(event) + self.canvasDecrBrushWidth(event) + # }}} + # {{{ canvasDecrBrushWidth(self, event): XXX + def canvasDecrBrushWidth(self, event): + if self.parentCanvas.brushSize[0] > 1: + self.parentCanvas.brushSize[0] -= 1 self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasDecrCanvasHeight(self, event): XXX @@ -121,6 +130,11 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasSize[0], \ self.parentCanvas.canvasSize[1]-1]) # }}} + # {{{ canvasDecrCanvasHeightWidth(self, event): XXX + def canvasDecrCanvasHeightWidth(self, event): + self.canvasDecrCanvasHeight(event) + self.canvasDecrCanvasWidth(event) + # }}} # {{{ canvasDecrCanvasWidth(self, event): XXX def canvasDecrCanvasWidth(self, event): if self.parentCanvas.canvasSize[0] > 1: @@ -197,10 +211,19 @@ class MiRCARTCanvasInterface(): wx.MessageBox("Failed to export to Pastebin: " + pasteResult, \ "Export to Pastebin", wx.OK|wx.ICON_EXCLAMATION) # }}} - # {{{ canvasIncrBrush(self, event): XXX - def canvasIncrBrush(self, event): - self.parentCanvas.brushSize = \ - [a+1 for a in self.parentCanvas.brushSize] + # {{{ canvasIncrBrushHeight(self, event): XXX + def canvasIncrBrushHeight(self, event): + self.parentCanvas.brushSize[1] += 1 + self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) + # }}} + # {{{ canvasIncrBrushHeightWidth(self, event): XXX + def canvasIncrBrushHeightWidth(self, event): + self.canvasIncrBrushHeight(event) + self.canvasIncrBrushWidth(event) + # }}} + # {{{ canvasIncrBrushWidth(self, event): XXX + def canvasIncrBrushWidth(self, event): + self.parentCanvas.brushSize[0] += 1 self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize) # }}} # {{{ canvasIncrCanvasHeight(self, event): XXX @@ -209,6 +232,11 @@ class MiRCARTCanvasInterface(): self.parentCanvas.canvasSize[0], \ self.parentCanvas.canvasSize[1]+1]) # }}} + # {{{ canvasIncrCanvasHeightWidth(self, event): XXX + def canvasIncrCanvasHeightWidth(self, event): + self.canvasIncrCanvasHeight(event) + self.canvasIncrCanvasWidth(event) + # }}} # {{{ canvasIncrCanvasWidth(self, event): XXX def canvasIncrCanvasWidth(self, event): self._updateCanvasSize([ \ diff --git a/MiRCARTFrame.py b/MiRCARTFrame.py index 9ac8738..3a3d3bf 100644 --- a/MiRCARTFrame.py +++ b/MiRCARTFrame.py @@ -55,18 +55,30 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False, MiRCARTCanvasInterface.canvasPaste] CID_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False, MiRCARTCanvasInterface.canvasDelete] CID_INCRW_CANVAS = [0x10e, TID_COMMAND, "Increase canvas width", \ - "Increase canvas &width", ["toolIncrCanvasW.png"], [wx.ACCEL_ALT, ord("D")], None, MiRCARTCanvasInterface.canvasIncrCanvasWidth] + "Increase canvas width", ["toolIncrCanvasW.png"], None, None, MiRCARTCanvasInterface.canvasIncrCanvasWidth] CID_DECRW_CANVAS = [0x10f, TID_COMMAND, "Decrease canvas width", \ - "Decrease canvas w&idth", ["toolDecrCanvasW.png"], [wx.ACCEL_ALT, ord("A")], None, MiRCARTCanvasInterface.canvasDecrCanvasWidth] + "Decrease canvas width", ["toolDecrCanvasW.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasWidth] CID_INCRH_CANVAS = [0x110, TID_COMMAND, "Increase canvas height", \ - "Increase canvas &height", ["toolIncrCanvasH.png"], [wx.ACCEL_ALT, ord("S")], None, MiRCARTCanvasInterface.canvasIncrCanvasHeight] + "Increase canvas height", ["toolIncrCanvasH.png"], None, None, MiRCARTCanvasInterface.canvasIncrCanvasHeight] CID_DECRH_CANVAS = [0x111, TID_COMMAND, "Decrease canvas height", \ - "Decrease canvas h&eight", ["toolDecrCanvasH.png"], [wx.ACCEL_ALT, ord("W")], None, MiRCARTCanvasInterface.canvasDecrCanvasHeight] - CID_INCR_BRUSH = [0x112, TID_COMMAND, "Increase brush size", \ - "I&ncrease brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")], None, MiRCARTCanvasInterface.canvasIncrBrush] - CID_DECR_BRUSH = [0x113, TID_COMMAND, "Decrease brush size", \ - "&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")], None, MiRCARTCanvasInterface.canvasDecrBrush] - CID_SOLID_BRUSH = [0x114, TID_SELECT, "Solid brush", "&Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid] + "Decrease canvas height", ["toolDecrCanvasH.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasHeight] + CID_INCRHW_CANVAS = [0x112, TID_COMMAND, "Increase canvas size", \ + "Increase canvas size", ["toolIncrCanvasHW.png"], None, None, MiRCARTCanvasInterface.canvasIncrCanvasHeightWidth] + CID_DECRHW_CANVAS = [0x113, TID_COMMAND, "Decrease canvas size", \ + "Decrease canvas size", ["toolDecrCanvasHW.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasHeightWidth] + CID_INCRW_BRUSH = [0x114, TID_COMMAND, "Increase brush width", \ + "Increase brush width", ["toolIncrBrushW.png"], None, None, MiRCARTCanvasInterface.canvasIncrBrushWidth] + CID_DECRW_BRUSH = [0x115, TID_COMMAND, "Decrease brush width", \ + "Decrease brush width", ["toolDecrBrushW.png"], None, None, MiRCARTCanvasInterface.canvasDecrBrushWidth] + CID_INCRH_BRUSH = [0x116, TID_COMMAND, "Increase brush height", \ + "Increase brush height", ["toolIncrBrushH.png"], None, None, MiRCARTCanvasInterface.canvasIncrBrushHeight] + CID_DECRH_BRUSH = [0x117, TID_COMMAND, "Decrease brush height", \ + "Decrease brush height", ["toolDecrBrushH.png"], None, None, MiRCARTCanvasInterface.canvasDecrBrushHeight] + CID_INCRHW_BRUSH = [0x118, TID_COMMAND, "Increase brush size", \ + "Increase brush size", ["toolIncrBrushHW.png"], None, None, MiRCARTCanvasInterface.canvasIncrBrushHeightWidth] + CID_DECRHW_BRUSH = [0x119, TID_COMMAND, "Decrease brush size", \ + "Decrease brush size", ["toolDecrBrushHW.png"], None, None, MiRCARTCanvasInterface.canvasDecrBrushHeightWidth] + CID_SOLID_BRUSH = [0x11a, TID_SELECT, "Solid brush", "Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid] CID_RECT = [0x150, TID_SELECT, "Rectangle", "&Rectangle", ["toolRect.png"], [wx.ACCEL_CTRL, ord("R")], True, MiRCARTCanvasInterface.canvasToolRect] CID_CIRCLE = [0x151, TID_SELECT, "Circle", "&Circle", ["toolCircle.png"], [wx.ACCEL_CTRL, ord("C")], False, MiRCARTCanvasInterface.canvasToolCircle] @@ -102,7 +114,10 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_UNDO, CID_REDO, NID_MENU_SEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_MENU_SEP, \ CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, NID_MENU_SEP, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, CID_SOLID_BRUSH)) + CID_INCRHW_CANVAS, CID_DECRHW_CANVAS, NID_MENU_SEP, \ + CID_INCRW_BRUSH, CID_DECRW_BRUSH, CID_INCRH_BRUSH, CID_DECRH_BRUSH, NID_MENU_SEP, \ + CID_INCRHW_BRUSH, CID_DECRHW_BRUSH, NID_MENU_SEP, \ + CID_SOLID_BRUSH)) MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) # }}} @@ -111,20 +126,20 @@ class MiRCARTFrame(MiRCARTGeneralFrame): CID_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_HSEP, \ CID_UNDO, CID_REDO, NID_TOOLBAR_HSEP, \ CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, NID_TOOLBAR_HSEP, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, NID_TOOLBAR_HSEP, \ CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, NID_TOOLBAR_HSEP, \ + CID_INCRHW_CANVAS, CID_DECRHW_CANVAS, NID_TOOLBAR_HSEP, \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, \ NID_TOOLBAR_VSEP, \ CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \ CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \ CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \ - CID_COLOUR15)) + CID_COLOUR15, NID_TOOLBAR_HSEP, \ + CID_INCRW_BRUSH, CID_DECRW_BRUSH, CID_INCRH_BRUSH, CID_DECRH_BRUSH, NID_TOOLBAR_HSEP, \ + CID_INCRHW_BRUSH, CID_DECRHW_BRUSH)) # }}} # {{{ Accelerators (hotkeys) AID_EDIT = (0x500, TID_ACCELS, ( \ CID_NEW, CID_OPEN, CID_SAVE, CID_EXIT, CID_UNDO, CID_REDO, \ - CID_INCRW_CANVAS, CID_DECRW_CANVAS, CID_INCRH_CANVAS, CID_DECRH_CANVAS, \ - CID_INCR_BRUSH, CID_DECR_BRUSH, \ CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT)) # }}} # {{{ Lists diff --git a/assets/toolDecrBrushH.png b/assets/toolDecrBrushH.png new file mode 100644 index 0000000..6b37273 Binary files /dev/null and b/assets/toolDecrBrushH.png differ diff --git a/assets/toolDecrBrushHW.png b/assets/toolDecrBrushHW.png new file mode 100644 index 0000000..b5c14ca Binary files /dev/null and b/assets/toolDecrBrushHW.png differ diff --git a/assets/toolDecrBrushW.png b/assets/toolDecrBrushW.png new file mode 100644 index 0000000..64e964b Binary files /dev/null and b/assets/toolDecrBrushW.png differ diff --git a/assets/toolDecrCanvasH.png b/assets/toolDecrCanvasH.png index 6b37273..1ea55ef 100644 Binary files a/assets/toolDecrCanvasH.png and b/assets/toolDecrCanvasH.png differ diff --git a/assets/toolDecrCanvasHW.png b/assets/toolDecrCanvasHW.png new file mode 100644 index 0000000..2bcefdc Binary files /dev/null and b/assets/toolDecrCanvasHW.png differ diff --git a/assets/toolDecrCanvasW.png b/assets/toolDecrCanvasW.png index 64e964b..3336980 100644 Binary files a/assets/toolDecrCanvasW.png and b/assets/toolDecrCanvasW.png differ diff --git a/assets/toolIncrBrushH.png b/assets/toolIncrBrushH.png new file mode 100644 index 0000000..157c81a Binary files /dev/null and b/assets/toolIncrBrushH.png differ diff --git a/assets/toolIncrBrushHW.png b/assets/toolIncrBrushHW.png new file mode 100644 index 0000000..34f3a41 Binary files /dev/null and b/assets/toolIncrBrushHW.png differ diff --git a/assets/toolIncrBrushW.png b/assets/toolIncrBrushW.png new file mode 100644 index 0000000..6790bfc Binary files /dev/null and b/assets/toolIncrBrushW.png differ diff --git a/assets/toolIncrCanvasH.png b/assets/toolIncrCanvasH.png index 157c81a..a3004a6 100644 Binary files a/assets/toolIncrCanvasH.png and b/assets/toolIncrCanvasH.png differ diff --git a/assets/toolIncrCanvasHW.png b/assets/toolIncrCanvasHW.png new file mode 100644 index 0000000..4002cc8 Binary files /dev/null and b/assets/toolIncrCanvasHW.png differ diff --git a/assets/toolIncrCanvasW.png b/assets/toolIncrCanvasW.png index 6790bfc..48f8053 100644 Binary files a/assets/toolIncrCanvasW.png and b/assets/toolIncrCanvasW.png differ