Пример #1
0
    def __init__ (self, parent):
        super(_StepByStepSolverTab, self).__init__ (parent)
        self.plugin = parent
        box = QtGui.QVBoxLayout(self)

        b = QtGui.QPushButton(self)
        b.text = "Initialize step by step sequence"
        box.addWidget(b)
        b.connect("clicked()", self.prepareSolveStepByStep)

        w = QtGui.QWidget(self)
        hl = QtGui.QHBoxLayout(w)
        self.stepCount = QtGui.QSpinBox(w)
        self.stepCount.setRange(1, 1000)
        self.value = 1
        hl.addWidget(self.stepCount)
        b = QtGui.QPushButton(self)
        b.text = "Execute N step"
        hl.addWidget(b)
        b.connect("clicked()", self.executeOneStep)
        box.addWidget(w)

        b = QtGui.QPushButton(self)
        b.text = "Finalize"
        box.addWidget(b)
        b.connect("clicked()", self.finishSolveStepByStep)
Пример #2
0
    def __init__(self, logPlayer):

        self.logPlayer = logPlayer

        w = QtGui.QWidget()
        w.windowTitle = 'LCM Log Playback'

        playButton = QtGui.QPushButton('Play')
        stopButton = QtGui.QPushButton('Stop')
        slider = QtGui.QSlider(QtCore.Qt.Horizontal)
        slider.maximum = int(logPlayer.getEndTime() * 100)
        text = QtGui.QLineEdit()
        text.text = '0.0'
        playButton.connect('clicked()', self.onPlay)
        stopButton.connect('clicked()', self.onStop)
        slider.connect('valueChanged(int)', self.onSlider)
        text.connect('returnPressed()', self.onText)

        l = QtGui.QHBoxLayout(w)
        l.addWidget(slider)
        l.addWidget(text)
        l.addWidget(playButton)
        l.addWidget(stopButton)

        self.slider = slider
        self.text = text
        self.widget = w
        self.widget.show()
Пример #3
0
    def __init__(self, parent):
        super(_PathManagement, self).__init__(parent)
        self.plugin = parent
        parent.widgetToRefresh.append(self)

        box = QtGui.QVBoxLayout(self)
        
        button = QtGui.QPushButton("Get paths", self)
        button.connect("clicked()", self.refresh)
        box.addWidget(button)
        box.addWidget(QtGui.QLabel("Choose the paths you want to concatenate.\n"
                                   "All the paths will be concatenate in the first choose."))
        box.addWidget(QtGui.QLabel("List of path:"))
        self.paths = QtGui.QListWidget()
        box.addWidget(self.paths)
        self.paths.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)

        hBox = QtGui.QHBoxLayout()
        
        self.buttonConcatenate = QtGui.QPushButton("Concatenate")
        hBox.addWidget(self.buttonConcatenate)
        self.buttonConcatenate.connect("clicked()", self.concatenate)

        self.buttonErase = QtGui.QPushButton("Erase")
        hBox.addWidget(self.buttonErase)
        self.buttonErase.connect("clicked()", self.erase)

        box.addLayout(hBox)
Пример #4
0
    def showToolbarWidget(self):

        if app.getMainWindow() is None:
            return

        if self.toolbarWidget:
            self.execButton.setEnabled(True)
            return

        w = QtGui.QWidget()
        l = QtGui.QHBoxLayout(w)

        label = QtGui.QLabel('Walk plan:')
        execButton = QtGui.QPushButton('')
        execButton.setIcon(QtGui.QApplication.style().standardIcon(QtGui.QStyle.SP_MediaPlay))
        clearButton = QtGui.QPushButton('')
        clearButton.setIcon(QtGui.QApplication.style().standardIcon(QtGui.QStyle.SP_TrashIcon))
        stopButton = QtGui.QPushButton('')
        stopButton.setIcon(QtGui.QApplication.style().standardIcon(QtGui.QStyle.SP_MediaStop))

        l.addWidget(label)
        l.addWidget(execButton)
        l.addWidget(stopButton)
        l.addWidget(clearButton)
        l.setContentsMargins(0, 0, 0, 0)

        execButton.setShortcut(QtGui.QKeySequence('Ctrl+Return'))
        execButton.connect('clicked()', self.onExecClicked)
        clearButton.connect('clicked()', self.onClearClicked)
        stopButton.connect('clicked()', self.sendStopWalking)

        self.execButton = execButton
        self.stopButton = stopButton
        self.toolbarWidget = app.getMainWindow().toolBar().addWidget(w)
        self.execButton.show()
Пример #5
0
 def __init__(self, mode):
     super(CLCreate, self).__init__()
     ## Dialog Settings
     self.setFixedSize(300, 100)
     self.setWindowTitle('Select Channel')
     ## Vars
     self.mode = mode
     ## Layouts
     layoutV1 = Gui.QVBoxLayout()
     layoutH1 = Gui.QHBoxLayout()
     self.setLayout(layoutV1)
     ## Widgets
     self.chanCombo = Gui.QComboBox()
     self.okBtn = Gui.QPushButton('Ok')
     self.cancelBtn = Gui.QPushButton('Cancel')
     ## Populate
     layoutV1.addWidget(self.chanCombo)
     layoutV1.addLayout(layoutH1)
     layoutH1.addWidget(self.cancelBtn)
     layoutH1.addWidget(self.okBtn)
     ## Connections
     self.okBtn.connect("clicked()", self.runCreate)
     self.cancelBtn.connect("clicked()", self.close)
     ## Init
     self.init()
