Toggle PYVCP panel visibility in axis

More
05 Nov 2018 21:47 #120043 by lars
Hello.

I have a small screen (1024x768) and the PYVCP panel in Axis can up take a lot of space. When using bigger GLADEVCP tabs (e.g. a camera view or probe panel) there is not enough space left and the tabs are cut off and only partially visible.

I think it would be a nice to be able to toggle the visibility of the PYVCP panel. I wrote a small patch that adds a keyboard shortcut ('e' because nearly every sensible key is already in use) to do just that. Unfortunately I did not find how to modify the menu in Axis so I could not add a menu entry and submit a proper pull request.

Here is the really small patch for the keyboard shortcut:
--- axis.orig	2018-06-18 23:26:11.000000000 +0200
+++ axis	2018-11-05 22:34:12.137464149 +0100
@@ -229,6 +229,7 @@
     ("#", _("toggle Relative/Machine")),
     (_("Ctrl-Space"), _("Clear notifications")),
     (_("Alt-F, M, V"), _("Open a Menu")),
+    ("E", _("toggle PYVCP panel visibility")),
 ]
 
 
@@ -2569,6 +2570,13 @@
         else:
             commands.set_view_z()
 
+    def toggle_vcp_frame(*args):
+	if vcp_frame.winfo_ismapped():
+	    vcp_frame.grid_remove()
+	else:
+	    vcp_frame.grid(row=0, column=4, rowspan=6, sticky="nw", padx=4, pady=4)
+        o.tkRedraw()
+
     def axis_activated(*args):
         if not hal_present: return # this only makes sense if HAL is present on this machine
         comp['jog.x'] = vars.current_axis.get() == "x"
@@ -3263,6 +3271,8 @@
         f.grid(row=0, column=4, rowspan=6, sticky="nw", padx=4, pady=4)
         vcpparse.filename = vcp
         vcpparse.create_vcp(f, comp)
+        vcp_frame = f
+        root_window.bind("e", commands.toggle_vcp_frame)
     comp.ready()
 
     gladevcp = inifile.find("DISPLAY", "GLADEVCP")

I would appreciate it if someone could tell me where I can find the menu code. I grepped through the whole repository and did not match any menu strings.

Thanks a lot,
Lars
More
05 Nov 2018 22:28 #120050 by lars
Found it in axis.tcl.

I will see if I can understand enough TCL to change this properly.
Time to create page: 0.050 seconds
Powered by Kunena Forum