Command panel

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Post by triplus »

StartGlobalAndToolbars.png
StartGlobalAndToolbars.png (14.08 KiB) Viewed 1600 times
Using the command panel for the first time (per workbench), now offers some commands by default. A combination of global menus and commands extracted from toolbars is being used.
GlobalDefinitions.png
GlobalDefinitions.png (25.69 KiB) Viewed 1600 times
A set of definitions, for predefining global menus, is now provided, utilizing new command panel API. Module developers can make use of the API in the same way. Example for Start workbench:

Code: Select all

import CommandPanel as cp


workbench = "StartWorkbench"
# workbench = "GlobalPanel"                         # Global panel


menuNavigation = {
    "workbench": workbench,                         # Mandatory
    "uuid": "StartNavigation",                      # Mandatory
    "name": "Navigation",
    "commands": [
        "Web_OpenWebsite",
        "Start_StartPage",
        "Web_BrowserBack",
        "Web_BrowserNext",
        "Web_BrowserRefresh",
        "Web_BrowserStop",
        "Web_BrowserZoomIn",
        "Web_BrowserZoomOut"]}


domainNavigation = cp.addMenu(menuNavigation)       # Add menuNavigation


menuDefault = {
    "workbench": workbench,
    "uuid": "StartDefault",
    "name": "Default",
    "default": True,                                # Set as default menu
    "commands": [
        "CPGlobalDefault",                          # Add global default
        domainNavigation]}                          # Add menuNavigation


cp.addMenu(menuDefault)
Such definitions can get imported from InitGui.py and are deleted when closing FreeCAD. If user didn't set any menu as a default menu, system provided menu will get used, the one set as a default menu by developer.
StartSystemMenu.png
StartSystemMenu.png (13.34 KiB) Viewed 1600 times
StartDefinitions.png
StartDefinitions.png (23.86 KiB) Viewed 1600 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Post by triplus »

RenameAndCopy.png
RenameAndCopy.png (8.68 KiB) Viewed 1558 times
  • Two new commands have been implemented. For renaming and copying menus.
CopyMenu.png
CopyMenu.png (28.95 KiB) Viewed 1558 times
  • In copy menu dialog an addition of Toolbars section was added.
MacroMenu.png
MacroMenu.png (14.83 KiB) Viewed 1558 times
  • Expected result when copying commands from Macro toolbar into a new menu.
RenameDemo.png
RenameDemo.png (30.8 KiB) Viewed 1558 times
  • Renaming the created menu.
P.S. I consider command panel module for FreeCAD as being feature complete. All planned features form the ToDo list have been implemented!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Command panel

Post by Kunda1 »

Great progress so far @triplus :clap:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Post by triplus »

Kunda1 wrote: Sun Mar 03, 2019 1:47 pm Great progress so far @triplus :clap:
Thanks.
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: Command panel

Post by efyx »

triplus wrote: Sun Mar 03, 2019 4:40 pm
I cannot invoke Command panel... newest build of 0.18 version. I changed in shortcuts inovke key, but also not working. Something broke?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Post by triplus »

efyx wrote: Wed Mar 06, 2019 11:27 am I cannot invoke Command panel... newest build of 0.18 version. I changed in shortcuts inovke key, but also not working. Something broke?
Image

You need to enable the Menu (container) options first.

https://forum.freecadweb.org/viewtopic. ... 50#p281768
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Command panel

Post by Kunda1 »

Issue when trying to resize command panel, it won't resize below a certain threshold and therefore takes up 'real estate'

Image

OS: Manjaro Linux (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18213 (Git) AppImage
Build type: Release
Branch: master
Hash: 22babc09954ac6fda9135ee71d68550921659b1c
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)


Latest version of Command Panel:
commit c28ae6ee1345d39dad58560dfabc882a28772d2e (HEAD -> master, origin/master, origin/HEAD)
Author: triplus <redacted>
Date: Mon Mar 18 22:31:13 2019 +0100

Move Accessories menu from tools menu to menu bar
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Post by triplus »

Will take a look in the following days.

P.S. I plan to add some command definitions, for some commonly used modules, as the API is there. And i doubt other developers will try to do that in foreseeable future. I am thinking the layout of commands will follow the toolbars, but commands will get added to menus (as groups). Therefore by default a lot less space will get used and an individual menu can get expanded, when needed.
Post Reply