Пример #6
0
    def updateLayout(self):
        self.storeButtons = []
        self.flyButtons = []

        w = QtGui.QWidget()
        l = QtGui.QGridLayout(w)

        for i in range(self.numberOfBookmarks):
            storeButton = QtGui.QPushButton('set')
            flyButton = QtGui.QPushButton('fly')
            textEdit = QtGui.QLineEdit('camera %d' % i)
            storeButton.connect('clicked()', self.storeMapper, 'map()')
            flyButton.connect('clicked()', self.flyMapper, 'map()')
            self.storeMapper.setMapping(storeButton, storeButton)
            self.flyMapper.setMapping(flyButton, flyButton)
            self.storeButtons.append(storeButton)
            self.flyButtons.append(flyButton)
            l.addWidget(storeButton, i, 0)
            l.addWidget(flyButton, i, 1)
            l.addWidget(textEdit, i, 2)
            flyButton.setEnabled(False)

        self.flySpeedSpinner = QtGui.QDoubleSpinBox()
        self.flySpeedSpinner.setMinimum(0)
        self.flySpeedSpinner.setMaximum(60)
        self.flySpeedSpinner.setDecimals(1)
        self.flySpeedSpinner.setSingleStep(0.5)
        self.flySpeedSpinner.setSuffix(' seconds')
        self.flySpeedSpinner.setValue(1.0)

        l.addWidget(QtGui.QLabel('Fly speed:'), i+1, 0, 2)
        l.addWidget(self.flySpeedSpinner, i+1, 2)

        self.widget.setWidget(w)
Пример #7
0
 def initWidget(self):
     box = QtGui.QVBoxLayout(self)
     random = QtGui.QPushButton(self)
     box.addWidget(random)
     applyConstraints = QtGui.QPushButton(self)
     box.addWidget(applyConstraints)
     setFrom = QtGui.QPushButton(self)
     box.addWidget(setFrom)
     setTo = QtGui.QPushButton(self)
     box.addWidget(setTo)
     self.validatePath = QtGui.QCheckBox(self)
     box.addWidget(self.validatePath)
     self.projectPath = QtGui.QCheckBox(self)
     box.addWidget(self.projectPath)
     makePath = QtGui.QPushButton(self)
     box.addWidget(makePath)
     random.text = "Shoot random config"
     applyConstraints.text = "Apply constraints"
     setFrom.text = 'Save config as origin'
     setTo.text = 'Save config as destination'
     self.validatePath.text = 'Validate path'
     self.projectPath.text = "Project path"
     makePath.text = 'Create path'
     random.connect('clicked()', self.shootRandom)
     applyConstraints.connect('clicked()', self.applyConstraints)
     setFrom.connect('clicked()', self.getFrom)
     setTo.connect('clicked()', self.getTo)
     makePath.connect('clicked()', self.makePath)
