Пример #1
0
def main():

    app = QtCore.QApplication(sys.argv)
    #app.setStyle("motif")

    d = Drawer('drawers/Firefox', Globals.TESTOPTS)
    d.show()

    #ex=DrawerEntry('mozilla.xpm','Firefox Explorer')
    #ex.show()

    sys.exit(app.exec_())
Пример #2
0
def main():
    print 'MAIN '
    app = QtCore.QApplication(sys.argv)
    window = QtGui.QWidget()
    layout = QtGui.QHBoxLayout(window)
    layout.setSpacing(0)
    layout.setMargin(0)

    button = PicButtonCommand("launcherbg.xpm", "launcherbgpressed.xpm",
                              "terminal.xpm", 'echo pressed',
                              Globals1.TESTOPTS, window)
    layout.addWidget(button)

    window.show()
    window.resize(200, 200)
    sys.exit(app.exec_())
Пример #3
0
def main():

    defaultopts = Opts()
    defaultopts.currentpalettefile = 'Broica.dp'
    defaultopts.defaultworkspacecolor = 2
    defaultopts.initialheight = 85
    defaultopts.contrast = 0
    defaultopts.saturation = 100
    defaultopts.sharp = 0.1
    defaultopts.antialias = 20
    defaultopts.ncolors = 8
    defaultopts.nworkspaces = 6
    defaultopts.workspacecolors = [0, 8, 5, 6, 7, 2, 2, 2, 2, 2, 2]
    defaultopts.workspacelabels = [
        'Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven'
    ]

    print 'MAIN '
    app = QtCore.QApplication(sys.argv)
    window = QtGui.QWidget()
    #hbox is parented here to 'window'
    #                      V
    #layout = QtGui.QHBoxLayout(window)
    #layout.setSpacing(0)
    #layout.setMargin(0)

    #unparented button
    button = PicButton("launcher.xpm", "launcher-pressed.xpm", "terminal.xpm",
                       defaultopts)
    # this func parents button to parent of hbox (='window')
    #layout.addWidget(button)
    #parent the button otherwise explicit by adding 'window', but then the hbox doesnt work-------------V
    #button = PicButton("xpm/launcher.xpm","xpm/launcher-pressed.xpm","terminal.xpm",Globals.TESTOPTS,window)

    #blinker=0
    #but=PicButtonBlink(blinker,

    window.show()
    window.resize(200, 200)
    sys.exit(app.exec_())
Пример #4
0
def main():
    print 'MAIN '
    app = QtCore.QApplication(sys.argv)
    window = QtGui.QWidget()
    layout = QtGui.QHBoxLayout(window)
    layout.setSpacing(0)
    layout.setMargin(0)

    #button = PicButtonToggle("launcherbg.xpm","launcherbgpressed.xpm","terminal.xpm")
    #button = PicButtonToggle("xpm/launcher.xpm","xpm/launcher-pressed.xpm","terminal.xpm",Globals.TESTOPTS,window)
    #button = PicButtonWorkspace("xpm/launcher.xpm","xpm/launcher-pressed.xpm","terminal.xpm",Globals.TESTOPTS,window)
    button = PicButtonWorkspace('xpm/pager-button-2.xpm',
                                'xpm/pager-button-down-2.xpm', "empty.xpm",
                                Globals.TESTOPTS, window)
    layout.addWidget(button)

    #button.toggle()

    button.setChecked(True)
    button.setChecked(False)

    window.show()
    window.resize(200, 200)
    sys.exit(app.exec_())
Пример #5
0
    #print findIconFromName1('xterm')
    #print findIconFromName1('firefox.png')
    #print findIconFromName1('')
    #print findIconFromName1(None)
    #print findIconFromName1('/x/pycde/scaletest/cdepanel/xpm/terminal.xpm')
    #print findIconFromName1('/x/ycde/scaletest/cdepanel/xpm/txxxxeminal.xpm')

    ##################################################
    #app = QtCore.QApplication(sys.argv)
    #p=QtGui.QPixmap('xpm/pager-button-1.xpm')
    #textIconSameSizeAsFile(p,'/tmp/testicon.png','My Text')
    #print 'done'
    #sys.exit(app.exec_())
    ##################################################

    app = QtCore.QApplication(sys.argv)

    ###########################3
    #print createTextIcon('/tmp/testicon.png','M111yTExxxxxxxxxxxxxxxXT 123')
    print 'done'

    ###########################3
    pixmap = QtGui.QPixmap('/tmp/testpagerbutton2.png')
    drawTextOnPixmap('Hello', 14, .1, 0.05, pixmap)
    pixmap.save('/tmp/1.png')

    sys.exit()

    sys.exit(app.exec_())

    #window.show()
Пример #6
0
    def GetCheckButtonSelect(self,
                             select_list,
                             title="Select",
                             msg="",
                             app=None):
        """
        Get selected check button options

        title: Window name
        mag: Label of the check button
        return selected dictionary
            {'sample b': False, 'sample c': False, 'sample a': False}
        """

        if app is None:
            app = QtCore.QApplication(sys.argv)
        win = QtGui.QWidget()

        scrollArea = QtGui.QScrollArea()
        scrollArea.setWidgetResizable(True)
        scrollAreaWidgetContents = QtGui.QWidget(scrollArea)
        scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 380, 247))
        scrollArea.setWidget(scrollAreaWidgetContents)

        layout = QtGui.QGridLayout()
        verticalLayoutScroll = QtGui.QVBoxLayout(scrollAreaWidgetContents)
        layoutIndex = 0

        if msg is not "":
            label = QtGui.QLabel(msg)
            layout.addWidget(label, layoutIndex, 0)
            layoutIndex = layoutIndex + 1

        checkboxes = []
        select_list.append("All topics")
        for select in select_list:
            checkbox = QtGui.QCheckBox(select)
            verticalLayoutScroll.addWidget(checkbox)
            layoutIndex = layoutIndex + 1
            checkboxes.append(checkbox)

        layout.addWidget(scrollArea)
        btn = QtGui.QPushButton("OK")
        btn.clicked.connect(app.quit)
        layout.addWidget(btn, layoutIndex, 0)
        layoutIndex = layoutIndex + 1

        win.setLayout(layout)
        win.setWindowTitle(title)
        win.show()
        app.exec_()

        result = {}
        if checkboxes[-1].isChecked(
        ):  # if "All topics" is checked, all topics
            for selection in select_list:
                result[selection] = True
        else:
            for index in xrange(
                    len(select_list[:-1]
                        )):  # check all boxes except the "All topics" box
                checkbox = checkboxes[index]
                selection = select_list[index]
                result[selection] = checkbox.isChecked()

        return result