コード例 #1
0
// ***************************************************************************
void CVegetableApperancePage::OnDblclkListVegetableColor()
{
    CRGBA	color;

    // get the current color of the value.
    int		id= ColorList.GetCurSel();
    if(id!=LB_ERR)
    {
        color= ColorList.getValue(id);

        // Open a colorDialog.
        CColorDialog	colorDialog(RGB(color.R, color.G, color.B), CC_FULLOPEN);
        if( colorDialog.DoModal()==IDOK )
        {
            // update view
            COLORREF cref = colorDialog.GetColor();
            color.set(GetRValue(cref), GetGValue(cref), GetBValue(cref));
            ColorList.changeCurSelValue(color);
            // update vegetable
            writeToVegetableColor(_Vegetable);

            // update 3D view
            _VegetableDlg->refreshVegetableDisplay();
        }
    }
}
コード例 #2
0
ファイル: scolorbutton.cpp プロジェクト: realbardia/silicon
SColorButton::SColorButton( const QString & name , QWidget *parent ) :
    QWidget( parent )
{
    p = new SColorButtonPrivate;
    p->button = new SpecButton();
        p->button->setColor( p->current_color );

    p->spacer = new QSpacerItem( 4 , 2 , QSizePolicy::Expanding , QSizePolicy::Minimum );
    p->check  = new QCheckBox( name );
        p->check->setChecked( true );

    p->check_widget = new QWidget();
    p->check_layout = new QHBoxLayout( p->check_widget );
        p->check_layout->addWidget( p->check );
        p->check_layout->addSpacerItem( p->spacer );
        p->check_layout->setContentsMargins( 0 , 0 , 0 , 0 );

    p->layout = new QHBoxLayout( this );
        p->layout->addWidget( p->check_widget );
        p->layout->addWidget( p->button       );
        p->layout->setContentsMargins( 0 , 0 , 0 , 0 );

    QObject::connect( p->button , SIGNAL(clicked())     , this      , SLOT(colorDialog())    );
    QObject::connect( p->check  , SIGNAL(toggled(bool)) , p->button , SLOT(setEnabled(bool)) );
    QObject::connect( p->check  , SIGNAL(toggled(bool)) , this      , SLOT(setChecked(bool)) );

    this->setCheckable( false );
}
コード例 #3
0
void sm_IPv4EditDialog::colorClicked()
{
    QColorDialog colorDialog(selectedColor);
    if (colorDialog.exec()) {
        selectedColor=colorDialog.selectedColor();
        ui->colorBox->setStyleSheet("QFrame { background-color: "+selectedColor.name()+" }");
    }
};
コード例 #4
0
ファイル: seqlenanalysis.cpp プロジェクト: eras/BitCracker
void
SeqLenAnalysis::changeColor()
{
  QColorDialog colorDialog(this);
  if (colorDialog.exec() == QDialog::Accepted) {
    m_color = colorDialog.selectedColor();
  }
}
コード例 #5
0
void ColorPropertyWidget::setProperty() {
    if (!disconnected_) {
        colorDialog();
        updateColorLabel();
        tgt::Color value = toTgtColor(currentColor_);
        property_->set(value);
        emit modified();
    }
}
コード例 #6
0
ColorButton::ColorButton (QWidget *w, QColor &c) : QPushButton (w)
{
  color = c;
  QObject::connect(this, SIGNAL(clicked()), this, SLOT(colorDialog()));
  setMaximumHeight(25);
  setToggleButton(FALSE);
  pix.resize(50, 10);
  setToggleType(SingleShot);
  readonly = FALSE;
  changed = FALSE;
}
コード例 #7
0
ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_currentWidget(0)
{
    QGridLayout *layout = new QGridLayout(this);
    layout->setMargin(0);
    layout->setContentsMargins(1, 1, 1, 1);
    layout->setSpacing(0);
    m_toolButton = new QToolButton(this);
    m_toolButton->setAutoRaise(false);

    m_toolButton->setIcon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton));
    m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
    m_toolButton->setFixedSize(16, 16);

    m_toolButton->setToolTip(tr("Hides this toolbar."));
    connect(m_toolButton, SIGNAL(clicked()), this, SLOT(onTogglePane()));
    layout->addWidget(m_toolButton, 0, 0, 1, 1);
    colorDialog();

    QWidget *fontWidget = createFontWidget();
    m_currentWidget = fontWidget;
    QWidget *imageWidget = createImageWidget();
    QWidget *borderImageWidget = createBorderImageWidget();
    QWidget *rectangleWidget = createRectangleWidget();
    QWidget *easingWidget = createEasingWidget();
    layout->addWidget(fontWidget, 0, 1, 2, 1);
    layout->addWidget(easingWidget, 0, 1, 2, 1);
    layout->addWidget(imageWidget, 0, 1, 2, 1);
    layout->addWidget(borderImageWidget, 0, 1, 2, 1);
    layout->addWidget(rectangleWidget, 0, 1, 2, 1);

    setAutoFillBackground(true);
    setContextMenuPolicy(Qt::ActionsContextMenu);

    m_resetAction = new QAction(tr("Pin Toolbar"), this);
    m_resetAction->setCheckable(true);
    addAction(m_resetAction.data());
    connect(m_resetAction.data(), SIGNAL(triggered(bool)), this, SLOT(onResetPosition(bool)));

    m_disableAction = new QAction(tr("Show Always"), this);
    addAction(m_disableAction.data());
    m_disableAction->setCheckable(true);
    connect(m_disableAction.data(), SIGNAL(toggled(bool)), this, SLOT(onDisable(bool)));
    m_pinned = false;
#ifdef Q_WS_MAC
    setCursor(Qt::ArrowCursor);
#endif
}
コード例 #8
0
void MyColorButton::mousePressEvent(QMouseEvent *event)
{
	QPushButton::mousePressEvent(event);

	Qt::MouseButton button = event->button();

	if (button == Qt::LeftButton)
	{
		QColorDialog colorDialog(this);
		sRGB colorRGB = GetColor();
		QColor color(colorRGB.R / 256, colorRGB.G / 256, colorRGB.B / 256);
		colorDialog.setCurrentColor(color);
		colorDialog.setWindowTitle(QString("Edit color: " + parameterName));
		if(colorDialog.exec() == QDialog::Accepted)
		{
			color = colorDialog.currentColor();
			colorRGB = sRGB(color.red() * 256, color.green() * 256, color.blue() * 256);
			SetColor(colorRGB);
		}
	}
}
コード例 #9
0
void SettingsDlg::on_btnHeaderTextColor_clicked()
{
    colorDialog( PROP_STATUS_FONT_COLOR, tr("Page header text color") );
}
コード例 #10
0
void SettingsDlg::on_btnBgColor_clicked()
{
    colorDialog( PROP_BACKGROUND_COLOR, tr("Background color") );
}
コード例 #11
0
void SettingsDlg::on_btnTextColor_clicked()
{
    colorDialog( PROP_FONT_COLOR, tr("Text color") );
}
コード例 #12
0
void SettingsDlg::on_btnCorrectionColor_clicked()
{
    colorDialog( PROP_HIGHLIGHT_BOOKMARK_COLOR_CORRECTION, tr("Correction bookmark color") );
}
コード例 #13
0
void SettingsDlg::on_btnCommentColor_clicked()
{
    colorDialog( PROP_HIGHLIGHT_BOOKMARK_COLOR_COMMENT, tr("Comment bookmark color") );
}
コード例 #14
0
void SettingsDlg::on_btnSelectionColor_clicked()
{
    colorDialog( PROP_HIGHLIGHT_SELECTION_COLOR, tr("Selection color") );
}
コード例 #15
0
ファイル: tupcanvas.pc.cpp プロジェクト: hpsaturn/tupi
TupCanvas::TupCanvas(QWidget *parent, Qt::WindowFlags flags, TupGraphicsScene *scene, 
                   const QPointF centerPoint, const QSize &screenSize, TupProject *project, double scaleFactor,
                   int angle, TupBrushManager *brushManager) : QFrame(parent, flags), k(new Private)
{
    setWindowTitle(tr("Tupi: 2D Magic"));
    setWindowIcon(QIcon(QPixmap(THEME_DIR + "icons/animation_mode.png")));

    k->scene = scene;
    k->size = project->dimension();
    k->currentColor = brushManager->penColor();
    k->brushManager = brushManager;
    k->project = project;

    graphicsView = new TupCanvasView(this, screenSize, k->size, project->bgColor());

    graphicsView->setScene(scene);
    graphicsView->centerOn(centerPoint);
    graphicsView->scale(scaleFactor, scaleFactor);
    graphicsView->rotate(angle);

    TImageButton *pencil = new TImageButton(QPixmap(THEME_DIR + "icons/pencil_big.png"), 40, this, true);
    pencil->setToolTip(tr("Pencil"));
    connect(pencil, SIGNAL(clicked()), this, SLOT(wakeUpPencil()));

    TImageButton *ink = new TImageButton(QPixmap(THEME_DIR + "icons/ink_big.png"), 40, this, true);
    ink->setToolTip(tr("Ink"));
    connect(ink, SIGNAL(clicked()), this, SLOT(wakeUpInk()));

    /*
    TImageButton *polyline = new TImageButton(QPixmap(THEME_DIR + "icons/polyline_big.png"), 40, this, true);
    polyline->setToolTip(tr("Polyline"));
    connect(polyline, SIGNAL(clicked()), this, SLOT(wakeUpPolyline()));
    */

    TImageButton *ellipse = new TImageButton(QPixmap(THEME_DIR + "icons/ellipse_big.png"), 40, this, true);
    ellipse->setToolTip(tr("Ellipse"));
    connect(ellipse, SIGNAL(clicked()), this, SLOT(wakeUpEllipse()));

    TImageButton *rectangle = new TImageButton(QPixmap(THEME_DIR + "icons/square_big.png"), 40, this, true);
    rectangle->setToolTip(tr("Rectangle"));
    connect(rectangle, SIGNAL(clicked()), this, SLOT(wakeUpRectangle()));

    TImageButton *images = new TImageButton(QPixmap(THEME_DIR + "icons/bitmap_big.png"), 40, this, true);
    images->setToolTip(tr("Images"));
    connect(images, SIGNAL(clicked()), this, SLOT(wakeUpLibrary()));

    TImageButton *objects = new TImageButton(QPixmap(THEME_DIR + "icons/selection_big.png"), 40, this, true);
    objects->setToolTip(tr("Object Selection"));
    connect(objects, SIGNAL(clicked()), this, SLOT(wakeUpObjectSelection()));

    TImageButton *nodes = new TImageButton(QPixmap(THEME_DIR + "icons/nodes_big.png"), 40, this, true);
    nodes->setToolTip(tr("Line Selection"));
    connect(nodes, SIGNAL(clicked()), this, SLOT(wakeUpNodeSelection()));

    TImageButton *trash = new TImageButton(QPixmap(THEME_DIR + "icons/delete_big.png"), 40, this, true);
    trash->setToolTip(tr("Delete Selection"));
    connect(trash, SIGNAL(clicked()), this, SLOT(wakeUpDeleteSelection()));

    TImageButton *zoomIn = new TImageButton(QPixmap(THEME_DIR + "icons/zoom_in_big.png"), 40, this, true);
    zoomIn->setToolTip(tr("Zoom In"));
    connect(zoomIn, SIGNAL(clicked()), this, SLOT(wakeUpZoomIn()));

    TImageButton *zoomOut = new TImageButton(QPixmap(THEME_DIR + "icons/zoom_out_big.png"), 40, this, true);
    zoomOut->setToolTip(tr("Zoom Out"));
    connect(zoomOut, SIGNAL(clicked()), this, SLOT(wakeUpZoomOut()));

    TImageButton *hand = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 40, this, true);
    hand->setToolTip(tr("Hand"));
    connect(hand, SIGNAL(clicked()), this, SLOT(wakeUpHand()));

    TImageButton *undo = new TImageButton(QPixmap(THEME_DIR + "icons/undo_big.png"), 40, this, true);
    undo->setToolTip(tr("Undo"));
    connect(undo, SIGNAL(clicked()), this, SLOT(undo()));

    TImageButton *redo = new TImageButton(QPixmap(THEME_DIR + "icons/redo_big.png"), 40, this, true);
    redo->setToolTip(tr("Redo"));
    connect(redo, SIGNAL(clicked()), this, SLOT(redo()));

    TImageButton *colors = new TImageButton(QPixmap(THEME_DIR + "icons/color_palette_big.png"), 40, this, true);
    colors->setToolTip(tr("Color Palette"));
    connect(colors, SIGNAL(clicked()), this, SLOT(colorDialog()));

    TImageButton *pen = new TImageButton(QPixmap(THEME_DIR + "icons/pen_properties.png"), 40, this, true);
    pen->setToolTip(tr("Pen Size"));
    connect(pen, SIGNAL(clicked()), this, SLOT(penDialog()));

    TImageButton *exposure = new TImageButton(QPixmap(THEME_DIR + "icons/exposure_sheet_big.png"), 40, this, true);
    exposure->setToolTip(tr("Exposure Sheet"));
    connect(exposure, SIGNAL(clicked()), this, SLOT(exposureDialog()));

    QBoxLayout *controls = new QBoxLayout(QBoxLayout::TopToBottom);
    controls->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
    controls->setContentsMargins(3, 3, 3, 3);
    controls->setSpacing(7);

    controls->addWidget(pencil);
    controls->addWidget(ink);
    // controls->addWidget(polyline);
    controls->addWidget(ellipse);
    controls->addWidget(rectangle);
    controls->addWidget(images);
    controls->addWidget(objects);
    controls->addWidget(nodes);
    controls->addWidget(trash);
    controls->addWidget(zoomIn);
    controls->addWidget(zoomOut);
    controls->addWidget(hand);

    controls->addWidget(undo);
    controls->addWidget(redo);
    controls->addWidget(colors);
    controls->addWidget(pen);
    controls->addWidget(exposure);

    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(2);
    layout->addLayout(controls);
    layout->addWidget(graphicsView);

    setLayout(layout);
}
コード例 #16
0
void AppearanceDialog::on_buttonColor_clicked()
{
    QColorDialog colorDialog(QColor(ui->editColor->text()), this);
    if(colorDialog.exec() == QDialog::Accepted)
        ui->editColor->setText(colorDialog.selectedColor().name().toUpper());
}