• 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/AFXMainWindow.py
1
from __future__ import annotations
×
2

3
from .AFXGuiObjectManager import AFXGuiObjectManager
×
4
from .AFXToolsetGui import AFXToolsetGui
×
5
from .constants import DECOR_ALL
×
6
from .FXApp import FXApp
×
7
from .FXIcon import FXIcon
×
8
from .FXMainWindow import FXMainWindow
×
9

10

11
class AFXMainWindow(FXMainWindow):
×
12
    """This class is responsible for constructing the components of the main window.
13

14
    It also provides accessors for the various components constructed.
15
    """
16

17
    #: Used to handle the quit message.
18
    ID_QUIT: int = hash("ID_QUIT")
×
19

20
    #: Used to handle tabbing.
21
    ID_TAB: int = hash("ID_TAB")
×
22

23
    #: Toggle the visibility of the model tree.
24
    ID_TOGGLE_MODEL_TREE: int = hash("ID_TOGGLE_MODEL_TREE")
×
25

26
    #: Toggle full screen.
27
    ID_TOGGLE_FULL_SCREEN: int = hash("ID_TOGGLE_FULL_SCREEN")
×
28

29
    #: Do not use, do not delete; for use by derived classes.
30
    ID_LAST: int = hash("ID_LAST")
×
31

32
    def __init__(
×
33
        self,
34
        app: FXApp,
35
        title: str,
36
        icon: FXIcon | None = None,
37
        miniIcon: FXIcon | None = None,
38
        opts: int = DECOR_ALL,
39
        x: int = 0,
40
        y: int = 0,
41
        w: int = 0,
42
        h: int = 0,
43
    ):
44
        """Constructor.
45

46
        Parameters
47
        ----------
48
        app : FXApp
49
            FXApp object.
50
        title : str
51
            Main window title.
52
        icon : FXIcon | None
53
            Main window icon.
54
        miniIcon : FXIcon | None
55
            Minimized icon.
56
        opts : int
57
            Main window options.
58
        x : int
59
            X location of the main window.
60
        y : int
61
            Y location of the main window.
62
        w : int
63
            Width of the main window.
64
        h : int
65
            Height of the main window.
66
        """
67

68
    def appendApplicableModuleForTreeTab(self, name: str, moduleName: str):
×
69
        """Appends a module name to the list of modules to which a tree tab is applicable.
70

71
        Parameters
72
        ----------
73
        name : str
74
            Name of the tab item.
75
        moduleName : str
76
            Module name to be appended to the list of the tab's applicable modules.
77
        """
78

79
    def appendTreeTab(self, text: str, name: str):
×
80
        """Appends a new tab item to the tree toolset tab book and returns a vertical frame managed by the new
81
        tab item; you must call create() on the vertical frame after you construct all its child widgets.
82

83
        Parameters
84
        ----------
85
        text : str
86
            Text to be shown in the new tab item.
87
        name : str
88
            Name of the new tab item.
89
        """
90

91
    def appendVisibleModuleForTreeTab(self, name: str, moduleName: str):
×
92
        """Appends a module to the list of modules in which a tree tab is visible.
93

94
        Parameters
95
        ----------
96
        name : str
97
            Name of the tab item.
98
        moduleName : str
99
            Module name to be appended to the list of the tab's modules in which it is visible.
100
        """
101

102
    def create(self):
×
103
        """Virtual base class method for creating windowing system resources.
104

105
        Reimplemented from FXTopWindow.
106
        """
107

108
    def getContextBar(self):
×
109
        """Returns a pointer to the context bar container."""
110

111
    def getCurrentTreeTab(self):
×
112
        """Returns the current tab item."""
113

114
    def getDefaultHeight(self):
×
115
        """Returns the default main window height.
116

117
        Reimplemented from FXTopWindow.
118
        """
119

120
    def getDefaultWidth(self):
×
121
        """Returns the default main window width.
122

123
        Reimplemented from FXTopWindow.
124
        """
125

126
    def getDisplayedNameAtIndex(self, index: int):
×
127
        """Returns the displayed name at the given position in the list.
128

129
        Parameters
130
        ----------
131
        index : int
132
            Position in the module list.
133
        """
134

135
    def getDrawingAreaHeight(self):
×
136
        """Returns the height of the drawing area in pixels."""
137

138
    def getDrawingAreaWidth(self):
×
139
        """Returns the width of the drawing area in pixels."""
140

141
    def getHelpToolset(self):
×
142
        """Returns a pointer to the help toolset."""
143

144
    def getMenubar(self):
×
145
        """Returns a pointer to the menubar."""
146

147
    def getModule(self, name: str):
×
148
        """Returns the module specified by the given name argument.
149

150
        Parameters
151
        ----------
152
        name : str
153
            A String that specifies the module to get.
154
        """
155

156
    def getModuleName(self, displayedName: str):
×
157
        """Returns the module name for the given displayed name.
158

159
        Parameters
160
        ----------
161
        displayedName : str
162
            Displayed module name (English).
163
        """
164

165
    def getNumModules(self):
×
166
        """Returns the number of modules."""
167

