Main window example

To create a main window for a particular application, you start by deriving a new class from the AFXMainWindow class. In the constructor of the main window, you register the modules and toolsets used by your application.

The following script constructs the Abaqus/CAE main window. The script is described in detail in the following sections. Details of how you construct modules and toolsets are given in Creating a GUI module and Creating a GUI toolset.

from abaqusGui import *  
class CaeMainWindow(AFXMainWindow): 
     def __init__(self, app, windowTitle=''): 
         # Construct the GUI infrastructure.       
         #
         AFXMainWindow.__init__(self, app, windowTitle)   
             
         # Register the "persistent" toolsets.  
         #  
         self.registerToolset(FileToolsetGui(), 
             GUI_IN_MENUBAR|GUI_IN_TOOLBAR)  
         self.registerToolset(ModelToolsetGui(), 
             GUI_IN_MENUBAR)  
         self.registerToolset(CanvasToolsetGui(), 
             GUI_IN_MENUBAR)  
         self.registerToolset(ViewManipToolsetGui(), 
             GUI_IN_MENUBAR|GUI_IN_TOOLBAR) 
         self.registerToolset(TreeToolsetGui(), 
             GUI_IN_MENUBAR)  
         self.registerToolset(AnnotationToolsetGui(), 
             GUI_IN_MENUBAR|GUI_IN_TOOLBAR) 
         self.registerToolset(CustomizeToolsetGui(), 
             GUI_IN_TOOL_PANE)  
         self.registerToolset(SelectionToolsetGui(), 
             GUI_IN_TOOLBAR)  
         registerPluginToolset()  
         self.registerHelpToolset(HelpToolsetGui(), 
             GUI_IN_MENUBAR|GUI_IN_TOOLBAR)  

         # Register modules.  
         #  
         self.registerModule('Part',          'Part')
         self.registerModule('Property',  'Property')
         self.registerModule('Assembly',      'Assembly')
         self.registerModule('Step',          'Step')
         self.registerModule('Interaction', 'Interaction')
         self.registerModule('Load',          'Load')    
         self.registerModule('Mesh',          'Mesh')
         self.registerModule('Job', 'Job')
         self.registerModule('Visualization', 'Visualization')
         self.registerModule('Sketch',        'Sketch')