Gui Command/ru: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(28 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
|||
The GuiCommand is one of the most important functions of FreeCAD |
|||
{{TOCright}} |
|||
in the main interaction point of the user. Every time the user |
|||
selects a menu item or presses a toolbar button it activates a |
|||
GuiCommand. Some of the attributes of a GuiCommand are: |
|||
* Defines a name |
|||
* Contains an icon |
|||
* Defines the scope for an undo/redo |
|||
* Has a help page |
|||
* Opens and controls dialogs |
|||
* Macro recording |
|||
* and so forth... |
|||
<div class="mw-translate-fuzzy"> |
|||
=== Naming === |
|||
GuiCommand - одна из наиболее важных функций FreeCAD |
|||
The GuiCommand is named in a certain way: ''ModuleName_CommandName'' |
|||
при взаимодействии с пользователем. Каждый раз, когда пользователь |
|||
e.g "Base_Open" this is the Open Gui Command in the Base system. |
|||
выбирает опцию в меню или нажимает на кнопку панели инструментов, активируется GuiCommand. Некоторые из атрибутов GuiCommand: |
|||
The GuiCommand in a certain module is named with the module name |
|||
* Задано имя |
|||
in front e.g. "Part_Cylinder". |
|||
* Содержит иконку |
|||
* Определена возможности для отмены/повтора |
|||
* Есть страница справки |
|||
* Открывает и управляет диалогами |
|||
* Записывается в макрос |
|||
* и.т.д... |
|||
</div> |
|||
== Naming == |
|||
If the docu is not finished use [[Template:UnfinishedDocu]] |
|||
<div class="mw-translate-fuzzy"> |
|||
=== Help page === |
|||
=== Назначение имен === |
|||
Every GuiCommand has to have a help page. The help page is hosted on the |
|||
GuiCommand именуются определенным образом: ''ИмяМодуля_ИмяКоманды'' |
|||
FreeCAD docu wiki. The article has the same name as the GuiCommand, e.g. [[Draft ShapeString]]. |
|||
т.е. "Base_Open" это команда Открыть(Open) графического интерфейса в Base (базовой системе). |
|||
GuiCommand в определенном модуле получает имя имя модуля впереди, например "Part_Cylinder". |
|||
</div> |
|||
<div class="mw-translate-fuzzy"> |
|||
To create your own help pages you can use the template: |
|||
Если документ не закончен (в смысле wiki статья) используйте шаблон [[Template:UnfinishedDocu]] |
|||
</div> |
|||
== Help page == |
|||
<div class="mw-translate-fuzzy"> |
|||
=== Страница справки === |
|||
Каждая GuiCommand должна обладать страницей справки. Страница справки должна располагаться в FreeCAD wiki. Статья имеет то же имя, что и GuiCommand, например, [[Draft ShapeString]]. |
|||
</div> |
|||
<div class="mw-translate-fuzzy"> |
|||
Чтобы создать ваши собственные справочные страницы используйте шаблон: |
|||
[[GuiCommand model]] |
[[GuiCommand model]] |
||
</div> |
|||
<div class="mw-translate-fuzzy"> |
|||
Example: |
|||
Примеры: |
|||
* [[Draft ShapeString]] |
* [[Draft ShapeString]] |
||
* [[Draft Line]] |
* [[Draft Line]] |
||
</div> |
|||
<div class="mw-translate-fuzzy"> |
|||
=== Icons === |
|||
=== Иконки === |
|||
[[Image:Tango-Palette.png|400px|right]] |
[[Image:Tango-Palette.png|400px|right]] |
||
</div> |
|||
[[Image:Tango-Palette.png|400px|right]] |
|||
Every GuiCommand has to have an icon. We use the [http://tango.freedesktop.org/Tango_Desktop_Project| Tango icon set] and its guidelines. On the right side you see |
|||
the tango color palette. |
|||
<div class="mw-translate-fuzzy"> |
|||
Preferable all Icons are drafted with SVG with e.g. [http://inkscape.org Inkscape]. |
|||
Каждая GuiCommand-а должна иметь иконку. Мы используем [http://tango.freedesktop.org/Tango_Desktop_Project| Tango набор иконок] и его принципы. Справа вы можете видеть палитру цветов tango. |
|||
This makes it easier to apply changes and derive |
|||
</div> |
|||
additional Icons in the same application space. |
|||
<div class="mw-translate-fuzzy"> |
|||
'''icons color coding chart''' |
|||
Предпочтительней всех, иконки нарисованные в SVG , например с помощью [http://inkscape.org Inkscape]. |
|||
Это упрощает добавление изменений и получение дополнительных Иконок в том же пространстве приложения. |
|||
</div> |
|||
===Диаграмма цветового кодирования иконок=== |
|||
[[Image:Colorchart.png|200px]] |
[[Image:Colorchart.png|200px]] |
||
Мы стараемся насколько возможно следовать этой диаграмме, так что цвета иконок имеют прямое значение. |
|||
We try as much as possible to respect this chart, so the color of the icons has a direct meaning. |
|||
=== Quality requirements === |
|||
There are a lot of GuiCommands (Features) in FreeCAD which are experimental |
|||
or used shortly for implementation purposes. These GuiCommands are mostly in |
|||
the dedicated workbenches like Part, Mesh or Cam. |
|||
To ensure a good user experience the workbench ''Complete'' was created. This |
|||
is the default start workbench of FreeCAD and incorporates all GuiCommands |
|||
which meet certain '''Quality requirements''' which are described here: |
|||
{{Powerdocnavi{{#translation:}}}} |
|||
* The Command/Feature has to be '''finished'''. No work in progress! |
|||
* Has to have a '''help page''' like [[Draft ShapeString]] |
|||
** All the fields in [[Template:GuiCommand]] have to filled in |
|||
** A picture of the dialogs the command eventually yield |
|||
** detailed description of the command and all its parameters and settings |
|||
** Description of the related python interfaces and classes with example code |
|||
* Set up a proper Icon and menu position |
|||
Hopefully this becomes true for all GuiCommands in the [[List of Commands]]. |
|||
[[Category:User Documentation]] |
|||
[[Category:Command_Reference]] |
|||
{{clear}} |
|||
<languages/> |
Latest revision as of 09:06, 16 August 2022
GuiCommand - одна из наиболее важных функций FreeCAD при взаимодействии с пользователем. Каждый раз, когда пользователь выбирает опцию в меню или нажимает на кнопку панели инструментов, активируется GuiCommand. Некоторые из атрибутов GuiCommand:
- Задано имя
- Содержит иконку
- Определена возможности для отмены/повтора
- Есть страница справки
- Открывает и управляет диалогами
- Записывается в макрос
- и.т.д...
Naming
Назначение имен
GuiCommand именуются определенным образом: ИмяМодуля_ИмяКоманды т.е. "Base_Open" это команда Открыть(Open) графического интерфейса в Base (базовой системе). GuiCommand в определенном модуле получает имя имя модуля впереди, например "Part_Cylinder".
Если документ не закончен (в смысле wiki статья) используйте шаблон Template:UnfinishedDocu
Help page
Страница справки
Каждая GuiCommand должна обладать страницей справки. Страница справки должна располагаться в FreeCAD wiki. Статья имеет то же имя, что и GuiCommand, например, Draft ShapeString.
Чтобы создать ваши собственные справочные страницы используйте шаблон: GuiCommand model
Примеры:
Иконки
Каждая GuiCommand-а должна иметь иконку. Мы используем Tango набор иконок и его принципы. Справа вы можете видеть палитру цветов tango.
Предпочтительней всех, иконки нарисованные в SVG , например с помощью Inkscape. Это упрощает добавление изменений и получение дополнительных Иконок в том же пространстве приложения.
Диаграмма цветового кодирования иконок
Мы стараемся насколько возможно следовать этой диаграмме, так что цвета иконок имеют прямое значение.
- FreeCAD scripting: Python, Introduction to Python, Python scripting tutorial, FreeCAD Scripting Basics
- Modules: Builtin modules, Units, Quantity
- Workbenches: Workbench creation, Gui Commands, Commands, Installing more workbenches
- Meshes and Parts: Mesh Scripting, Topological data scripting, Mesh to Part, PythonOCC
- Parametric objects: Scripted objects, Viewproviders (Custom icon in tree view)
- Scenegraph: Coin (Inventor) scenegraph, Pivy
- Graphical interface: Interface creation, Interface creation completely in Python (1, 2, 3, 4, 5), PySide, PySide examples beginner, intermediate, advanced
- Macros: Macros, How to install macros
- Embedding: Embedding FreeCAD, Embedding FreeCADGui
- Other: Expressions, Code snippets, Line drawing function, FreeCAD vector math library (deprecated)
- Hubs: User hub, Power users hub, Developer hub