- added the flexibility to add the menu entries (Actions) created by

the instances of FlatCAMTool, in any position within the application
menu's.

install method of FlatCAMTool accept now the following kwargs:

'pos' = it is the menu where we want the Action installed. By default,
if no 'pos' arg is provided, the tool will be install in the menutool
menu (as before)

'before' = it is the position within the previously selected menu where,
before it, we will install our new Action (menu entry) generated by the
FlatCAMTool install method. By default, if no 'before' is provided, the
action will be installed in the current last position in the menu.
This commit is contained in:
Marius Stanciu
2018-06-02 22:35:43 +03:00
parent d4310a979c
commit 841919160f
2 changed files with 33 additions and 7 deletions

View File

@@ -29,8 +29,8 @@ class Measurement(FlatCAMTool):
self.click_subscription = None
self.move_subscription = None
def install(self, icon=None, separator=None):
FlatCAMTool.install(self, icon, separator)
def install(self, icon=None, separator=None, **kwargs):
FlatCAMTool.install(self, icon, separator, **kwargs)
self.app.ui.right_layout.addWidget(self)
self.app.plotcanvas.mpl_connect('key_press_event', self.on_key_press)