Пример #8
0
    def __init__(self):
        super(dlg_copyMetricBinding, self).__init__()

        # - Init
        self.srcGlyphBounds = {}

        # - Combos
        # -- Mode of operation
        self.cmb_mode = QtGui.QComboBox()
        self.cmb_mode.addItems(['Active Layer', 'All Master Layers'])

        # -- Flag color slector
        self.cmb_flag = QtGui.QComboBox()
        colorNames = QtGui.QColor.colorNames()

        for i in range(len(colorNames)):
            self.cmb_flag.addItem(colorNames[i])
            self.cmb_flag.setItemData(i, QtGui.QColor(colorNames[i]),
                                      QtCore.Qt.DecorationRole)

        self.cmb_flag.setCurrentIndex(colorNames.index('lime'))

        # - Buttons
        self.btn_copy = QtGui.QPushButton('&Copy Expressions')
        self.btn_paste = QtGui.QPushButton('&Paste Expressions')
        self.btn_export = QtGui.QPushButton('&Export to File')
        self.btn_import = QtGui.QPushButton('&Import from File')
        self.btn_importFLC = QtGui.QPushButton('&Import from .FLC')

        self.btn_copy.clicked.connect(self.copyExpr)
        self.btn_paste.clicked.connect(self.pasteExpr)
        self.btn_export.clicked.connect(self.exportExpr)
        self.btn_import.clicked.connect(self.importExpr)
        self.btn_importFLC.clicked.connect(self.importExprFLC)

        self.btn_paste.setEnabled(False)
        #self.btn_export.setEnabled(False)
        #self.btn_import.setEnabled(False)

        # - Build layouts
        layoutV = QtGui.QVBoxLayout()
        layoutV.addWidget(
            QtGui.QLabel('Copy/Paste metric expressions to/from:'))
        layoutV.addWidget(self.cmb_mode)
        #layoutV.addWidget(QtGui.QLabel('Mark modified glyphs with:'))
        #layoutV.addWidget(self.cmb_flag)
        layoutV.addWidget(self.btn_copy)
        layoutV.addWidget(self.btn_paste)
        layoutV.addWidget(self.btn_export)
        layoutV.addWidget(self.btn_import)
        layoutV.addWidget(self.btn_importFLC)

        # - Set Widget
        self.setLayout(layoutV)
        self.setWindowTitle('%s %s' % (app_name, app_version))
        self.setGeometry(300, 300, 220, 120)
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)  # Always on top!!
        self.show()
    def __init__(self, parent):
        super(CollisionPairs, self).__init__(parent)
        self.plugin = parent
        # parent.widgetToRefresh.append(self)
        self.orderedPairs = list()
        self.pairToRow = dict()
        box = QtGui.QVBoxLayout(self)

        button = QtGui.QPushButton(
            "Toggle between collision and visual robot bodies", self)
        button.checkable = True
        button.connect("clicked(bool)", self.toggleVisual)
        box.addWidget(button)

        button = QtGui.QPushButton(QtGui.QIcon.fromTheme("view-refresh"),
                                   "Refresh list", self)
        button.connect("clicked()", self.refresh)
        box.addWidget(button)

        # Create table
        self.table = TableWidget(0, 6)
        self.table.setHorizontalHeaderLabels([
            "Active", "Link 1", "Link 2", "Reason", "Current configuration",
            "% of collision"
        ])
        if Qt.qVersion().startswith('4'):
            self.table.horizontalHeader().setResizeMode(
                QtGui.QHeaderView.Interactive)
        else:
            self.table.horizontalHeader().setSectionResizeMode(
                QtGui.QHeaderView.Interactive)
        self.table.selectionBehavior = QtGui.QAbstractItemView.SelectRows
        self.table.connect(
            "currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)",
            self.currentItemChanged)
        box.addWidget(self.table)

        # "Number of random configuration (log scale)"
        self.sliderRandomCfg = QtGui.QSlider(Qt.Qt.Horizontal, self)
        self.sliderRandomCfg.setRange(20, 60)
        self.sliderRandomCfg.setValue(30)
        box.addWidget(self.sliderRandomCfg)
        button = QtGui.QPushButton("Compute percentage of collision", self)
        button.connect("clicked()", self.computePercentageOfCollision)
        box.addWidget(button)

        button = QtGui.QPushButton("Save to file...", self)
        button.connect("clicked()", self.writeToFile)
        box.addWidget(button)

        obj = self.plugin.main.getFromSlot("getHppIIOPurl")
        if obj is not None:
            obj.connect("configurationValidationStatus(QStringList)",
                        self.currentBodyInCollisions)
        else:
            print("Could not find obj")
Пример #10
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.aborted = False
        # --Layout Stuff---------------------------#
        mainLayout = QtGui.QVBoxLayout()

        layout = QtGui.QHBoxLayout()
        self.label = QtGui.QLabel()
        self.label.setText("port")
        layout.addWidget(self.label)
        self.text = QtGui.QLineEdit("10001")
        layout.addWidget(self.text)

        self.ip = QtGui.QLabel()
        self.ip.setText("host")
        layout.addWidget(self.ip)
        self.text_ip = QtGui.QLineEdit("localhost")
        layout.addWidget(self.text_ip)
        mainLayout.addLayout(layout)

        layout = QtGui.QHBoxLayout()
        self.synapse_tresh = QtGui.QLabel()
        self.synapse_tresh.setText("Syn. prob. thresh.")
        layout.addWidget(self.synapse_tresh)
        self.text_synthresh = QtGui.QLineEdit("0.6")
        layout.addWidget(self.text_synthresh)

        self.axodend_button = QtGui.QPushButton("Axo-dendr. syn. only")
        self.axodend_button.setCheckable(True)
        self.axodend_button.toggle()
        layout.addWidget(self.axodend_button)

        mainLayout.addLayout(layout)

        # --The Button------------------------------#
        layout = QtGui.QHBoxLayout()
        button = QtGui.QPushButton("connect")  # string or icon
        self.connect(button, QtCore.SIGNAL("clicked()"), self.close)
        layout.addWidget(button)

        button = QtGui.QPushButton("abort")  # string or icon
        self.connect(button, QtCore.SIGNAL("clicked()"),
                     self.abort_button_clicked)
        layout.addWidget(button)

        mainLayout.addLayout(layout)
        self.setLayout(mainLayout)

        self.resize(450, 300)
        self.setWindowTitle("SyConnGate Settings")
