Esempio n. 1
0
    def createchannelgroup(self, channelgroups = {}):
        """Create a new channel group window.
        """
        allconsole = None
        css = self.parent.styleSheet()
        chgrpwidget = QSubWindow(self.parent, 'Channel Window')
        chgrpwidget.resize(640, 400)
        chgrpwidget.move(100, 100)

        clientarea = chgrpwidget.getclientarea()
        qtabwidget = QAdvancedTabWidget(clientarea)
        clientarea.setObjectName('Test')
        qtabwidget.setMovable(True)
        qtabwidget.show()

        # setup ability to right click on tab widget and get a menu
        #qtabwidget.contextMenuEvent = lambda event: self.tab_contextmenu_event(qtabwidget, event)

        chgrpwidget.qtabwidget = qtabwidget
        def __resizeEvent(event):
            qtabwidget.resize(clientarea.width(), clientarea.height())
        clientarea.resizeEvent = __resizeEvent
        # make console widgets
        css = self.parent.styleSheet()
        for changrptitle in channelgroups:
            channels = channelgroups[changrptitle]
            console = self.createchannel(chgrpwidget, channels, changrptitle)
            if '$all' in channels:
                allconsole = console
        # save the sub-window and tab widget
        self.chgrpwidgets.append([chgrpwidget, qtabwidget, channels])
        chgrpwidget.show()
        qtabwidget.show()

        if allconsole is not None:
            qtabwidget.setCurrentWidget(allconsole)

        return chgrpwidget
Esempio n. 2
0
    def getwin(self, titlepad=10):
        tframe = QSubWindow(self)

        tframe.setObjectName('TFrame')

        return tframe