MiRCART{CanvasInterface,Frame}.py: complete set of {brush,canvas} size operations.
assets/tool{De,In}cr{Brush,Canvas}{H{,W},W}.png: added/updated.
@ -106,12 +106,21 @@ class MiRCARTCanvasInterface():
|
|||||||
def canvasCut(self, event):
|
def canvasCut(self, event):
|
||||||
pass
|
pass
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ canvasDecrBrush(self, event): XXX
|
# {{{ canvasDecrBrushHeight(self, event): XXX
|
||||||
def canvasDecrBrush(self, event):
|
def canvasDecrBrushHeight(self, event):
|
||||||
if self.parentCanvas.brushSize[0] > 1 \
|
if self.parentCanvas.brushSize[1] > 1:
|
||||||
and self.parentCanvas.brushSize[1] > 1:
|
self.parentCanvas.brushSize[1] -= 1
|
||||||
self.parentCanvas.brushSize = \
|
self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize)
|
||||||
[a-1 for a in 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)
|
self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize)
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ canvasDecrCanvasHeight(self, event): XXX
|
# {{{ canvasDecrCanvasHeight(self, event): XXX
|
||||||
@ -121,6 +130,11 @@ class MiRCARTCanvasInterface():
|
|||||||
self.parentCanvas.canvasSize[0], \
|
self.parentCanvas.canvasSize[0], \
|
||||||
self.parentCanvas.canvasSize[1]-1])
|
self.parentCanvas.canvasSize[1]-1])
|
||||||
# }}}
|
# }}}
|
||||||
|
# {{{ canvasDecrCanvasHeightWidth(self, event): XXX
|
||||||
|
def canvasDecrCanvasHeightWidth(self, event):
|
||||||
|
self.canvasDecrCanvasHeight(event)
|
||||||
|
self.canvasDecrCanvasWidth(event)
|
||||||
|
# }}}
|
||||||
# {{{ canvasDecrCanvasWidth(self, event): XXX
|
# {{{ canvasDecrCanvasWidth(self, event): XXX
|
||||||
def canvasDecrCanvasWidth(self, event):
|
def canvasDecrCanvasWidth(self, event):
|
||||||
if self.parentCanvas.canvasSize[0] > 1:
|
if self.parentCanvas.canvasSize[0] > 1:
|
||||||
@ -197,10 +211,19 @@ class MiRCARTCanvasInterface():
|
|||||||
wx.MessageBox("Failed to export to Pastebin: " + pasteResult, \
|
wx.MessageBox("Failed to export to Pastebin: " + pasteResult, \
|
||||||
"Export to Pastebin", wx.OK|wx.ICON_EXCLAMATION)
|
"Export to Pastebin", wx.OK|wx.ICON_EXCLAMATION)
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ canvasIncrBrush(self, event): XXX
|
# {{{ canvasIncrBrushHeight(self, event): XXX
|
||||||
def canvasIncrBrush(self, event):
|
def canvasIncrBrushHeight(self, event):
|
||||||
self.parentCanvas.brushSize = \
|
self.parentCanvas.brushSize[1] += 1
|
||||||
[a+1 for a in self.parentCanvas.brushSize]
|
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)
|
self.parentFrame.onCanvasUpdate(brushSize=self.parentCanvas.brushSize)
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ canvasIncrCanvasHeight(self, event): XXX
|
# {{{ canvasIncrCanvasHeight(self, event): XXX
|
||||||
@ -209,6 +232,11 @@ class MiRCARTCanvasInterface():
|
|||||||
self.parentCanvas.canvasSize[0], \
|
self.parentCanvas.canvasSize[0], \
|
||||||
self.parentCanvas.canvasSize[1]+1])
|
self.parentCanvas.canvasSize[1]+1])
|
||||||
# }}}
|
# }}}
|
||||||
|
# {{{ canvasIncrCanvasHeightWidth(self, event): XXX
|
||||||
|
def canvasIncrCanvasHeightWidth(self, event):
|
||||||
|
self.canvasIncrCanvasHeight(event)
|
||||||
|
self.canvasIncrCanvasWidth(event)
|
||||||
|
# }}}
|
||||||
# {{{ canvasIncrCanvasWidth(self, event): XXX
|
# {{{ canvasIncrCanvasWidth(self, event): XXX
|
||||||
def canvasIncrCanvasWidth(self, event):
|
def canvasIncrCanvasWidth(self, event):
|
||||||
self._updateCanvasSize([ \
|
self._updateCanvasSize([ \
|
||||||
|
@ -55,18 +55,30 @@ class MiRCARTFrame(MiRCARTGeneralFrame):
|
|||||||
CID_PASTE = [0x10c, TID_COMMAND, "Paste", "&Paste", ["", wx.ART_PASTE], None, False, MiRCARTCanvasInterface.canvasPaste]
|
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_DELETE = [0x10d, TID_COMMAND, "Delete", "De&lete", ["", wx.ART_DELETE], None, False, MiRCARTCanvasInterface.canvasDelete]
|
||||||
CID_INCRW_CANVAS = [0x10e, TID_COMMAND, "Increase canvas width", \
|
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", \
|
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", \
|
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", \
|
CID_DECRH_CANVAS = [0x111, TID_COMMAND, "Decrease canvas height", \
|
||||||
"Decrease canvas h&eight", ["toolDecrCanvasH.png"], [wx.ACCEL_ALT, ord("W")], None, MiRCARTCanvasInterface.canvasDecrCanvasHeight]
|
"Decrease canvas height", ["toolDecrCanvasH.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasHeight]
|
||||||
CID_INCR_BRUSH = [0x112, TID_COMMAND, "Increase brush size", \
|
CID_INCRHW_CANVAS = [0x112, TID_COMMAND, "Increase canvas size", \
|
||||||
"I&ncrease brush size", ["", wx.ART_PLUS], [wx.ACCEL_CTRL, ord("+")], None, MiRCARTCanvasInterface.canvasIncrBrush]
|
"Increase canvas size", ["toolIncrCanvasHW.png"], None, None, MiRCARTCanvasInterface.canvasIncrCanvasHeightWidth]
|
||||||
CID_DECR_BRUSH = [0x113, TID_COMMAND, "Decrease brush size", \
|
CID_DECRHW_CANVAS = [0x113, TID_COMMAND, "Decrease canvas size", \
|
||||||
"&Decrease brush size", ["", wx.ART_MINUS], [wx.ACCEL_CTRL, ord("-")], None, MiRCARTCanvasInterface.canvasDecrBrush]
|
"Decrease canvas size", ["toolDecrCanvasHW.png"], None, None, MiRCARTCanvasInterface.canvasDecrCanvasHeightWidth]
|
||||||
CID_SOLID_BRUSH = [0x114, TID_SELECT, "Solid brush", "&Solid brush", None, None, True, MiRCARTCanvasInterface.canvasBrushSolid]
|
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_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]
|
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_UNDO, CID_REDO, NID_MENU_SEP, \
|
||||||
CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, 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_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", ( \
|
MID_TOOLS = (0x302, TID_MENU, "Tools", "&Tools", ( \
|
||||||
CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT))
|
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_NEW, CID_OPEN, CID_SAVE, CID_SAVEAS, NID_TOOLBAR_HSEP, \
|
||||||
CID_UNDO, CID_REDO, NID_TOOLBAR_HSEP, \
|
CID_UNDO, CID_REDO, NID_TOOLBAR_HSEP, \
|
||||||
CID_CUT, CID_COPY, CID_PASTE, CID_DELETE, 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_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, \
|
CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT, \
|
||||||
NID_TOOLBAR_VSEP, \
|
NID_TOOLBAR_VSEP, \
|
||||||
CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \
|
CID_COLOUR00, CID_COLOUR01, CID_COLOUR02, CID_COLOUR03, CID_COLOUR04, \
|
||||||
CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \
|
CID_COLOUR05, CID_COLOUR06, CID_COLOUR07, CID_COLOUR08, CID_COLOUR09, \
|
||||||
CID_COLOUR10, CID_COLOUR11, CID_COLOUR12, CID_COLOUR13, CID_COLOUR14, \
|
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)
|
# {{{ Accelerators (hotkeys)
|
||||||
AID_EDIT = (0x500, TID_ACCELS, ( \
|
AID_EDIT = (0x500, TID_ACCELS, ( \
|
||||||
CID_NEW, CID_OPEN, CID_SAVE, CID_EXIT, CID_UNDO, CID_REDO, \
|
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))
|
CID_RECT, CID_CIRCLE, CID_FILL, CID_LINE, CID_TEXT, CID_CLONE_SELECT, CID_MOVE_SELECT))
|
||||||
# }}}
|
# }}}
|
||||||
# {{{ Lists
|
# {{{ Lists
|
||||||
|
BIN
assets/toolDecrBrushH.png
Normal file
After Width: | Height: | Size: 271 B |
BIN
assets/toolDecrBrushHW.png
Normal file
After Width: | Height: | Size: 277 B |
BIN
assets/toolDecrBrushW.png
Normal file
After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 265 B |
BIN
assets/toolDecrCanvasHW.png
Normal file
After Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 249 B |
BIN
assets/toolIncrBrushH.png
Normal file
After Width: | Height: | Size: 236 B |
BIN
assets/toolIncrBrushHW.png
Normal file
After Width: | Height: | Size: 290 B |
BIN
assets/toolIncrBrushW.png
Normal file
After Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 246 B |
BIN
assets/toolIncrCanvasHW.png
Normal file
After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 236 B |