Пример #11
0
    def __init__(self, minValue=0.0, maxValue=1.0, resolution=1000):
        self._value = 0.0
        self.spinbox = QtGui.QDoubleSpinBox()
        self.spinbox.setSuffix('s')
        self.slider = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.playButton = QtGui.QPushButton('Play')
        self.setValueRange(minValue, maxValue)
        self.setResolution(resolution)
        self.slider.connect('valueChanged(int)', self._onSliderValueChanged)
        self.spinbox.connect('valueChanged(double)',
                             self._onSpinboxValueChanged)
        self.playButton.connect('clicked()', self._onPlayClicked)
        self.widget = QtGui.QWidget()
        layout = QtGui.QHBoxLayout(self.widget)
        layout.addWidget(self.playButton)
        layout.addWidget(self.spinbox)
        layout.addWidget(self.slider)

        self.animationPrevTime = 0.0
        self.animationRate = 1.0
        self.animationRateTarget = 1.0
        self.animationRateAlpha = 1.0
        self.animationTimer = TimerCallback(callback=self._tick, targetFps=60)
        self.useRealTime = True

        self.callbacks = callbacks.CallbackRegistry(self.events._fields)

        self.eventFilter = PythonQt.dd.ddPythonEventFilter()
        self.eventFilter.connect('handleEvent(QObject*, QEvent*)',
                                 self._filterEvent)
        self.eventFilter.addFilteredEventType(QtCore.QEvent.MouseButtonPress)
        self.eventFilter.addFilteredEventType(QtCore.QEvent.MouseMove)
        self.slider.installEventFilter(self.eventFilter)
Пример #12
0
 def notifyUserStatusBar(self):
     if self.warningButton:
         return
     self.warningButton = QtGui.QPushButton('Spindle Stuck Warning')
     self.warningButton.setStyleSheet("background-color:red")
     app.getMainWindow().statusBar().insertPermanentWidget(
         0, self.warningButton)
Пример #13
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        # --Layout Stuff---------------------------#
        mainLayout = QtGui.QVBoxLayout()

        layout = QtGui.QHBoxLayout()
        self.label = QtGui.QLabel()
        self.label.setText("port")
        layout.addWidget(self.label)
        self.text = QtGui.QLineEdit("10001")
        layout.addWidget(self.text)

        self.ip = QtGui.QLabel()
        self.ip.setText("host")
        layout.addWidget(self.ip)
        self.text_ip = QtGui.QLineEdit("0.0.0.0")
        layout.addWidget(self.text_ip)

        mainLayout.addLayout(layout)

        # --The Button------------------------------#
        layout = QtGui.QHBoxLayout()
        button = QtGui.QPushButton("okay")  # string or icon
        self.connect(button, QtCore.SIGNAL("clicked()"), self.close)
        layout.addWidget(button)

        mainLayout.addLayout(layout)
        self.setLayout(mainLayout)

        self.resize(250, 100)
        self.setWindowTitle("SyConnGate Settings")
Пример #14
0
    def launchViewer(self):

        playButtonFps = 1.0/self.options['Sim']['dt']

        print "playButtonFPS", playButtonFps
        self.playTimer = TimerCallback(targetFps=playButtonFps)
        self.playTimer.callback = self.playTimerCallback

        panel = QtGui.QWidget()
        l = QtGui.QHBoxLayout(panel)

        playButton = QtGui.QPushButton('Play/Pause')
        playButton.connect('clicked()', self.onPlayButton)

        l.addWidget(playButton)

        w = QtGui.QWidget()
        l = QtGui.QVBoxLayout(w)
        l.addWidget(self.view)
        l.addWidget(panel)
        w.showMaximized()


        self.carFrame.connectFrameModified(self.updateDrawIntersection)
        self.updateDrawIntersection(self.carFrame)

        applogic.resetCamera(viewDirection=[0.2,0,-1])
        self.view.showMaximized()
        self.view.raise_()

        self.app.start()
Пример #15
0
    def __init__(self):
        super(ProgressDialog, self).__init__()
        self.setWindowTitle('Exporting Textures ...')

        self.setEnabled(True)
        self.resize(350, 120)

        #set layout
        self.v_layout = QtGui.QVBoxLayout()
        self.setLayout(self.v_layout)
        #create cancel button & connect
        self.cancel_button = QtGui.QPushButton("Cancel")

        #todo: fix PySide ... utils not working
        #mari.utils.connect(self.cancel_button.clicked, lambda: self.cancel())

        #create other widgets
        self.pbar = QtGui.QProgressBar(self)
        self.progress_text = QtGui.QLabel(self)
        self.progress_text.setText('Exporting Textures ...')
        self.pbar.setValue(0)
        
        #add widgets
        self.v_layout.addWidget(self.pbar)
        self.v_layout.addWidget(self.progress_text)
        self.v_layout.addWidget(self.cancel_button)
Пример #16
0
    def __init__(self, plugin):
        super(QCPWidget, self).__init__(plugin)
        self.plugin = plugin

        layout = QtGui.QVBoxLayout(self)

        from PythonQt.QCustomPlot import QCustomPlot, QCP
        self.qcpWidget = QCustomPlot()
        self.qcpWidget.autoAddPlottableToLegend = True
        self.qcpWidget.setInteraction(QCP.iRangeDrag, True)  # iRangeDrap
        self.qcpWidget.setInteraction(QCP.iRangeZoom, True)  # iRangeZoom
        self.qcpWidget.setInteraction(QCP.iSelectAxes, True)  # iSelectAxes
        self.qcpWidget.legend().visible = True
        layout.addWidget(self.qcpWidget, 1)
        self.qcpWidget.connect(Qt.SIGNAL("mouseDoubleClick(QMouseEvent*)"),
                               self._mouseDoubleClick)
        self.qcpWidget.xAxis().connect(
            Qt.SIGNAL("selectionChanged(QCPAxis::SelectableParts)"),
            self._axesSelectionChanged)
        self.qcpWidget.yAxis().connect(
            Qt.SIGNAL("selectionChanged(QCPAxis::SelectableParts)"),
            self._axesSelectionChanged)

        buttonbar = QtGui.QWidget()
        bbLayout = QtGui.QHBoxLayout(buttonbar)
        button = QtGui.QPushButton("Replot", buttonbar)
        button.connect(QtCore.SIGNAL("clicked()"), self.refreshPlot)
        bbLayout.addWidget(button)
        button = QtGui.QPushButton("Remove", buttonbar)
        button.connect(QtCore.SIGNAL("clicked()"), self.removePlot)
        bbLayout.addWidget(button)
        button = QtGui.QPushButton("Legend", buttonbar)
        button.checkable = True
        button.checked = True
        button.connect(QtCore.SIGNAL("toggled(bool)"), self.toggleLegend)
        bbLayout.addWidget(button)
        button = QtGui.QPushButton(QtGui.QIcon.fromTheme("zoom-fit-best"), "",
                                   buttonbar)
        button.setToolTip("Zoom fit best")
        button.connect(QtCore.SIGNAL("clicked()"), self.qcpWidget.rescaleAxes)
        bbLayout.addWidget(button)

        self.xselect = QtGui.QComboBox(self)
        bbLayout.addWidget(self.xselect, 1)
        layout.addWidget(buttonbar)

        self.data = DataQCP(plugin, self.qcpWidget)
Пример #17
0
    def makeLeftPane (self, layout):
        layout.addWidget (QtGui.QLabel ("Select Y data"))
        refresh = QtGui.QPushButton ("Refresh", self)
        refresh.connect (QtCore.SIGNAL("clicked()"), self.refreshPlot)
        layout.addWidget (refresh)

        self.scrollArea = QtGui.QScrollArea (self)
        layout.addWidget (self.scrollArea)
Пример #18
0
            def newActionButton(actionName):
                actionButton = QtGui.QPushButton(actionName)

                def onAction():
                    self.trackerManager.onModeAction(actionName)

                actionButton.connect('clicked()', onAction)
                return actionButton
Пример #19
0
    def __init__(self, model, jointController, view):
        self.model = model
        self.jointController = jointController
        self.view = view

        self.colorNoHighlight = QtGui.QColor(190, 190, 190)
        self.colorHighlight = QtCore.Qt.red

        self.timer = TimerCallback()
        self.timer.callback = self.update
        self.timer.targetFps = 60
        #self.timer.start()

        self.collisionStateIds = []

        self.lastRobotStateMessage = None
        self.lastPlanMessage = None
        self.lastPlanCheckMessage = None

        lcmUtils.addSubscriber('EST_ROBOT_STATE', lcmdrc.robot_state_t, self.onRobotState)
        lcmUtils.addSubscriber('ROBOT_COLLISIONS', lcmdrc.robot_collision_array_t, self.onPlanCheck)
        lcmUtils.addSubscriber('CANDIDATE_MANIP_PLAN', lcmdrc.robot_plan_w_keyframes_t, self.onManipPlan)

        w = QtGui.QWidget()
        l = QtGui.QHBoxLayout(w)
        self.slider = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.clearButton = QtGui.QPushButton('clear')
        self.zeroButton = QtGui.QPushButton('zero')

        l.addWidget(self.clearButton)
        l.addWidget(self.zeroButton)
        l.addWidget(self.slider)

        self.slider.connect(self.slider, 'valueChanged(int)', self.onSlider)
        self.slider.connect(self.zeroButton, 'clicked()', self.onZeroButtonClicked)
        self.slider.connect(self.clearButton, 'clicked()', self.onClearButtonClicked)

        ww = QtGui.QWidget()
        ll = QtGui.QVBoxLayout(ww)
        ll.addWidget(self.view)
        ll.addWidget(w)
        ll.setMargin(0)
        ww.show()
        ww.resize(800, 600)
        self.widget = ww
Пример #20
0
    def __init__(self):
        super(dlg_copyKerning, self).__init__()

        # - Init
        self.active_font = pFont()
        self.class_data = {}

        # - Widgets
        self.cmb_layer = QtGui.QComboBox()
        self.cmb_layer.addItems(self.active_font.masters() + ['All masters'])

        self.btn_loadFile = QtGui.QPushButton('From File')
        self.btn_loadFont = QtGui.QPushButton('From Font')
        self.btn_saveExpr = QtGui.QPushButton('Save')
        self.btn_loadExpr = QtGui.QPushButton('Load')
        self.btn_exec = QtGui.QPushButton('Execute')

        self.btn_loadFont.setEnabled(False)

        self.btn_loadFile.clicked.connect(self.classes_fromFile)
        self.btn_exec.clicked.connect(self.process)
        self.btn_saveExpr.clicked.connect(self.expr_toFile)
        self.btn_loadExpr.clicked.connect(self.expr_fromFile)

        self.txt_editor = QtGui.QPlainTextEdit()

        # - Build layouts
        layoutV = QtGui.QGridLayout()
        layoutV.addWidget(QtGui.QLabel('Load class kerning data:'), 0, 0, 1, 4)
        layoutV.addWidget(self.btn_loadFont, 1, 0, 1, 2)
        layoutV.addWidget(self.btn_loadFile, 1, 2, 1, 2)
        layoutV.addWidget(QtGui.QLabel('Process font master:'), 2, 0, 1, 2)
        layoutV.addWidget(self.cmb_layer, 2, 2, 1, 2)
        layoutV.addWidget(QtGui.QLabel(str_help), 3, 0, 1, 4)
        layoutV.addWidget(self.txt_editor, 4, 0, 20, 4)
        layoutV.addWidget(self.btn_saveExpr, 24, 0, 1, 2)
        layoutV.addWidget(self.btn_loadExpr, 24, 2, 1, 2)
        layoutV.addWidget(self.btn_exec, 25, 0, 1, 4)

        # - Set Widget
        self.setLayout(layoutV)
        self.setWindowTitle('%s %s' % (app_name, app_version))
        self.setGeometry(300, 300, 250, 500)
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)  # Always on top!!
        self.show()
Пример #21
0
    def updateLayout(self):
        self.storeButtons = []
        self.flyButtons = []
        self.textEdits = []

        w = QtGui.QWidget()
        l = QtGui.QGridLayout(w)

        for i in range(self.numberOfBookmarks):
            storeButton = QtGui.QPushButton("Set")
            flyButton = QtGui.QPushButton("Fly")
            textEdit = QtGui.QLineEdit("camera %d" % i)
            storeButton.connect("clicked()", self.storeMapper, "map()")
            flyButton.connect("clicked()", self.flyMapper, "map()")
            self.storeMapper.setMapping(storeButton, storeButton)
            self.flyMapper.setMapping(flyButton, flyButton)
            self.storeButtons.append(storeButton)
            self.flyButtons.append(flyButton)
            self.textEdits.append(textEdit)
            l.addWidget(storeButton, i, 0)
            l.addWidget(flyButton, i, 1)
            l.addWidget(textEdit, i, 2)
            flyButton.setEnabled(False)

        self.flySpeedSpinner = QtGui.QDoubleSpinBox()
        self.flySpeedSpinner.setMinimum(0)
        self.flySpeedSpinner.setMaximum(60)
        self.flySpeedSpinner.setDecimals(1)
        self.flySpeedSpinner.setSingleStep(0.5)
        self.flySpeedSpinner.setSuffix(" seconds")
        self.flySpeedSpinner.setValue(1.0)

        l.addWidget(QtGui.QLabel("Fly speed:"), i + 1, 0, 2)
        l.addWidget(self.flySpeedSpinner, i + 1, 2)

        loadButton = QtGui.QPushButton("Load Stored")
        loadButton.connect("clicked()", self.loadStoredValues)
        l.addWidget(loadButton, i + 2, 0, 2)
        printButton = QtGui.QPushButton("Print Camera")
        printButton.connect("clicked()", self.printCurrentCamera)
        l.addWidget(printButton, i + 2, 2)

        self.widget.setWidget(w)
Пример #22
0
def testButton():
    def makeSphere():
        smp.Sphere()
        smp.Show()
        smp.ResetCamera()
        smp.Render()
    global button
    button = QtGui.QPushButton('sphere')
    button.connect('clicked()', makeSphere)
    button.show()
Пример #23
0
    def __init__(self):
        super(mixerHead, self).__init__()

        self.edt_glyphName = QtGui.QLineEdit()
        self.edt_stemV0 = QtGui.QLineEdit('1')
        self.edt_stemV1 = QtGui.QLineEdit('1')
        self.edt_stemH0 = QtGui.QLineEdit('1')
        self.edt_stemH1 = QtGui.QLineEdit('1')

        self.btn_refresh = QtGui.QPushButton('&Get Glyphs')
        self.btn_setaxis = QtGui.QPushButton('Set &Axis')
        self.btn_getVstem = QtGui.QPushButton('Get &V Stems')
        self.btn_getHstem = QtGui.QPushButton('Get &H Stems')

        self.spb_compV = QtGui.QDoubleSpinBox()
        self.spb_compH = QtGui.QDoubleSpinBox()
        self.spb_compV.setValue(0.)
        self.spb_compH.setValue(0.)
        self.spb_compV.setSingleStep(.01)
        self.spb_compH.setSingleStep(.01)

        self.cmb_0 = QtGui.QComboBox()
        self.cmb_1 = QtGui.QComboBox()

        self.addWidget(QtGui.QLabel('Glyph:'), 0, 0, 1, 1)
        self.addWidget(self.edt_glyphName, 0, 1, 1, 6)
        self.addWidget(self.btn_refresh, 0, 7, 1, 1)
        self.addWidget(QtGui.QLabel('Axis:'), 1, 0, 1, 1)
        self.addWidget(self.cmb_0, 1, 1, 1, 3)
        self.addWidget(self.cmb_1, 1, 4, 1, 3)
        self.addWidget(self.btn_setaxis, 1, 7, 1, 1)
        self.addWidget(QtGui.QLabel('V Stems:'), 2, 0, 1, 1)
        self.addWidget(self.edt_stemV0, 2, 1, 1, 3)
        self.addWidget(self.edt_stemV1, 2, 4, 1, 3)
        self.addWidget(self.btn_getVstem, 2, 7, 1, 1)
        self.addWidget(QtGui.QLabel('H Stems:'), 3, 0, 1, 1)
        self.addWidget(self.edt_stemH0, 3, 1, 1, 3)
        self.addWidget(self.edt_stemH1, 3, 4, 1, 3)
        self.addWidget(self.btn_getHstem, 3, 7, 1, 1)
        self.addWidget(QtGui.QLabel('Adj.V/H:'), 4, 0, 1, 1)
        self.addWidget(self.spb_compV, 4, 1, 1, 3)
        self.addWidget(self.spb_compH, 4, 4, 1, 3)
Пример #24
0
    def _makeBackButton(self):
        w = QtGui.QPushButton()
        w.setIcon(QtGui.QApplication.style().standardIcon(QtGui.QStyle.SP_ArrowBack))
        w.connect('clicked()', self.onBackButton)

        frame = QtGui.QWidget()
        l = QtGui.QHBoxLayout(frame)
        l.setMargin(0)
        l.addWidget(w)
        l.addStretch()
        return frame
Пример #25
0
    def makeLeftPane(self, layout):
        #button = QtGui.QPushButton ("Refresh", self)
        #button.connect (QtCore.SIGNAL("clicked()"), self.refreshPlot)
        #layout.addWidget (button)

        button = QtGui.QPushButton("Add plot below", self)
        button.connect(QtCore.SIGNAL("clicked()"), self.addPlotBelow)
        layout.addWidget(button)

        layout.addWidget(QtGui.QLabel("Select Y data"))
        self.scrollArea = QtGui.QScrollArea(self)
        layout.addWidget(self.scrollArea)
 def initGUI(self):
     self.setWindowTitle("Watershed Splitter Hybrid Mode Widget")
     widgetLayout = QtGui.QVBoxLayout()
     self.setLayout(widgetLayout)
     self.markerRadiusEdit = QtGui.QLineEdit()
     self.baseSubObjIdEdit = QtGui.QLineEdit()
     self.workAreaSizeEdit = QtGui.QLineEdit()
     opButtonsLayout = QtGui.QHBoxLayout()
     widgetLayout.addLayout(opButtonsLayout)
     self.resetButton = QtGui.QPushButton("Reset")
     self.resetButton.enabled = False
     self.resetButton.clicked.connect(self.resetButtonClicked)
     opButtonsLayout.addWidget(self.resetButton)
     self.finishButton = QtGui.QPushButton("Finish")
     self.finishButton.enabled = False
     self.finishButton.clicked.connect(self.finishButtonClicked)
     opButtonsLayout.addWidget(self.finishButton)
     self.subObjTableGroupBox = QtGui.QGroupBox("SubObjects")
     subObjTableLayout = QtGui.QVBoxLayout()
     widgetLayout.addLayout(subObjTableLayout)
     self.subObjTableGroupBox.setLayout(subObjTableLayout)
     self.subObjTable = self.MyTableWidget(self.subObjTableDel)
     subObjTableWidget = QtGui.QWidget()
     subObjTableLayout.addWidget(subObjTableWidget)
     subObjTableLayout = QtGui.QVBoxLayout()
     subObjTableWidget.setLayout(subObjTableLayout)
     subObjTableLayout.addWidget(self.subObjTable)
     self.setTableHeaders(self.subObjTable, self.OBJECT_LIST_COLUMNS)
     self.finalizeTable(self.subObjTable)
     # Invisibles
     self.widgetWidthEdit = QtGui.QLineEdit()
     self.widgetHeightEdit = QtGui.QLineEdit()
     self.widgetLeftEdit = QtGui.QLineEdit()
     self.widgetTopEdit = QtGui.QLineEdit()
     self.curFont = QtGui.QFont()
     # Window settings
     self.setWindowFlags(Qt.Qt.Window) # Yes, this has to be a called separately, or else the next call works wrong
     self.setWindowFlags((self.windowFlags() | Qt.Qt.CustomizeWindowHint) & ~Qt.Qt.WindowCloseButtonHint)
     self.resize(0,0)
     return
