Command panel

A forum for research and development of the user interface of FreeCAD

Moderator: agryson

triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Postby triplus » Wed Feb 27, 2019 3:46 pm

StartGlobalAndToolbars.png
StartGlobalAndToolbars.png (14.08 KiB) Viewed 310 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 310 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 310 times
StartDefinitions.png
StartDefinitions.png (23.86 KiB) Viewed 310 times
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Postby triplus » Sun Mar 03, 2019 12:50 pm

RenameAndCopy.png
RenameAndCopy.png (8.68 KiB) Viewed 268 times
  • Two new commands have been implemented. For renaming and copying menus.
CopyMenu.png
CopyMenu.png (28.95 KiB) Viewed 268 times
  • In copy menu dialog an addition of Toolbars section was added.
MacroMenu.png
MacroMenu.png (14.83 KiB) Viewed 268 times
  • Expected result when copying commands from Macro toolbar into a new menu.
RenameDemo.png
RenameDemo.png (30.8 KiB) Viewed 268 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
Posts: 5134
Joined: Thu Jan 05, 2017 9:03 pm

Re: Command panel

Postby Kunda1 » Sun Mar 03, 2019 1:47 pm

Great progress so far @triplus :clap:
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Postby triplus » Sun Mar 03, 2019 4:40 pm

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

Postby efyx » Wed Mar 06, 2019 11:27 am

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
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: Command panel

Postby triplus » Fri Mar 08, 2019 4:55 pm

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
Posts: 5134
Joined: Thu Jan 05, 2017 9:03 pm

Re: Command panel

Postby Kunda1 » Sun Sep 15, 2019 3:27 pm

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
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features