• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

haiiliin / abqpy / 6433593370

06 Oct 2023 03:30PM UTC coverage: 73.825% (-9.3%) from 83.134%
6433593370

push

github

web-flow
[feature] Add GUI Toolkit Commands (backport #5260) (#5285)

[feature] Add GUI Toolkit Commands (#5260)

* Markdown

* Delete

* Add AFXApp and AFXBoolKeyword

* Delete

* Update headings

* Create parse.py

* Update parse.py

* Unicode Spaces

* Update .pre-commit-config.yaml

* Update md types

* Update Kernel plug-in registration commands.md

* Generated python stubs

* Add class inheritance

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Revert "Update .pre-commit-config.yaml"

This reverts commit 9d3aef3cc.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix mypy errors

* Delete parse.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix return types and imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update AFXColumnItems.md

* Update abaqusGui.py

* Add class/global flags

* Delete flags.py

* Fix flags

* Fix

* Skip mypy

* Update abaqusGui.py

* Update constants.py

* Create kernelAccess.py

* Add plugin docs

* Revert changes by docformatter

* Delete markdown files

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit a65ff5df8)

Co-authored-by: Hailin Wang <hailin.wang@connect.polyu.hk>

3661 of 3661 new or added lines in 151 files covered. (100.0%)

24137 of 32695 relevant lines covered (73.82%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/abaqus/PlugInRegistration/GUIPlugInCommands.py
1
"""GUI plug-in commands register GUI plug-ins either in the **Plug-ins** menu or in a toolbox."""
2
from typing import Sequence
×
3

4
from ..UtilityAndView.abaqusConstants import ALL, SymbolicConstant
×
5
from .AFXMode import AFXMode
×
6
from .FXIcon import FXIcon
×
7
from .FXObject import FXObject
×
8

9

10
def registerGuiMenuButton(
×
11
    toolboxName: str,
12
    object: FXObject,
13
    buttonText: str = "",
14
    messageId: int = AFXMode.ID_ACTIVATE,
15
    icon: FXIcon | None = None,
16
    kernelInitString: str = "",
17
    applicableModules: SymbolicConstant | Sequence[str] = ALL,
18
    version: str = "N/A",
19
    author: str = "N/A",
20
    description: str = "N/A",
21
    helpUrl: str = "N/A",
22
):
23
    """Registers a GUI plug-in in the **Plug-ins** menu.
24

25
    Parameters
26
    ----------
27
    toolboxName : str
28
        A String specifying the name of the toolbox in which the button will be shown. The name appears in the toolbox
29
        title bar.
30
    object : FXObject
31
        The GUI object to which a (messageId, SEL_COMMAND) message will be sent. The object must have been inherited
32
        from FXObject.
33
    buttonText : str, optional
34
        A String specifying the text to be displayed in the **Plug-ins** menu. Use a pipe ( | ) between words to specify
35
        submenus. The default value is the empty string.
36
    messageId : int, optional
37
        An Int specifying the ID to be used when sending a command to the GUI object. The default value is
38
        _AFXMode.ID_ACTIVATE_.
39
    icon : FXIcon, optional
40
        A FXIcon object specifying an icon to be displayed to the left of the text in the menu. For more information,
41
        see [afxCreateIcon](pt01ch01gob125.htm?contextscope=all#gui-auxiliary-afxcreateicon) in the
42
        “Auxiliary functions” section of this guide. The default value is None.
43
    kernelInitString : str, optional
44
        A String specifying the string sent to the kernel the first time this plug-in is invoked. The string is intended
45
        to initialize the kernel (typically by importing modules) in preparation for commands that will be sent by this
46
        plug-in’s GUI. The default value is the empty string.
47
    applicableModules : SymbolicConstant | Sequence[str], optional
48
        The SymbolicConstant ALL or a sequence of one or more Strings specifying the list of modules to which this
49
        plug-in applies. If a plug-in is not applicable to a module, it will be hidden when the user switches into that
50
        module. Possible values of the Strings in the sequence are “Part”, “Property”, “Assembly”, “Step”,
51
        “Interaction”, “Load”, “Mesh”, “Job”, “Visualization”, and “Sketch”. The default value is ALL.
52
    version : str, optional
53
        A String specifying the version of the plug-in. The version is displayed in the **About Plug-ins** dialog box.
54
        The default value is “N/A”.
55
    author : str, optional
56
        A String specifying the author of the plug-in. The author is displayed in the **About Plug-ins** dialog box.
57
        The default value is “N/A”.
58
    description : str, optional
59
        A String specifying the description of the plug-in. The description is displayed in the **About Plug-ins**
60
        dialog box. The default value is “N/A”.
61
    helpUrl : str, optional
62
        A String specifying the universal resource locator (URL) that points to the help for this plug-in. This URL can
63
        be loaded in a web browser from the **View** button in the **About Plug-ins** dialog box. The default value is
64
        “N/A”.
65
    """
66

67

68
def registerGuiToolButton(
×
69
    toolboxName: str,
70
    object: FXObject,
71
    messageId: int = AFXMode.ID_ACTIVATE,
72
    buttonText: str = "",
73
    icon: FXIcon | None = None,
74
    kernelInitString: str = "",
75
    applicableModules: SymbolicConstant | Sequence[str] = ALL,
76
    version: str = "N/A",
77
    author: str = "N/A",
78
    description: str = "N/A",
79
    helpUrl: str = "N/A",
80
):
81
    """Registers a GUI plug-in in a toolbox.
82

83
    Parameters
84
    ----------
85
    toolboxName : str
86
        A String specifying the name of the toolbox in which the button will be shown. The name appears in the toolbox
87
        title bar.
88
    object : FXObject
89
        The GUI object to which a (messageId, SEL_COMMAND) message will be sent. The object must have been inherited
90
        from FXObject.
91
    messageId : int, optional
92
        An Int specifying the ID to be used when sending a command to the GUI object. The default value is
93
        _AFXMode.ID_ACTIVATE_.
94
    buttonText : str, optional
95
        A String specifying the text to be displayed in the **Plug-ins** menu. The default value is the empty string.
96
    icon : FXIcon, optional
97
        A FXIcon object specifying an icon to be displayed to the left of the text in the menu. For more information,
98
        see [afxCreateIcon](pt01ch01gob125.htm?contextscope=all#gui-auxiliary-afxcreateicon) in the
99
        “Auxiliary functions” section of this guide. The default value is None.
100
    kernelInitString : str, optional
101
        A String specifying the string sent to the kernel the first time this plug-in is invoked. The string is intended
102
        to initialize the kernel (typically by importing modules) in preparation for commands that will be sent by this
103
        plug-in’s GUI. The default value is the empty string.
104
    applicableModules : SymbolicConstant | Sequence[str], optional
105
        The SymbolicConstant ALL or a sequence of one or more Strings specifying the list of modules to which this
106
        plug-in applies. If a plug-in is not applicable to a module, it will be hidden when the user switches into that
107
        module. Possible values of the Strings in the sequence are “Part”, “Property”, “Assembly”, “Step”,
108
        “Interaction”, “Load”, “Mesh”, “Job”, “Visualization”, and “Sketch”. The default value is ALL.
109
    version : str, optional
110
        A String specifying the version of the plug-in. The version is displayed in the **About Plug-ins** dialog box.
111
        The default value is “N/A”.
112
    author : str, optional
113
        A String specifying the author of the plug-in. The author is displayed in the **About Plug-ins** dialog box.
114
        The default value is “N/A”.
115
    description : str, optional
116
        A String specifying the description of the plug-in. The description is displayed in the **About Plug-ins**
117
        dialog box. The default value is “N/A”.
118
    helpUrl : str, optional
119
        A String specifying the universal resource locator (URL) that points to the help for this plug-in. This URL can
120
        be loaded in a web browser from the **View** button in the **About Plug-ins** dialog box. The default value is
121
        “N/A”.
122
    """
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc