예제 #1
0
    def setup_widget(self):
        self.Qcolore_select = QtGui.QPushButton('select color')
        self.layout.setWidget(0, input_field, self.Qcolore_select)
        self.color_dialog = QtGui.QColorDialog()
        self.Qcolore_select.clicked.connect(self.color_dialog.open)
        self.color_dialog.accepted.connect(self.set_color)

        self.Qcolore_replace = QtGui.QPushButton('replace color')
        self.layout.setWidget(1, input_field, self.Qcolore_replace)
        self.color_replace_dialog = QtGui.QColorDialog()
        self.Qcolore_replace.clicked.connect(self.color_replace_dialog.open)
        self.color_replace_dialog.accepted.connect(self.replace_color)
예제 #2
0
파일: config.py 프로젝트: hvasbath/kite
    def __init__(self, *args, **kwargs):
        QtGui.QDialog.__init__(self, *args, **kwargs)
        loadUi(get_resource('dialog_config.ui'), self)

        self.ok_button.released.connect(self.setAttributes)
        self.ok_button.released.connect(self.close)

        self.apply_button.released.connect(self.setAttributes)

        self.vector_color_picker = QtGui.QColorDialog(self)
        self.vector_color_picker.\
            setCurrentColor(QtGui.QColor(*config.vector_color))
        self.vector_color_picker.\
            setOption(self.vector_color_picker.ShowAlphaChannel)
        self.vector_color_picker.colorSelected.connect(self.updateVectorColor)
        self.vector_color_picker.setModal(True)
        self.vector_color.clicked.connect(self.vector_color_picker.show)

        self.vector_color.setValue = self.setButtonColor
        self.vector_color.value = self.getButtonColor

        self.chooseStoreDirButton.released.connect(self.chooseStoreDir)
        self.completer_model.setRootPath('')
        self.completer.setParent(self.default_gf_dir)
        self.default_gf_dir.setCompleter(self.completer)

        self.getAttributes()
예제 #3
0
    def _on_color_picker(self):
        dlg = QtWidgets.QColorDialog()
        if self._color:
            dlg.setCurrentColor(QtGui.QColor(self._color))

        if dlg.exec_():
            self._set_color(dlg.currentColor())
예제 #4
0
def select_color(i):

    global color
    color = QtGui.QColorDialog()
    color.setCustomColor(0, 0x212121)
    color.setCurrentColor(QtGui.QColor.fromRgb(int(buttons[i][0].styleSheet().split("#")[1], 16)))
    color.colorSelected.connect(lambda color: color_selected(i, color))
    color.open()
예제 #5
0
 def createColorDialog(self):
     """Create a new dialog for color."""
     color = map(int, self.form.font_color_lineEdit.text().split(","))
     color = QtGui.QColor(*color)
     self.dialog = QtGui.QColorDialog(color, self.form)
     self.dialog.setOption(QtGui.QColorDialog.ShowAlphaChannel)
     self.dialog.colorSelected.connect(self.colorDialogAccepted)
     self.form.font_color_button.clicked.connect(self.dialog.show)
예제 #6
0
    def openColorDialog(self):

        colorDialog = QtGui.QColorDialog()
        colorDialog.setOption(QtGui.QColorDialog.DontUseNativeDialog, True)
        newColor = colorDialog.getColor(self._color, self)
        if newColor.isValid():
            self._color = newColor
            self.colorChanged.emit(newColor)
예제 #7
0
 def changeColor(self):
     color = self.color()
     d = QtGui.QColorDialog(self.parent())
     d.currentColorChanged.connect(lambda v, self=self: self.setColor(v))
     d.open()
     if d.exec_():
         self.setColor(d.selectedColor())
     else:
         self.setColor(color)
예제 #8
0
 def mousePressEvent(self, event):
     if self.isEditable():
         self.__backupColor = self.__color
         self.beginInteraction()
         dialog = QtGui.QColorDialog(self.__color, self)
         dialog.currentColorChanged.connect(self.__onColorChanged)
         dialog.accepted.connect(self.__onAccepted)
         dialog.rejected.connect(self.__onCanceled)
         dialog.setModal(True)
         dialog.show()
    def showColorDialog(self):
        colorDialog = QtGui.QColorDialog()
        colorDialog.setCurrentColor(QtGui.QColor("#aabbcc"))
        result = colorDialog.exec_()

        selected = colorDialog.selectedColor()
        message = "Selected color: {r} {g} {b}\nClicked on: {c}".format(
            r=selected.red(),
            g=selected.green(),
            b=selected.blue(),
            c="Ok" if result == 1 else "Cancel")

        self.showMessageBox(message)
예제 #10
0
    def initVars(self):
        self._call_table = QtGui.QTableWidget()
        self._call_table.setEditTriggers(
            QtGui.QAbstractItemView.NoEditTriggers)
        self._call_table.setRowCount(0)
        self._call_table.setColumnCount(6)
        self._call_table.setHorizontalHeaderLabels(
            ["Category", "Caller", "Parent  Caller", "API", "Return", "Args"])
        self.clipboard = QtGui.QClipboard()
        self.setupTableContextMenu()
        self._marked_up = set()
        self._checkbox_map = {}

        # call color picker setup
        self._color_picker = QtGui.QColorDialog()
        self._color_picker.setCurrentColor(QtGui.QColor(0xff, 165, 0x0))
        self._color_picker.blockSignals(True)
        self._color_picker.currentColorChanged.connect(self.chooseColor)
        self._color_picker.blockSignals(False)
        self._color_button = QtGui.QPushButton("")
        self._color_button.setStyleSheet(
            "font-size:15px;background-color:#ffa500; border: 2px solid #222222"
        )
        self._color_button.setFixedSize(15, 15)
        self._color_button.clicked.connect(self._color_picker.open)

        # func color picker setup
        self._func_color_picker = QtGui.QColorDialog()
        self._func_color_picker.setCurrentColor(QtGui.QColor(0xff, 0xff, 0xff))
        self._func_color_picker.blockSignals(True)
        self._func_color_picker.currentColorChanged.connect(
            self.chooseFuncColor)
        self._func_color_picker.blockSignals(False)
        self._func_color_button = QtGui.QPushButton("")
        self._func_color_button.setStyleSheet(
            "font-size:15px;background-color:#ffffff; border: 2px solid #222222"
        )
        self._func_color_button.setFixedSize(15, 15)
        self._func_color_button.clicked.connect(self._func_color_picker.open)
예제 #11
0
       def pickColor():
           """
   A function that will execute a dialog and if accepted will update
   the color of the currently selected item.
   @ In, None
   @ Out, None
 """
           dialog = qtw.QColorDialog()
           dialog.setCurrentColor(self.getColor(idx))
           dialog.exec_()
           if dialog.result() == qtw.QDialog.Accepted:
               self.setColor(idx, dialog.currentColor())
               self.updateScene()
예제 #12
0
    def onColorPicker(self):
        '''
        Show color-picker dialog to select color.

        Qt will use the native dialog by default.

        '''
        dlg = QtGui.QColorDialog(self)
        if self._color:
            dlg.setCurrentColor(QtGui.QColor(self._color))

        if dlg.exec_():
            self.setColor(dlg.currentColor().name())
예제 #13
0
    def on_color2(self):
        color = self.vtk_widget.bg_color_2
        initial_color = QtGui.QColor(255 * color[0], 255 * color[1],
                                     255 * color[2])
        color = QtGui.QColorDialog().getColor(initial_color, self)

        if not color.isValid():
            return

        red = color.red() / 255.
        blue = color.blue() / 255.
        green = color.green() / 255.
        color2 = (red, green, blue)
        self.vtk_widget.set_background_color(color2=color2)
예제 #14
0
 def showColorDialog(self):
     colorDialog = QtGui.QColorDialog()
     colorDialog.setCurrentColor(QtGui.QColor("#aabbcc"))
     result = colorDialog.exec_()
     self.redrawColorBoxes()
     self.colorPalette.setPixmap(self.pixmap)
예제 #15
0
    def setup_widget(self):
        # qt helper line
        self.Qhl_pos = QtGui.QDoubleSpinBox()

        # qt element widget
        self.tool_widget = QtGui.QStackedWidget()
        self.tool_layout = QtGui.QFormLayout(self.tool_widget)

        # qt layer widget
        self.layer_widget = QtGui.QWidget()
        self.layer_layout = QtGui.QFormLayout(self.layer_widget)
        self.layer_selection = LayerComboBox(self.layer_widget)
        self.layer_combobox = LayerComboBox(self.layer_widget)
        self.layer_color_button = QtGui.QPushButton('select color')
        self.layer_color_dialog = QtGui.QColorDialog()

        self.tool_widget.setWindowTitle('object properties')
        self.layer_widget.setWindowTitle('layers')
        self.form.append(self.layer_widget)
        self.form.append(self.tool_widget)

        # temp_wid = QtGui.QWidget()
        # temp_lay = QtGui.QHBoxLayout(temp_wid)
        # self.layout.setWidget(1, input_field, temp_wid)

        self.none_widget = QtGui.QWidget()
        self.line_widget = QtGui.QWidget()
        self.lw_att_wid = QtGui.QWidget()
        self.up_att_wid = QtGui.QWidget()
        self.Qline_list = QtGui.QListWidget()
        for _type in LineType.types.values():
            self.Qline_list.addItem(QLineType_item(_type))
        self.Qline_list.sortItems()

        self.up_att_lay = QtGui.QFormLayout(self.up_att_wid)
        self.lw_att_lay = QtGui.QFormLayout(self.lw_att_wid)
        self.line_layout = QtGui.QFormLayout(self.line_widget)
        self.none_layout = QtGui.QFormLayout(self.none_widget)

        self.target_length = QtGui.QDoubleSpinBox()
        self.target_length.setDecimals(5)
        self.line_layout.setWidget(0, text_field,
                                   QtGui.QLabel('target length: '))
        self.line_layout.setWidget(0, input_field, self.target_length)
        self.line_layout.setWidget(1, text_field, QtGui.QLabel('line type: '))
        self.line_layout.setWidget(1, input_field, self.Qline_list)
        self.target_length.valueChanged.connect(self.update_target_length)
        self.Qline_list.currentItemChanged.connect(self.update_line_type)
        self.QLineName = QtGui.QLineEdit()
        self.line_layout.setWidget(2, text_field, QtGui.QLabel('name'))
        self.line_layout.setWidget(2, input_field, self.QLineName)
        self.QLineName.textChanged.connect(self.line_name_changed)

        self.attach_x_val = QtGui.QDoubleSpinBox()
        self.attach_y_val = QtGui.QDoubleSpinBox()
        self.attach_z_val = QtGui.QDoubleSpinBox()

        for spinbox in [
                self.attach_x_val, self.attach_y_val, self.attach_z_val
        ]:
            spinbox.setMaximum(10.)
            spinbox.setMinimum(-10.)
            spinbox.valueChanged.connect(self.update_lw_att_pos)

        self.lw_att_lay.addWidget(self.attach_x_val)
        self.lw_att_lay.addWidget(self.attach_y_val)
        self.lw_att_lay.addWidget(self.attach_z_val)

        self.up_att_force = QtGui.QDoubleSpinBox()
        self.up_att_force.setSingleStep(0.1)
        self.up_att_lay.setWidget(0, text_field, QtGui.QLabel('force'))
        self.up_att_lay.setWidget(0, input_field, self.up_att_force)
        self.up_att_force.valueChanged.connect(self.update_up_att_force)

        self.up_att_rib = QtGui.QSpinBox()
        self.up_att_rib.setMinimum(0)
        self.up_att_rib.setMaximum(self.parametric_glider.shape.half_rib_num -
                                   1)
        self.up_att_lay.setWidget(1, text_field, QtGui.QLabel('rib nr'))
        self.up_att_lay.setWidget(1, input_field, self.up_att_rib)
        self.up_att_rib.valueChanged.connect(self.update_up_att_rib)

        self.up_att_pos = QtGui.QDoubleSpinBox()
        self.up_att_pos.setMinimum(0)
        self.up_att_pos.setMaximum(1)
        self.up_att_pos.setSingleStep(0.01)
        self.up_att_lay.setWidget(2, text_field, QtGui.QLabel('position'))
        self.up_att_lay.setWidget(2, input_field, self.up_att_pos)
        self.up_att_pos.valueChanged.connect(self.update_up_att_pos)

        self.tool_widget.addWidget(self.none_widget)
        self.tool_widget.addWidget(self.line_widget)
        self.tool_widget.addWidget(self.lw_att_wid)
        self.tool_widget.addWidget(self.up_att_wid)
        self.tool_widget.setCurrentWidget(self.none_widget)

        button = QtGui.QPushButton('Help')
        self.layout.setWidget(0, input_field, button)
        button.clicked.connect(self.show_help)

        self.Qhl_pos.setValue(50)
        self.Qhl_pos.setRange(0, 100)
        self.Qhl_pos.setSingleStep(1)
        self.Qhl_pos.connect(self.Qhl_pos,
                             QtCore.SIGNAL('valueChanged(double)'),
                             self.update_helper_line)

        self.layout.setWidget(1, text_field, QtGui.QLabel('helper_line_pos'))
        self.layout.setWidget(1, input_field, self.Qhl_pos)

        # layers:

        add_button = QtGui.QPushButton('add layer')
        del_button = QtGui.QPushButton('delete layer')
        self.layer_layout.setWidget(0, text_field,
                                    QtGui.QLabel('work on layer'))
        self.layer_layout.setWidget(0, input_field, self.layer_combobox)
        self.layer_layout.setWidget(1, text_field, add_button)
        self.layer_layout.setWidget(1, input_field, del_button)
        self.layer_layout.setWidget(2, text_field, QtGui.QLabel('setLayer'))
        self.layer_layout.setWidget(2, input_field, self.layer_selection)
        self.layer_layout.setWidget(
            3, text_field, QtGui.QLabel('select color of disabled lines'))
        self.layer_layout.setWidget(3, input_field, self.layer_color_button)

        # dialogs
        self.add_layer_dialog = QtGui.QInputDialog()
        add_button.clicked.connect(self.add_new_layer)
        del_button.clicked.connect(self.delete_layer)
        self.layer_combobox.currentIndexChanged.connect(self.show_layer)
        self.layer_selection.activated.connect(self.set_layer_by_current)
        self.layer_selection.setEnabled(False)
        self.layer_color_button.clicked.connect(self.layer_color_dialog.open)
        self.layer_color_dialog.accepted.connect(self.color_changed)
예제 #16
0
    def __init__(self, parent=None):
        """DON'T CHANGE THE FIRST TWO LINES """
        super(ParticleSettings, self).__init__(parent)

        self.gridLayout = QtGui.QGridLayout()
        self.tabWidget = QtGui.QTabWidget()
        self.tabWidget.setGeometry(QtCore.QRect(20, 20, 331, 411))
        self.tabWidget.setMinimumSize(QtCore.QSize(327, 415))
        self.Fire = QtGui.QWidget()
        self.Temperature = QtGui.QGroupBox(self.Fire)
        self.Temperature.setGeometry(QtCore.QRect(10, 20, 301, 91))
        self.hSl_tScale = QtGui.QSlider(self.Temperature)
        self.hSl_tScale.setGeometry(QtCore.QRect(160, 20, 131, 21))
        self.hSl_tScale.setOrientation(QtCore.Qt.Horizontal)
        self.lcd_tScale = QtGui.QLCDNumber(self.Temperature)
        self.lcd_tScale.setGeometry(QtCore.QRect(110, 20, 41, 23))
        self.tScale = QtGui.QLabel(self.Temperature)
        self.tScale.setGeometry(QtCore.QRect(20, 20, 41, 21))
        self.tDissipation = QtGui.QLabel(self.Temperature)
        self.tDissipation.setGeometry(QtCore.QRect(20, 50, 61, 21))
        self.lcd_tDissipation = QtGui.QLCDNumber(self.Temperature)
        self.lcd_tDissipation.setGeometry(QtCore.QRect(110, 50, 41, 23))
        self.hSl_tDissipation = QtGui.QSlider(self.Temperature)
        self.hSl_tDissipation.setGeometry(QtCore.QRect(160, 50, 131, 21))
        self.hSl_tDissipation.setOrientation(QtCore.Qt.Horizontal)
        self.Fuel = QtGui.QGroupBox(self.Fire)
        self.Fuel.setGeometry(QtCore.QRect(10, 130, 301, 91))
        self.hSl_fScale = QtGui.QSlider(self.Fuel)
        self.hSl_fScale.setGeometry(QtCore.QRect(160, 20, 131, 21))
        self.hSl_fScale.setOrientation(QtCore.Qt.Horizontal)
        self.lcd_fScale = QtGui.QLCDNumber(self.Fuel)
        self.lcd_fScale.setGeometry(QtCore.QRect(110, 20, 41, 23))
        self.fScale = QtGui.QLabel(self.Fuel)
        self.fScale.setGeometry(QtCore.QRect(20, 20, 41, 21))
        self.fReaSpe = QtGui.QLabel(self.Fuel)
        self.fReaSpe.setGeometry(QtCore.QRect(20, 50, 91, 21))
        self.lcd_fReaSpe = QtGui.QLCDNumber(self.Fuel)
        self.lcd_fReaSpe.setGeometry(QtCore.QRect(110, 50, 41, 23))
        self.hSl_fReaSpe = QtGui.QSlider(self.Fuel)
        self.hSl_fReaSpe.setGeometry(QtCore.QRect(160, 50, 131, 21))
        self.hSl_fReaSpe.setOrientation(QtCore.Qt.Horizontal)
        self.InputBias = QtGui.QGroupBox(self.Fire)
        self.InputBias.setGeometry(QtCore.QRect(10, 240, 301, 91))
        self.hSl_Incandescence = QtGui.QSlider(self.InputBias)
        self.hSl_Incandescence.setGeometry(QtCore.QRect(160, 20, 131, 21))
        self.hSl_Incandescence.setOrientation(QtCore.Qt.Horizontal)
        self.lcd_Incandescence = QtGui.QLCDNumber(self.InputBias)
        self.lcd_Incandescence.setGeometry(QtCore.QRect(110, 20, 41, 23))
        self.Incandescence = QtGui.QLabel(self.InputBias)
        self.Incandescence.setGeometry(QtCore.QRect(20, 20, 81, 21))
        self.Opacity = QtGui.QLabel(self.InputBias)
        self.Opacity.setGeometry(QtCore.QRect(20, 50, 91, 21))
        self.lcd_Opacity = QtGui.QLCDNumber(self.InputBias)
        self.lcd_Opacity.setGeometry(QtCore.QRect(110, 50, 41, 23))
        self.hSl_Opacity = QtGui.QSlider(self.InputBias)
        self.hSl_Opacity.setGeometry(QtCore.QRect(160, 50, 131, 21))
        self.hSl_Opacity.setOrientation(QtCore.Qt.Horizontal)
        self.CreateFire = QtGui.QPushButton(self.Fire)
        self.CreateFire.setGeometry(QtCore.QRect(20, 350, 81, 23))
        self.DeleteFire = QtGui.QPushButton(self.Fire)
        self.DeleteFire.setGeometry(QtCore.QRect(120, 350, 81, 23))
        self.ResetFire = QtGui.QPushButton(self.Fire)
        self.ResetFire.setGeometry(QtCore.QRect(224, 350, 81, 23))
        self.tabWidget.addTab(self.Fire, "")
        self.Word = QtGui.QWidget()
        self.wordEdit = QtGui.QLineEdit(self.Word)
        self.wordEdit.setPlaceholderText("Maya")
        self.wordEdit.setGeometry(QtCore.QRect(10, 40, 121, 20))
        self.fontComboBox = QtGui.QFontComboBox(self.Word)
        self.fontComboBox.setGeometry(QtCore.QRect(140, 40, 171, 22))
        self.CreateWord = QtGui.QPushButton(self.Word)
        self.CreateWord.setGeometry(QtCore.QRect(160, 70, 151, 23))
        self.DeleteWord = QtGui.QPushButton(self.Word)
        self.DeleteWord.setGeometry(QtCore.QRect(10, 70, 141, 23))
        self.Input = QtGui.QLabel(self.Word)
        self.Input.setGeometry(QtCore.QRect(10, 10, 81, 16))
        self.toolBox = QtGui.QToolBox(self.Word)
        self.toolBox.setGeometry(QtCore.QRect(10, 130, 301, 241))
        self.Position = QtGui.QWidget()
        self.Position.setGeometry(QtCore.QRect(0, 0, 301, 237))
        self.X = QtGui.QLabel(self.Position)
        self.X.setGeometry(QtCore.QRect(10, 20, 31, 21))
        self.lcd_x = QtGui.QLCDNumber(self.Position)
        self.lcd_x.setGeometry(QtCore.QRect(30, 20, 51, 21))
        self.hSl_x = QtGui.QSlider(self.Position)
        self.hSl_x.setGeometry(QtCore.QRect(100, 20, 181, 21))
        self.hSl_x.setOrientation(QtCore.Qt.Horizontal)
        self.lcd_y = QtGui.QLCDNumber(self.Position)
        self.lcd_y.setGeometry(QtCore.QRect(30, 60, 51, 21))
        self.hSl_y = QtGui.QSlider(self.Position)
        self.hSl_y.setGeometry(QtCore.QRect(100, 60, 181, 21))
        self.hSl_y.setOrientation(QtCore.Qt.Horizontal)
        self.Y = QtGui.QLabel(self.Position)
        self.Y.setGeometry(QtCore.QRect(10, 60, 31, 21))
        self.lcd_z = QtGui.QLCDNumber(self.Position)
        self.lcd_z.setGeometry(QtCore.QRect(30, 100, 51, 21))
        self.hSl_z = QtGui.QSlider(self.Position)
        self.hSl_z.setGeometry(QtCore.QRect(100, 100, 181, 21))
        self.hSl_z.setOrientation(QtCore.Qt.Horizontal)
        self.Z = QtGui.QLabel(self.Position)
        self.Z.setGeometry(QtCore.QRect(10, 100, 31, 21))
        self.ResetWord = QtGui.QPushButton(self.Position)
        self.ResetWord.setGeometry(QtCore.QRect(210, 150, 75, 23))
        self.toolBox.addItem(self.Position, "")
        self.Color = QtGui.QWidget()
        self.Color.setGeometry(QtCore.QRect(0, 0, 301, 237))
        self.dial = QtGui.QDial(self.Color)
        self.dial.setGeometry(QtCore.QRect(200, 30, 91, 101))
        self.dial.setMaximum(359)
        #  myPixmap = QtGui.QPixmap(QtGui.QImage('color.jpg'))
        #   myScaledPixmap = myPixmap.scaled(self.dial.size(), Qt.KeepAspectRatio)
        #   self.dial.setPixmap(myScaledPixmap)
        #   self.colorLabel = QtGui.QLabel(self.Color)
        #   self.colorLabel.setGeometry(QtCore.QRect(210, 30, 91, 91))
        #   self.dial.setPixmap(QtGui.QPixmap(os.getcwd() + "/color.jpg"))
        #    self.colorLayout = QtGui.QVBoxLayout(self.colorWidget)
        #    self.colorLayout.setContentsMargins(0, 0, 0, 0)
        self.radio_deColor = QtGui.QRadioButton(self.Color)
        self.radio_deColor.setGeometry(QtCore.QRect(30, 10, 81, 20))
        self.radio_deColor.setChecked(True)
        self.radio_setColor = QtGui.QRadioButton(self.Color)
        self.radio_setColor.setGeometry(QtCore.QRect(180, 10, 82, 17))
        self.lcd_R = QtGui.QLCDNumber(self.Color)
        self.lcd_R.setGeometry(QtCore.QRect(20, 40, 41, 21))
        self.hSl_R = QtGui.QSlider(self.Color)
        self.hSl_R.setEnabled(False)
        self.hSl_R.setGeometry(QtCore.QRect(70, 40, 131, 21))
        self.hSl_R.setOrientation(QtCore.Qt.Horizontal)
        self.R = QtGui.QLabel(self.Color)
        self.R.setGeometry(QtCore.QRect(10, 40, 31, 21))
        self.hSl_G = QtGui.QSlider(self.Color)
        self.hSl_G.setEnabled(False)
        self.hSl_G.setGeometry(QtCore.QRect(70, 70, 131, 21))
        self.hSl_G.setOrientation(QtCore.Qt.Horizontal)
        self.lcd_G = QtGui.QLCDNumber(self.Color)
        self.lcd_G.setGeometry(QtCore.QRect(20, 70, 41, 21))
        self.G = QtGui.QLabel(self.Color)
        self.G.setGeometry(QtCore.QRect(10, 70, 31, 21))
        self.hSl_B = QtGui.QSlider(self.Color)
        self.hSl_B.setEnabled(False)
        self.hSl_B.setGeometry(QtCore.QRect(70, 100, 131, 21))
        self.hSl_B.setOrientation(QtCore.Qt.Horizontal)
        self.lcd_B = QtGui.QLCDNumber(self.Color)
        self.lcd_B.setGeometry(QtCore.QRect(20, 100, 41, 21))
        self.B = QtGui.QLabel(self.Color)
        self.B.setGeometry(QtCore.QRect(10, 100, 31, 21))
        self.word_tran = QtGui.QLabel(self.Color)
        self.word_tran.setGeometry(QtCore.QRect(10, 150, 81, 21))
        self.lcd_wordTran = QtGui.QLCDNumber(self.Color)
        self.lcd_wordTran.setGeometry(QtCore.QRect(90, 150, 51, 21))
        self.hSl_wordTran = QtGui.QSlider(self.Color)
        self.hSl_wordTran.setGeometry(QtCore.QRect(150, 150, 141, 21))
        self.hSl_wordTran.setOrientation(QtCore.Qt.Horizontal)
        self.line_2 = QtGui.QFrame(self.Color)
        self.line_2.setGeometry(QtCore.QRect(10, 130, 281, 16))
        self.line_2.setFrameShape(QtGui.QFrame.HLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.toolBox.addItem(self.Color, "")
        self.line = QtGui.QFrame(self.Word)
        self.line.setGeometry(QtCore.QRect(10, 100, 301, 20))
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.tabWidget.addTab(self.Word, "")
        self.Ink = QtGui.QWidget()
        self.CreateInk = QtGui.QPushButton(self.Ink)
        self.CreateInk.setGeometry(QtCore.QRect(230, 20, 71, 26))
        self.DeleteInk = QtGui.QPushButton(self.Ink)
        self.DeleteInk.setGeometry(QtCore.QRect(230, 55, 71, 26))
        self.addToList = QtGui.QPushButton(self.Ink)
        self.addToList.setGeometry(QtCore.QRect(230, 90, 71, 26))
        self.inkList = QtGui.QListWidget(self.Ink)
        self.inkList.setGeometry(QtCore.QRect(20, 20, 171, 111))
        self.inkOpenBtn = QtGui.QPushButton(self.Ink)
        self.inkOpenBtn.setGeometry(QtCore.QRect(20, 140, 71, 23))
        self.inkSaveBtn = QtGui.QPushButton(self.Ink)
        self.inkSaveBtn.setGeometry(QtCore.QRect(120, 140, 71, 23))
        self.btnDrop = QtGui.QPushButton(self.Ink)
        self.btnDrop.setGeometry(QtCore.QRect(230, 125, 71, 36))
        self.line_3 = QtGui.QFrame(self.Ink)
        self.line_3.setGeometry(QtCore.QRect(200, 20, 20, 141))
        self.line_3.setFrameShape(QtGui.QFrame.VLine)
        self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_4 = QtGui.QFrame(self.Ink)
        self.line_4.setGeometry(QtCore.QRect(20, 170, 281, 16))
        self.line_4.setFrameShape(QtGui.QFrame.HLine)
        self.line_4.setFrameShadow(QtGui.QFrame.Sunken)
        self.inkColor = QtGui.QColorDialog()
        self.verticalLayoutWidget = QtGui.QWidget(self.Ink)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(20, 190, 281, 181))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.addWidget(self.inkColor)
        #    self.inkColor.setGeometry(QtCore.QRect(30, 230, 261, 141))
        #  self.inkColor.getColor()

        self.tabWidget.addTab(self.Ink, "")

        # SETTING WINDOW TITLE
        self.setWindowTitle("Particle")
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.Fire), "Fire")
        self.Temperature.setTitle("Temperature")
        self.tScale.setText("Scale :")
        self.tDissipation.setText("Dissipation :")
        self.Fuel.setTitle("Fuel")
        self.fScale.setText("Scale :")
        self.fReaSpe.setText("Reaction Speed :")
        self.InputBias.setTitle("InputBias")
        self.Incandescence.setText("Incandescence")
        self.Opacity.setText("Opacity")
        self.CreateFire.setText("Create")
        self.DeleteFire.setText("Delete")
        self.ResetFire.setText("Reset")
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.Word), "Word")
        self.Input.setText("Input a word:")
        self.CreateWord.setText("OK")
        self.toolBox.setItemText(self.toolBox.indexOf(self.Position),
                                 "Position")
        self.X.setText("X :")
        self.Y.setText("Y :")
        self.Z.setText("Z :")
        self.DeleteWord.setText("Clean")
        self.ResetWord.setText("Reset")
        self.toolBox.setItemText(self.toolBox.indexOf(self.Color), "Color")
        self.radio_deColor.setText("default color")
        self.radio_setColor.setText("set color")
        self.R.setText("R ")
        self.B.setText("B ")
        self.G.setText("G ")
        self.word_tran.setText("transparency:")
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.Ink), "Ink")
        self.inkOpenBtn.setText("open")
        self.inkSaveBtn.setText("save")
        self.CreateInk.setText("create Ink")
        self.btnDrop.setText("click me")
        self.DeleteInk.setText("delete")
        self.addToList.setText("addToList")

        # set Slider values
        self.hSl_tScale.setRange(0, 10000)
        self.hSl_tScale.setSliderPosition(1000)
        self.lcd_tScale.display(1)

        self.hSl_tDissipation.setRange(0, 1000)
        self.hSl_tDissipation.setSliderPosition(300)
        self.lcd_tDissipation.display(0.3)

        self.hSl_fScale.setRange(0, 10000)
        self.hSl_fScale.setSliderPosition(3000)
        self.lcd_fScale.display(3)

        self.hSl_fReaSpe.setRange(0, 1000)
        self.hSl_fReaSpe.setSliderPosition(1000)
        self.lcd_fReaSpe.display(1)

        self.hSl_Incandescence.setRange(-1000, 1000)
        self.hSl_Incandescence.setSliderPosition(250)
        self.lcd_Incandescence.display(0.25)

        self.hSl_Opacity.setRange(-1000, 1000)
        self.hSl_Opacity.setSliderPosition(-100)
        self.lcd_Opacity.display(-0.1)

        self.hSl_x.setRange(-10000, 10000)
        self.hSl_x.setSliderPosition(0)
        self.lcd_x.display(0)

        self.hSl_y.setRange(-10000, 10000)
        self.hSl_y.setSliderPosition(0)
        self.lcd_y.display(0)

        self.hSl_z.setRange(-10000, 10000)
        self.hSl_z.setSliderPosition(0)
        self.lcd_z.display(0)

        self.hSl_R.setRange(0, 1000)
        self.hSl_R.setSliderPosition(500)
        self.lcd_R.display(0.5)

        self.hSl_B.setRange(0, 1000)
        self.hSl_B.setSliderPosition(500)
        self.lcd_B.display(0.5)

        self.hSl_G.setRange(0, 1000)
        self.hSl_G.setSliderPosition(500)
        self.lcd_G.display(0.5)

        self.hSl_wordTran.setRange(0, 1000)
        self.hSl_wordTran.setSliderPosition(0)
        self.lcd_wordTran.display(0)

        # ADDED TO GET IT TO SHOW
        self.gridLayout.addWidget(self.tabWidget)
        self.setLayout(self.gridLayout)
        self.show()

        # variable
        self.fire = []
        self.word = []
        self.wordPar = []
        self.wordTexture = []
        self.setRGB = {'r': 0.5, 'g': 0.5, 'b': 0.5}
        self.font = 'Tahoma'
        self.ink = []
        self.inkEmi = []

        #time line
        mc.playbackOptions(min=1, max=300, loop='continuous')

        # MAKE THE BUTTONS WORK
        self.makeConnections()

        # LOAD DEFAULT LIBRARY

        self.controllers = pickle.load(open(defaultLibararyPath, "rb"))
예제 #17
0
from myTool.lib import qt
from PySide import QtGui, QtCore

dialog = QtGui.QColorDialog(qt.getMayaWindow())
result = dialog.exec_()
if result:
    print dialog.selectedColor()
예제 #18
0
## Line 3:   2   8   14  20  26  32  38  44  ##
## Line 4:   3   9   15  21  27  33  39  45  ##
## Line 5:   4   10  16  22  28  34  40  46  ##
## Line 6:   5   11  17  23  29  35  41  47  ##
##                                           ##
## CustomColor:                              ##
##                                           ##
##           Colonnes:                       ##
##           1:  2:  3:  4:  5:  6:  7:  8:  ##
##          _______________________________  ##
## Line 1:   0   2   4   6   8   10  12  14  ##
## Line 2:   1   3   5   7   9   11  13  15  ##
##                                           ##
###############################################

color_Dialog   = QtGui.QColorDialog()
# FreeCAD-Tango
# Customize the colors in the standard box (in numeric mode)
#
#### Dialog line 1
color_Dialog.setStandardColor( 0, QtGui.QColor(252, 233,  79 , 0).rgba())    # Butte 1
color_Dialog.setStandardColor( 6, QtGui.QColor(237, 212,   0 , 0).rgba())    # Butte 2
color_Dialog.setStandardColor(12, QtGui.QColor(196, 160,   0 , 0).rgba())    # Butte 3
color_Dialog.setStandardColor(18, QtGui.QColor( 48,  43,   0 , 0).rgba())    # Butte 4

color_Dialog.setStandardColor(24, QtGui.QColor(138, 226,  52 , 0).rgba())    # Chameleo 1
color_Dialog.setStandardColor(30, QtGui.QColor(115, 210,  22 , 0).rgba())    # Chameleo 2
color_Dialog.setStandardColor(36, QtGui.QColor( 78, 154,   6 , 0).rgba())    # Chameleo 3
color_Dialog.setStandardColor(42, QtGui.QColor( 23,  42,   4 , 0).rgba())    # Chameleo 4
#### Dialog line 2
color_Dialog.setStandardColor( 1, QtGui.QColor(252, 175,  62 , 0).rgba())    # Orang 1
예제 #19
0
# colors yay

import idc
import idaapi
import idautils

from PySide import QtGui

diag = QtGui.QColorDialog()

x = diag.getColor()
r, g, b, a = x.getRgb()

# ida does BGR instead of RGB
rgb = int("%02x%02x%02x" % (b, g, r), 16)

func_item = idaapi.get_func(idc.ScreenEA())

for head in idautils.Heads(func_item.startEA, func_item.endEA):
    idc.SetColor(head, idc.CIC_ITEM, rgb)

idaapi.refresh_idaview_anyway()
예제 #20
0
 def _open_color_dialog(self):
     col_dialog = QtGui.QColorDialog(self)
     col = col_dialog.getColor(self.preference.background_color)
     if col.isValid():
         self.preference.background_color = col
         self.ui.line_edit_color.background_color = col
예제 #21
0
 def pickColor(self):
     pick = QtGui.QColorDialog(QtGui.QColor(self.kolor[0], self.kolor[1], self.kolor[2]))
     if pick.exec_():
         [R, G, B, A] = pick.selectedColor().getRgb()
         
         self.setColor([R, G, B])