Exemplo n.º 1
0
    def __init__(self):
        super(CadWindowMdi, self).__init__()
        self.mdiArea = QtGui.QMdiArea()
        self.mdiArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
        self.mdiArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
        self.setCentralWidget(self.mdiArea)
        self.mdiArea.subWindowActivated.connect(self.subWindowActivatedEvent)
        self.oldSubWin = None
        #        self.readSettings() #now works for position and size, support for toolbars is still missing(http://www.opendocs.net/pyqt/pyqt4/html/qsettings.html)
        self.setWindowTitle("PythonCAD")
        qIcon = self._getIcon('pythoncad')
        if qIcon:
            self.setWindowIcon(qIcon)
        self.setUnifiedTitleAndToolBarOnMac(True)
        #pythoncad kernel
        self.__application = Application()
        self.__cmd_intf = CmdIntf(self)
        #self.__cmd_intf.FunctionHandler.commandExecuted+=self.commandExecuted
        # create all dock windows
        self._createDockWindows()
        # create status bar
        self._createStatusBar()
        self.setUnifiedTitleAndToolBarOnMac(True)
        self._registerCommands()
        self.updateMenus()
        self.lastDirectory = os.getenv('USERPROFILE') or os.getenv('HOME')

        self.readSettings(
        )  #now works for position and size and ismaximized, and finally toolbar position

        self.updateOpenFileList()
        self.updateRecentFileList()
        return
Exemplo n.º 2
0
 def __init__(self):
     self.__command = {}
     self.__applicationCommand = {}
     # Application Command
     self.__applicationCommand['Open'] = self.openFile
     self.__applicationCommand['Close'] = self.closeFile
     self.__applicationCommand['New'] = self.newDoc
     self.__applicationCommand['Documents'] = self.showDocuments
     self.__applicationCommand['CreateStyle'] = self.createStyle
     self.__applicationCommand['SetActive'] = self.setActiveDoc
     self.__applicationCommand['GetActive'] = self.getActiveDoc
     self.__applicationCommand['GetEnts'] = self.getEnts
     self.__applicationCommand['Esc'] = self.endApplication
     self.__applicationCommand['?'] = self.printHelp
     self.__applicationCommand['Test'] = self.featureTest
     self.__applicationCommand['ETest'] = self.easyTest
     # Document Commandf
     self.__pyCadApplication = Application()
     for command in self.__pyCadApplication.getCommandList():
         self.__command[command] = self.performCommand