Beispiel #1
0
    def __init__(self, *args, **kwargs):
        QTreeWidget.__init__(self, *args, **kwargs)
        self._focusProxy = scrollProxy(self)

        self.setHeaderLabel('Behavior Trees')
        self.setAlternatingRowColors(True)
        self.setAnimated(True)
        self.header().close()

        self.highlighted = []
        self.mb = None
        self.__grab = False
        self.__grabFullRefname = ''
        self.__grabSentSignal = False
        self.__project = None
        self.__treesWidgets = dict()

        self.editingItem = None
        self.editingText = ''

        self.itemDoubleClicked.connect(self.__onDoubleClick)
        self.itemChanged.connect(self.onItemChange)
        self.currentItemChanged.connect(self.__onCurrentChanged)

        self._icons = {
            'copy': QIcon(joinPath(globals.applicationIconsPath, 'copy3.png')),
            'edit': QIcon(joinPath(globals.applicationIconsPath, 'page_edit.png')),
            'cancel': QIcon(joinPath(globals.applicationIconsPath, 'cancel-1.png')),
            'add': QIcon(joinPath(globals.applicationIconsPath, 'chart_add.png')),
            'add2': QIcon(joinPath(globals.applicationIconsPath, 'chart_add2.png'))
        }

        globals.behaviorTreeSignals.treeOpened.connect(self.__onTreeOpen)
        globals.behaviorTreeSignals.treeClosed.connect(self.__onTreeClose)
        globals.behaviorTreeSignals.treeRootChanged.connect(self.__onTreeRootChange)
Beispiel #2
0
 def __init__(self, *args, **kwargs):
     QTextEdit.__init__(self, *args, **kwargs)
     self._focusProxy = scrollProxy(self)
     self.setAcceptRichText(True)
     self.setTextInteractionFlags(Qt.TextBrowserInteraction | Qt.TextSelectableByKeyboard)
     self.__text = u'> '
     self.__fontCol = False
     self.__ignoreEndl = False
Beispiel #3
0
 def __init__(self, *args, **kwargs):
     QTextEdit.__init__(self, *args, **kwargs)
     self._focusProxy = scrollProxy(self)
     self.setAcceptRichText(True)
     self.setTextInteractionFlags(Qt.TextBrowserInteraction
                                  | Qt.TextSelectableByKeyboard)
     self.__text = u'> '
     self.__fontCol = False
     self.__ignoreEndl = False
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        """ Constructor
        mode - ...
        parent - QWidget
        """

        QTreeWidget.__init__(self, *args, **kwargs)
        self._focusProxy = scrollProxy(self)
        globalLanguage.languageChanged.connect(self.__onLanguageChange)

        self.setAlternatingRowColors(True)
        self.setAnimated(True)
        # self.itemExpanded.connect(self.onItemExpanded)

        self.__externalSelect = False
        self.__libraries = None
        self.__alphabet = None
        self.__libWidgets = dict()
        self.__tempLib = None
        self.__changed = False
        self.__cleaning = False
        self.__grab = False
        self.__grabbedItemLibrary = ''
        self.__grabbedItemNodename = ''
        self.__grabSentSignal = False

        self._editingItem = None
        self._editingText = ''
        self._editingInternal = False

        self.headers = ['Nodes']  # ['Available nodes','Path']
        self.setHeaderLabels(self.headers)
        self.header().close()

        self.__onLanguageChange(globalLanguage.language)

        # self.itemSelectionChanged.connect(self.__onSelectionChanged)
        self.itemChanged.connect(self.__onItemChange)
        self.currentItemChanged.connect(self.__onCurrentChanged)

        self._icons = {
            'delete': QIcon(joinPath(globals.applicationIconsPath, 'cancel-1.png')),
            'add': QIcon(joinPath(globals.applicationIconsPath, 'add-3.png')),
            'copy': QIcon(joinPath(globals.applicationIconsPath, 'copy3.png')),
            'paste': QIcon(joinPath(globals.applicationIconsPath, 'paste3.png')),
            'binary': QIcon(joinPath(globals.applicationIconsPath, 'binary-1.png')),
            'book': QIcon(joinPath(globals.applicationIconsPath, 'book_open.png')),
            'book_del': QIcon(joinPath(globals.applicationIconsPath, 'book_delete.png')),
            'book_add': QIcon(joinPath(globals.applicationIconsPath, 'book_add.png')),
            'book_edit': QIcon(joinPath(globals.applicationIconsPath, 'book_edit.png'))
        }

        globals.librarySignals.nodeAdded.connect(self.__onNodeAdd)
        globals.librarySignals.libraryExcluded.connect(self.__removeLib)
        globals.librarySignals.nodeRemoved.connect(self.__onNodeRemove)
        globals.librarySignals.libraryRenamed.connect(self.__onLibraryRename)
