mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 15:26:37 +00:00
MiRCART{CanvasInterface,{,General}Frame}.py: add & sync {tools,colour selection} toolbar items as radio tools.
This commit is contained in:
parent
46258cde32
commit
a33ff6b5df
@ -296,42 +296,56 @@ class MiRCARTCanvasInterface():
|
||||
def canvasToolCircle(self, event):
|
||||
self.canvasTool = MiRCARTToolCircle(self.parentCanvas)
|
||||
self.parentFrame.menuItemsById[self.parentFrame.CID_CIRCLE[0]].Check(True)
|
||||
toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_CIRCLE[0]].GetToolBar()
|
||||
toolBar.ToggleTool(self.parentFrame.CID_CIRCLE[0], True)
|
||||
self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name)
|
||||
# }}}
|
||||
# {{{ canvasToolFill(self, event): XXX
|
||||
def canvasToolFill(self, event):
|
||||
self.canvasTool = MiRCARTToolFill(self.parentCanvas)
|
||||
self.parentFrame.menuItemsById[self.parentFrame.CID_FILL[0]].Check(True)
|
||||
toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_FILL[0]].GetToolBar()
|
||||
toolBar.ToggleTool(self.parentFrame.CID_FILL[0], True)
|
||||
self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name)
|
||||
# }}}
|
||||
# {{{ canvasToolLine(self, event): XXX
|
||||
def canvasToolLine(self, event):
|
||||
self.canvasTool = MiRCARTToolLine(self.parentCanvas)
|
||||
self.parentFrame.menuItemsById[self.parentFrame.CID_LINE[0]].Check(True)
|
||||
toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_LINE[0]].GetToolBar()
|
||||
toolBar.ToggleTool(self.parentFrame.CID_LINE[0], True)
|
||||
self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name)
|
||||
# }}}
|
||||
# {{{ canvasToolSelectClone(self, event): XXX
|
||||
def canvasToolSelectClone(self, event):
|
||||
self.canvasTool = MiRCARTToolSelectClone(self.parentCanvas)
|
||||
self.parentFrame.menuItemsById[self.parentFrame.CID_CLONE_SELECT[0]].Check(True)
|
||||
toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_CLONE_SELECT[0]].GetToolBar()
|
||||
toolBar.ToggleTool(self.parentFrame.CID_CLONE_SELECT[0], True)
|
||||
self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name)
|
||||
# }}}
|
||||
# {{{ canvasToolSelectMove(self, event): XXX
|
||||
def canvasToolSelectMove(self, event):
|
||||
self.canvasTool = MiRCARTToolSelectMove(self.parentCanvas)
|
||||
self.parentFrame.menuItemsById[self.parentFrame.CID_MOVE_SELECT[0]].Check(True)
|
||||
toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_MOVE_SELECT[0]].GetToolBar()
|
||||
toolBar.ToggleTool(self.parentFrame.CID_MOVE_SELECT[0], True)
|
||||
self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name)
|
||||
# }}}
|
||||
# {{{ canvasToolRect(self, event): XXX
|
||||
def canvasToolRect(self, event):
|
||||
self.canvasTool = MiRCARTToolRect(self.parentCanvas)
|
||||
self.parentFrame.menuItemsById[self.parentFrame.CID_RECT[0]].Check(True)
|
||||
toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_RECT[0]].GetToolBar()
|
||||
toolBar.ToggleTool(self.parentFrame.CID_RECT[0], True)
|
||||
self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name)
|
||||
# }}}
|
||||
# {{{ canvasToolText(self, event): XXX
|
||||
def canvasToolText(self, event):
|
||||
self.canvasTool = MiRCARTToolText(self.parentCanvas)
|
||||
self.parentFrame.menuItemsById[self.parentFrame.CID_TEXT[0]].Check(True)
|
||||
toolBar = self.parentFrame.toolBarItemsById[self.parentFrame.CID_TEXT[0]].GetToolBar()
|
||||
toolBar.ToggleTool(self.parentFrame.CID_TEXT[0], True)
|
||||
self.parentFrame.onCanvasUpdate(toolName=self.canvasTool.name)
|
||||
# }}}
|
||||
# {{{ canvasUndo(self, event): XXX
|
||||
|
@ -76,22 +76,22 @@ class MiRCARTFrame(MiRCARTGeneralFrame):
|
||||
CID_CLONE_SELECT = [0x155, TID_SELECT, "Clone", "Cl&one", ["toolClone.png"], [wx.ACCEL_CTRL, ord("E")], False, MiRCARTCanvasInterface.canvasToolSelectClone]
|
||||
CID_MOVE_SELECT = [0x156, TID_SELECT, "Move", "&Move", ["toolMove.png"], [wx.ACCEL_CTRL, ord("M")], False, MiRCARTCanvasInterface.canvasToolSelectMove]
|
||||
|
||||
CID_COLOUR00 = [0x1a0, TID_COMMAND, "Colour #00", "Colour #00", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR01 = [0x1a1, TID_COMMAND, "Colour #01", "Colour #01", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR02 = [0x1a2, TID_COMMAND, "Colour #02", "Colour #02", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR03 = [0x1a3, TID_COMMAND, "Colour #03", "Colour #03", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR04 = [0x1a4, TID_COMMAND, "Colour #04", "Colour #04", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR05 = [0x1a5, TID_COMMAND, "Colour #05", "Colour #05", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR06 = [0x1a6, TID_COMMAND, "Colour #06", "Colour #06", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR07 = [0x1a7, TID_COMMAND, "Colour #07", "Colour #07", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR08 = [0x1a8, TID_COMMAND, "Colour #08", "Colour #08", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR09 = [0x1a9, TID_COMMAND, "Colour #09", "Colour #09", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR10 = [0x1aa, TID_COMMAND, "Colour #10", "Colour #10", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR11 = [0x1ab, TID_COMMAND, "Colour #11", "Colour #11", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR12 = [0x1ac, TID_COMMAND, "Colour #12", "Colour #12", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR13 = [0x1ad, TID_COMMAND, "Colour #13", "Colour #13", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR14 = [0x1ae, TID_COMMAND, "Colour #14", "Colour #14", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR15 = [0x1af, TID_COMMAND, "Colour #15", "Colour #15", None, None, None, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR00 = [0x1a0, TID_SELECT, "Colour #00", "Colour #00", None, None, True, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR01 = [0x1a1, TID_SELECT, "Colour #01", "Colour #01", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR02 = [0x1a2, TID_SELECT, "Colour #02", "Colour #02", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR03 = [0x1a3, TID_SELECT, "Colour #03", "Colour #03", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR04 = [0x1a4, TID_SELECT, "Colour #04", "Colour #04", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR05 = [0x1a5, TID_SELECT, "Colour #05", "Colour #05", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR06 = [0x1a6, TID_SELECT, "Colour #06", "Colour #06", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR07 = [0x1a7, TID_SELECT, "Colour #07", "Colour #07", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR08 = [0x1a8, TID_SELECT, "Colour #08", "Colour #08", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR09 = [0x1a9, TID_SELECT, "Colour #09", "Colour #09", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR10 = [0x1aa, TID_SELECT, "Colour #10", "Colour #10", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR11 = [0x1ab, TID_SELECT, "Colour #11", "Colour #11", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR12 = [0x1ac, TID_SELECT, "Colour #12", "Colour #12", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR13 = [0x1ad, TID_SELECT, "Colour #13", "Colour #13", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR14 = [0x1ae, TID_SELECT, "Colour #14", "Colour #14", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
CID_COLOUR15 = [0x1af, TID_SELECT, "Colour #15", "Colour #15", None, None, False, MiRCARTCanvasInterface.canvasColour]
|
||||
# }}}
|
||||
# {{{ Menus
|
||||
MID_FILE = (0x300, TID_MENU, "File", "&File", ( \
|
||||
|
@ -103,15 +103,23 @@ class MiRCARTGeneralFrame(wx.Frame):
|
||||
self.toolBars[numToolBar].AddSeparator()
|
||||
elif toolBarItem == NID_TOOLBAR_VSEP:
|
||||
numToolBar += 1; self.toolBars.append(None);
|
||||
elif toolBarItem[1] == TID_SELECT:
|
||||
self.itemsById[toolBarItem[0]] = toolBarItem
|
||||
toolBarItemWindow = \
|
||||
self.toolBars[numToolBar].AddRadioTool( \
|
||||
toolBarItem[0], toolBarItem[2], toolBarItem[4][2])
|
||||
self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow
|
||||
if toolBarItem[6] != None:
|
||||
toolBarItemWindow.Toggle(toolBarItem[6])
|
||||
self.Bind(wx.EVT_TOOL, self.onInput, toolBarItemWindow)
|
||||
self.Bind(wx.EVT_TOOL_RCLICKED, self.onInput, toolBarItemWindow)
|
||||
else:
|
||||
self.itemsById[toolBarItem[0]] = toolBarItem
|
||||
toolBarItemWindow = \
|
||||
self.toolBars[numToolBar].AddTool( \
|
||||
toolBarItem[0], toolBarItem[2], \
|
||||
toolBarItem[4][2])
|
||||
toolBarItem[0], toolBarItem[2], toolBarItem[4][2])
|
||||
self.toolBarItemsById[toolBarItem[0]] = toolBarItemWindow
|
||||
if toolBarItem[6] != None \
|
||||
and toolBarItem[1] == TID_COMMAND:
|
||||
if toolBarItem[6] != None:
|
||||
toolBarItemWindow.Enable(toolBarItem[6])
|
||||
self.Bind(wx.EVT_TOOL, self.onInput, toolBarItemWindow)
|
||||
self.Bind(wx.EVT_TOOL_RCLICKED, self.onInput, toolBarItemWindow)
|
||||
|
Loading…
Reference in New Issue
Block a user