Пример #27
0
    def initWidget(self):
        box = QtGui.QVBoxLayout(self)

        setRefButton = QtGui.QPushButton("Set reference frame", self)
        setRefButton.connect('clicked()', self.setReference)
        box.addWidget(setRefButton)
        self.layout().addWidget(QtGui.QLabel("Current reference frame", self))
        self.refName = QtGui.QLabel("", self)
        self.layout().addWidget(self.refName)

        self.pointLabel = dict()
        self.normalLabel = dict()
        for t in ["global", "local", "reference"]:
            self.pointLabel[t] = self.addInfo("Point", t)
            self.normalLabel[t] = self.addInfo("Normal", t)
    def setupPlayback(self):

        self.timer = TimerCallback(targetFps=30)
        self.timer.callback = self.tick

        playButtonFps = 1.0 / self.dt
        print "playButtonFPS", playButtonFps
        self.playTimer = TimerCallback(targetFps=playButtonFps)
        self.playTimer.callback = self.playTimerCallback
        self.sliderMovedByPlayTimer = False

        panel = QtGui.QWidget()
        l = QtGui.QHBoxLayout(panel)

        playButton = QtGui.QPushButton('Play/Pause')
        playButton.connect('clicked()', self.onPlayButton)

        slider = QtGui.QSlider(QtCore.Qt.Horizontal)
        slider.connect('valueChanged(int)', self.onSliderChanged)
        self.sliderMax = self.numTimesteps
        slider.setMaximum(self.sliderMax)
        self.slider = slider

        l.addWidget(playButton)
        l.addWidget(slider)

        w = QtGui.QWidget()
        l = QtGui.QVBoxLayout(w)
        l.addWidget(self.view)
        l.addWidget(panel)
        w.showMaximized()

        self.frame.connectFrameModified(self.updateDrawIntersection)
        self.updateDrawIntersection(self.frame)

        applogic.resetCamera(viewDirection=[0.2, 0, -1])
        self.view.showMaximized()
        self.view.raise_()
        panel = screengrabberpanel.ScreenGrabberPanel(self.view)
        panel.widget.show()

        elapsed = time.time() - self.startSimTime
        simRate = self.counter / elapsed
        print "Total run time", elapsed
        print "Ticks (Hz)", simRate
        print "Number of steps taken", self.counter
        self.app.start()
Пример #29
0
	def __init__(self):
		super(dlg_sInstance, self).__init__()
	
		# - Init
		
		# - Widgets
		self.cmb_prog = QtGui.QComboBox()
		self.cmb_prog.addItems(text_prog)

		self.edt_wt0 = QtGui.QLineEdit()
		self.edt_wt1 = QtGui.QLineEdit()
		self.spb_weights = QtGui.QSpinBox()
		self.spb_widths = QtGui.QSpinBox()
		self.edt_result = WTableView({1:{'Stem':None, 'Weight':None, 'Width':None}})
		
		self.spb_weights.setValue(2)
		self.spb_widths.setValue(1)

		self.edt_wt0.setPlaceholderText('Stem width')
		self.edt_wt1.setPlaceholderText('Stem width')
				
		self.btn_calc = QtGui.QPushButton('Calculate instances')
		self.btn_calc.clicked.connect(self.calculateInstances)
		
		# - Build layouts 
		layoutV = QtGui.QGridLayout() 
		layoutV.addWidget(QtGui.QLabel('Stem progression:'),	0, 0, 1, 4)
		layoutV.addWidget(self.cmb_prog, 			1, 0, 1, 4)
		layoutV.addWidget(QtGui.QLabel('Begin:'),	2, 0, 1, 1)
		layoutV.addWidget(self.edt_wt0,				2, 1, 1, 1)
		layoutV.addWidget(QtGui.QLabel('End:'),		2, 2, 1, 1)
		layoutV.addWidget(self.edt_wt1,				2, 3, 1, 1)

		layoutV.addWidget(QtGui.QLabel('Weights:'),	3, 0, 1, 1)
		layoutV.addWidget(self.spb_weights,			3, 1, 1, 1)
		layoutV.addWidget(QtGui.QLabel('Widths:'),	3, 2, 1, 1)
		layoutV.addWidget(self.spb_widths,			3, 3, 1, 1)

		layoutV.addWidget(self.btn_calc, 			4, 0, 1, 4)
		layoutV.addWidget(self.edt_result, 			5, 0, 10, 4)

		# - Set Widget
		self.setLayout(layoutV)
		self.setWindowTitle('%s %s' %(app_name, app_version))
		self.setGeometry(300, 300, 330, 460)
		self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!!
		self.show()
Пример #30
0
    def __init__(self, maxStep):
        super(ProgressDialog, self).__init__()
        self.setWindowTitle('Exporting Images...')

        self.cancelCpy = False

        layout = QtGui.QVBoxLayout()
        self.setLayout(layout)
        self.pbar = QtGui.QProgressBar(self)
        self.pbar.setRange(0, maxStep)
        self.pbar.setGeometry(30, 40, 200, 25)

        self.pbar.connect("valueChanged (int)", self.status)
        layout.addWidget(self.pbar)

        self.cBtn = QtGui.QPushButton("cancel")
        self.cBtn.connect('clicked()', lambda: self.cancelCopy())
        layout.addWidget(self.cBtn)