Beispiel #5
0
 def __init__(self, columns, headers, parent=None):
     QTreeWidget.__init__(self, parent)
     self._focusProxy = scrollProxy(self)
     self.setMinimumHeight(30)
     self.setSelectionMode(QAbstractItemView.NoSelection)
     self.setRootIsDecorated(False)
     self.setAlternatingRowColors(True)
     self.setSortingEnabled(False)
     if headers:
         self.setHeaderLabels(headers)
     else:
         self.header().close()
     self.setColumnCount(columns)
     self.setContentsMargins(contentsMargin, contentsMargin, contentsMargin, contentsMargin)
     self.preferredHeight = 0
     self.preferredWidth = 0
Beispiel #6
0
    def __init__(self, *args, **kwargs):
        """ Constructor
        mode - ...
        parent - QWidget
        """

        QTreeWidget.__init__(self, *args, **kwargs)
        self._focusProxy = scrollProxy(self)
        globalLanguage.languageChanged.connect(self.__onLanguageChange)

        self.setAlternatingRowColors(True)
        self.setAnimated(True)
        # self.itemExpanded.connect(self.onItemExpanded)

        self.__externalSelect = False
        self.__libraries = None
        self.__alphabet = None
        self.__libWidgets = dict()
        self.__tempLib = None
        self.__changed = False
        self.__cleaning = False
        self.__grab = False
        self.__grabbedItemLibrary = ''
        self.__grabbedItemNodename = ''
        self.__grabSentSignal = False

        self._editingItem = None
        self._editingText = ''
        self._editingInternal = False

        self.headers = ['Nodes']  # ['Available nodes','Path']
        self.setHeaderLabels(self.headers)
        self.header().close()

        self.__onLanguageChange(globalLanguage.language)

        # self.itemSelectionChanged.connect(self.__onSelectionChanged)
        self.itemChanged.connect(self.__onItemChange)
        self.currentItemChanged.connect(self.__onCurrentChanged)

        self._icons = {
            'delete':
            QIcon(joinPath(globals.applicationIconsPath, 'cancel-1.png')),
            'add':
            QIcon(joinPath(globals.applicationIconsPath, 'add-3.png')),
            'copy':
            QIcon(joinPath(globals.applicationIconsPath, 'copy3.png')),
            'paste':
            QIcon(joinPath(globals.applicationIconsPath, 'paste3.png')),
            'binary':
            QIcon(joinPath(globals.applicationIconsPath, 'binary-1.png')),
            'book':
            QIcon(joinPath(globals.applicationIconsPath, 'book_open.png')),
            'book_del':
            QIcon(joinPath(globals.applicationIconsPath, 'book_delete.png')),
            'book_add':
            QIcon(joinPath(globals.applicationIconsPath, 'book_add.png')),
            'book_edit':
            QIcon(joinPath(globals.applicationIconsPath, 'book_edit.png'))
        }

        globals.librarySignals.nodeAdded.connect(self.__onNodeAdd)
        globals.librarySignals.libraryExcluded.connect(self.__removeLib)
        globals.librarySignals.nodeRemoved.connect(self.__onNodeRemove)
        globals.librarySignals.libraryRenamed.connect(self.__onLibraryRename)