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

haiiliin / abqpy / 6438599206

07 Oct 2023 02:54AM UTC coverage: 73.811% (-0.01%) from 73.825%
6438599206

push

github

web-flow
[bugfix] Fix `AFXMainWindow` methods return types (backport #5286) (#5293)

[bugfix] Fix `AFXMainWindow` methods return types (#5286)

* [bugfix] Fix AFXMainWindow return types

* Remove toolboxName argument for registerGuiMenuButton

(cherry picked from commit 51df0fc24)

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

36 of 36 new or added lines in 5 files covered. (100.0%)

24137 of 32701 relevant lines covered (73.81%)

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
from .PluginToolsetBase import PluginToolsetBase
×
9

10

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

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

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

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