168
    def getPluginToolset(self):
×
169
        """Returns the Plugin toolset."""
170

171
    def getSelectorFromFunction(self, function: str):
×
172
        """Returns the selector of the given shortcut function. Throws exception if not found.
173

174
        Parameters
175
        ----------
176
        function : str
177
            A String specifying the function as shown in the Customize dialog box.
178
        """
179

180
    def getTargetFromFunction(self, function: str):
×
181
        """Returns the target of the given shortcut function. Throws exception if not found.
182

183
        Parameters
184
        ----------
185
        function : str
186
            A String specifying the function as shown in the Customize dialog box.
187
        """
188

189
    def getToolbox(self):
×
190
        """Returns a pointer to the module toolbox container."""
191

192
    def getToolMenuPane(self):
×
193
        """Returns a pointer to the tools menu pane."""
194

195
    def getToolMenuTitle(self):
×
196
        """Returns a pointer to the Tools menu title."""
197

198
    def getToolset(self, name: str):
×
199
        """Returns the toolset specified by the given name argument.
200

201
        Parameters
202
        ----------
203
        name : str
204
            A String in the local language that specifies to toolset to get.
205
        """
206

207
    def getToolsetKernelInitializationCommands(self):
×
208
        """Returns the command string that should initialize the toolsets in the kernel that are corresponding
209
        to the toolsets registered with the main window."""
210

211
    def getWorkDirectory(self):
×
212
        """Returns the current working directory."""
213

214
    def hideCli(self):
×
215
        """Hides the command line interface."""
216

217
    def hideMessageArea(self):
×
218
        """Hides the message area interface."""
219

220
    def makeCustomToolsets(self):
×
221
        """This method has no base class implementation; it may be used by customizers to construct Abaqus/CAE
222
        toolsets or toolsets derived from Abaqus/CAE toolsets; constructing those toolsets in this method is
223
        necessary to insure that the toolset will be available to standard Abaqus/CAE modules that register that
224
        toolset, and to avoid creating duplicate widgets when the toolset is used by a custom toolset."""
225

226
    def registerHelpToolset(self, tool: AFXToolsetGui, opts: int):
×
227
        """Registers the Help toolset.
228

229
        Parameters
230
        ----------
231
        tool : AFXToolsetGui
232
            Pointer to toolset being registered.
233
        opts : int
234
            Options for creating toolset GUI components.
235
        """
236

237
    def registerModule(self, displayedName: str, moduleImportName: str, kernelInitializationCommand: str):
×
238
        """Registers a module to make it available in the module combo; also registers the initialization string
239
        to be sent to the kernel the first time the module is loaded.
240

241
        Parameters
242
        ----------
243
        displayedName : str
244
            The name that will be displayed in the Module combo box in the context bar.
245
        moduleImportName : str
246
            The name that will be used to import this module.
247
        kernelInitializationCommand : str
248
            The Python command sent to kernel when the module is loaded.
249
        """
250

251
    def registerToolset(self, tool: AFXGuiObjectManager, opts: int):
×
252
        """Registers a toolset that is always available in the main window.
253

254
        Parameters
255
        ----------
256
        tool : AFXGuiObjectManager
257
            Pointer to the object being registered.
258
        opts : int
259
            Options for creating toolset GUI components.
260
        """
261

262
    def setApplicabilityForTreeTab(self, name: str, moduleNames: str):
×
263
        """Sets the modules that are applicable to the given tree tab. When switching modules, if the current
264
        tab is applicable to the new module, it will remain current. When a tree tab is created, it is
265
        applicable to all modules--use this method to set the applicability to only certain modules.
266

267
        Parameters
268
        ----------
269
        name : str
270
            Name of the tab item.
271
        moduleNames : str
272
            A String containing module names separated by commas.
273
        """
274

275
    def setCurrentTreeTab(self, name: str):
×
276
        """Sets the tree toolset tab book's current tab item to the tab item specified by the given name.
277

278
        Parameters
279
        ----------
280
        name : str
281
            Name of the tab item to be set current.
282
        """
283

284
    def setVisibilityForTreeTab(self, name: str, moduleNames: str):
×
285
        """Sets the modules in which a tree tab is visible. When switching modules, if the tab has not been
286
        specified to be visible in the new module, the tab will be hidden; otherwise it will be shown. When a
287
        tree tab is created it is visible in all modules--use this method to set the visibility to only certain
288
        modules.
289

290
        Parameters
291
        ----------
292
        name : str
293
            Name of the tab item.
294
        moduleNames : str
295
            A String containing module names separated by commas.
296
        """
297

298
    def setWorkDirectory(self, directory: str):
×
299
        """Sets the current working directory.
300

301
        Parameters
302
        ----------
303
        directory : str
304
            A String specifying the new work directory.
305
        """
306

307
    def showCli(self):
×
308
        """Shows the command line interface."""
309

310
    def showMessageArea(self):
×
311
        """Shows the message area interface."""
312

313
    def writeToMessageArea(self, message: str):
×
314
        """Writes a string to the message area.
315

316
        Parameters
317
        ----------
318
        message : str
319
        """
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