void Setup_Colors::action(const gcn::ActionEvent &event) { if (event.getId() == "slider_grad") updateGradType(); else if (event.getId() == "slider_graddelay") mGradDelayText->setText(toString(std::floor(mGradDelaySlider->getValue()))); else if (event.getId() == "slider_red") mRedText->setText(toString(std::floor(mRedSlider->getValue()))); else if (event.getId() == "slider_green") mGreenText->setText(toString(std::floor(mGreenSlider->getValue()))); else if (event.getId() == "slider_blue") mBlueText->setText(toString(std::floor(mBlueSlider->getValue()))); else return; updateColor(); }
void KisColorSelector::mouseReleaseEvent(QMouseEvent* e) { e->setAccepted(false); KisColorSelectorBase::mousePressEvent(e); if(!e->isAccepted() && !(m_lastRealColor == m_currentRealColor)) { m_lastRealColor = m_currentRealColor; m_lastColorRole = Acs::buttonToRole(e->button()); updateColor(m_lastRealColor, m_lastColorRole, false); e->accept(); } m_grabbingComponent=0; }
int Window::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: saveSvg(); break; case 1: updateBackground((*reinterpret_cast< int(*)>(_a[1]))); break; case 2: updateColor(); break; case 3: updateShape((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } _id -= 4; } return _id; }
void ProtectedNode::updateDisplayedColor(const Color3B& parentColor) { _displayedColor.r = _realColor.r * parentColor.r/255.0; _displayedColor.g = _realColor.g * parentColor.g/255.0; _displayedColor.b = _realColor.b * parentColor.b/255.0; updateColor(); if (_cascadeColorEnabled) { for(const auto &child : _children){ child->updateDisplayedColor(_displayedColor); } } for(const auto &child : _protectedChildren){ child->updateDisplayedColor(_displayedColor); } }
//-------------------------------------------------------------------------- // Advance time //-------------------------------------------------------------------------- void Splash::advanceTime(F32 dt) { if (dt == 0.0) return; mElapsedTime += dt; updateColor(); updateWave( dt ); updateEmitters( dt ); updateRings( dt ); if( !mDead ) { emitRings( dt ); } }
void ProtectedNode::updateDisplayedOpacity(GLubyte parentOpacity) { _displayedOpacity = _realOpacity * parentOpacity/255.0; updateColor(); if (_cascadeOpacityEnabled) { for(auto child : _children){ child->setCascadeOpacityEnabled(_cascadeOpacityEnabled); child->updateDisplayedOpacity(_displayedOpacity); } } for(auto child : _protectedChildren){ child->setCascadeOpacityEnabled(_cascadeOpacityEnabled); child->updateDisplayedOpacity(_displayedOpacity); } }
void PretzelColorPicker::redrawBox() { { gl::ScopedGlslProg scS( mBoxShader ); gl::ScopedViewport scVp( mBoxFbo->getSize() ); gl::setMatricesWindow( mBoxFbo->getSize() ); gl::ScopedFramebuffer scF( mBoxFbo ); mBoxShader->uniform( "uPickedCol", mHueCol ); gl::clear( ColorA(1,1,1,0) ); gl::drawSolidRect( mBoxFbo->getBounds() ); } updateColor(); gl::setMatricesWindow( getWindowSize() ); }
Private(const QUrl& url, URLLabel* label) : URL(url), Underline(true), LinkColor(qApp->palette().link().color()), HighlightedLinkColor(Qt::red), Tip(url.toString()), Cursor(0L), UseTips(false), UseCursor(false), Glow(true), Float(false), RealUnderline(true), Timer(new QTimer(label)) { connect( Timer, SIGNAL( timeout() ), label, SLOT( updateColor() ) ); connect( label, SIGNAL( leftClickedURL( const QUrl& ) ), label, SLOT( openURL( const QUrl& ) ) ); }
void Scale9Sprite::updateDisplayedOpacity(GLubyte parentOpacity) { _displayedOpacity = _realOpacity * parentOpacity/255.0; updateColor(); if (_scale9Image) { _scale9Image->updateDisplayedOpacity(_displayedOpacity); } if (_cascadeOpacityEnabled) { for(auto child : _children) { child->updateDisplayedOpacity(_displayedOpacity); } } }
void SpreadSheet::selectColor() { QTableWidgetItem *item = table->currentItem(); QColor col = item ? item->backgroundColor() : table->palette().base().color(); col = QColorDialog::getColor(col, this); if (!col.isValid()) return; QList<QTableWidgetItem*> selected = table->selectedItems(); if (selected.count() == 0) return; foreach(QTableWidgetItem *i, selected) if (i) i->setBackgroundColor(col); updateColor(table->currentItem()); }
void JunctionElementItem::init() { // Selection/Highlighting // // setAcceptHoverEvents(true); if (getParentJunctionComponentItem()) { setFlag(QGraphicsItem::ItemIsMovable, false); // move the whole group } else { setFlag(QGraphicsItem::ItemIsMovable, true); } // Color & Path // // updateColor(); createPath(); // ContextMenu // // QAction *hideAction = getHideMenu()->addAction(tr("Track")); connect(hideAction, SIGNAL(triggered()), this, SLOT(hideGraphElement())); if (getParentJunctionComponentItem()) { QAction *hideParentTrackComponentAction = getHideMenu()->addAction(tr("Group")); connect(hideParentTrackComponentAction, SIGNAL(triggered()), this, SLOT(hideParentTrackComponent())); QAction *ungroupAction = getContextMenu()->addAction("Ungroup"); connect(ungroupAction, SIGNAL(triggered()), getParentJunctionComponentItem(), SLOT(ungroupComposite())); } QAction *hideRoadAction = getHideMenu()->addAction(tr("Road")); connect(hideRoadAction, SIGNAL(triggered()), this, SLOT(hideParentRoad())); QAction *removeSectionAction = getRemoveMenu()->addAction(tr("Track(s)")); connect(removeSectionAction, SIGNAL(triggered()), this, SLOT(removeSection())); QAction *removeRoadAction = getRemoveMenu()->addAction(tr("Road")); connect(removeRoadAction, SIGNAL(triggered()), this, SLOT(removeParentRoad())); }
SpreadSheet::SpreadSheet(int rows, int cols, QWidget *parent) : QMainWindow(parent) { addToolBar(toolBar = new QToolBar()); formulaInput = new QLineEdit(); cellLabel = new QLabel(toolBar); cellLabel->setMinimumSize(80, 0); toolBar->addWidget(cellLabel); toolBar->addWidget(formulaInput); table = new QTableWidget(rows, cols, this); table->setSizeAdjustPolicy(QTableWidget::AdjustToContents); for (int c = 0; c < cols; ++c) { QString character(QChar('A' + c)); table->setHorizontalHeaderItem(c, new QTableWidgetItem(character)); } table->setItemPrototype(table->item(rows - 1, cols - 1)); table->setItemDelegate(new SpreadSheetDelegate()); createActions(); updateColor(0); setupMenuBar(); setupContents(); setupContextMenu(); setCentralWidget(table); statusBar(); connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(updateStatus(QTableWidgetItem*))); connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(updateColor(QTableWidgetItem*))); connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(updateLineEdit(QTableWidgetItem*))); connect(table, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateStatus(QTableWidgetItem*))); connect(formulaInput, SIGNAL(returnPressed()), this, SLOT(returnPressed())); connect(table, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateLineEdit(QTableWidgetItem*))); setWindowTitle(tr("Spreadsheet")); }
/* virtual */ void av::osg::TexturedQuad::evaluateLocalSideEffect() { Geometry::evaluateLocalSideEffect(); if(mGeometryChanged) { updateGeometry(); mGeometryChanged = false; } if(mColorChanged) { updateColor(); mColorChanged = false; } if(mFilenameChanged && UseFilename.getValue()) { updateTexture(); mFilenameChanged = false; } if(mTextureChanged1D && !UseFilename.getValue()) { getOsgGeometry()->getOrCreateStateSet()->setTextureAttributeAndModes(0, Texture1D.getValue()->getOsgTexture1D(), ::osg::StateAttribute::ON); mTextureChanged1D = false; } if(mTextureChanged2D && !UseFilename.getValue()) { getOsgGeometry()->getOrCreateStateSet()->setTextureAttributeAndModes(0, Texture2D.getValue()->getOsgTexture2D(), ::osg::StateAttribute::ON); mTextureChanged2D = false; } if(mTexCoordsChanged) { (*mTexCoords)[0] = TexCoord01.getValue(); (*mTexCoords)[1] = TexCoord00.getValue(); (*mTexCoords)[2] = TexCoord10.getValue(); (*mTexCoords)[3] = TexCoord11.getValue(); getOsgGeometry()->setTexCoordArray(0, mTexCoords.get()); mTexCoordsChanged = false; } }
QgsBullsEyeWidget::QgsBullsEyeWidget( QgsMapCanvas *canvas, QgsLayerTreeView* layerTreeView ) : QgsBottomBar( canvas ), mLayerTreeView( layerTreeView ) { setLayout( new QHBoxLayout ); layout()->setSpacing( 10 ); QWidget* base = new QWidget(); ui.setupUi( base ); layout()->addWidget( base ); QPushButton* closeButton = new QPushButton(); closeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); closeButton->setIcon( QIcon( ":/images/themes/default/mIconClose.png" ) ); closeButton->setToolTip( tr( "Close" ) ); connect( closeButton, SIGNAL( clicked( bool ) ), this, SIGNAL( close() ) ); layout()->addWidget( closeButton ); layout()->setAlignment( closeButton, Qt::AlignTop ); ui.comboBoxLabels->addItem( tr( "Disabled" ), static_cast<int>( QgsBullsEyeLayer::NO_LABELS ) ); ui.comboBoxLabels->addItem( tr( "Axes" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES ) ); ui.comboBoxLabels->addItem( tr( "Rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_RINGS ) ); ui.comboBoxLabels->addItem( tr( "Axes and rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES_RINGS ) ); connect( ui.toolButtonAddLayer, SIGNAL( clicked( bool ) ), this, SLOT( createLayer() ) ); connect( ui.inputCenter, SIGNAL( coordinateChanged() ), this, SLOT( updateLayer() ) ); connect( ui.toolButtonPickCenter, SIGNAL( clicked( bool ) ), this, SIGNAL( requestPickCenter() ) ); connect( ui.spinBoxRings, SIGNAL( valueChanged( int ) ), this, SLOT( updateLayer() ) ); connect( ui.spinBoxRingInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) ); connect( ui.spinBoxAxesInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) ); connect( ui.toolButtonColor, SIGNAL( colorChanged( QColor ) ), this, SLOT( updateColor( QColor ) ) ); connect( ui.spinBoxFontSize, SIGNAL( valueChanged( int ) ), this, SLOT( updateFontSize( int ) ) ); connect( ui.comboBoxLabels, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateLabeling( int ) ) ); connect( ui.spinBoxLineWidth, SIGNAL( valueChanged( int ) ), this, SLOT( updateLineWidth( int ) ) ); connect( QgsMapLayerRegistry::instance(), SIGNAL( layersAdded( QList<QgsMapLayer*> ) ), this, SLOT( repopulateLayers() ) ); connect( QgsMapLayerRegistry::instance(), SIGNAL( layersRemoved( QStringList ) ), this, SLOT( repopulateLayers() ) ); connect( mCanvas, SIGNAL( currentLayerChanged( QgsMapLayer* ) ), this, SLOT( updateSelectedLayer( QgsMapLayer* ) ) ); repopulateLayers(); connect( ui.comboBoxLayer, SIGNAL( currentIndexChanged( int ) ), this, SLOT( currentLayerChanged( int ) ) ); }
//----------------------------------------------------------------------------- void ChannelSelectionDialog::on_channel_table__cellClicked (int row, int column) { QTableWidgetItem* item = ui_.channel_table_->item (row, column); if (column == LABEL_INDEX_) { self_setting_ = true; if (item->checkState() == Qt::Checked) item->setCheckState (Qt::Unchecked); else item->setCheckState (Qt::Checked); } else if (column == COLOR_INDEX_) { QColorDialog color_dialog (item->backgroundColor (), this); if (color_dialog.exec () == QDialog::Accepted) updateColor (row, color_dialog.selectedColor ()); } self_setting_ = false; }
void PretzelColorPicker::mouseDragged(const ci::vec2 &pos){ if( bDragging ){ vec2 localPos = pos - mOffset; vec2 n; n.x = ci::math<float>::clamp( (localPos.x - mColorSwatchRect.x1) / mColorSwatchRect.getWidth(), 0.0, 1.0); n.y = ci::math<float>::clamp( (localPos.y - mColorSwatchRect.y1) / mColorSwatchRect.getHeight(), 0.0, 1.0); mCrosshairPos = n; updateColor(); }else if( bDraggingHue ){ vec2 localPos = pos - mOffset; mHueNorm = lmap( localPos.y, mHueStripRect.y1, mHueStripRect.y2, 0.0f, 1.0f); mHueNorm = ci::math<float>::clamp(mHueNorm); ColorA cc = mHueSurf.getPixel( vec2(1, mHueNorm * mHueSurf.getHeight()) ); mHueCol = cc; redrawBox(); } }
void SuperelevationSectionPolynomialItem::updateObserver() { // Parent // // GraphElement::updateObserver(); if (isInGarbage()) { return; // will be deleted anyway } // SuperelevationSection // // int superelevationChanges = superelevationSection_->getSuperelevationSectionChanges(); if (superelevationChanges & SuperelevationSection::CSE_ParameterChange) { createPath(); updateColor(); } }
void Scale9Sprite::updateDisplayedColor(const cocos2d::Color3B &parentColor) { _displayedColor.r = _realColor.r * parentColor.r/255.0; _displayedColor.g = _realColor.g * parentColor.g/255.0; _displayedColor.b = _realColor.b * parentColor.b/255.0; updateColor(); if (_scale9Image) { _scale9Image->updateDisplayedColor(_displayedColor); } if (_cascadeColorEnabled) { for(const auto &child : _children) { child->updateDisplayedColor(_displayedColor); } } }
ColorIndicatorLabel::ColorIndicatorLabel(QWidget *parent) : QLabel(parent) { if(parent->window()) connect(parent->window(), SIGNAL(invertChanged(bool)), this, SLOT(setInverted(bool))); m = Other; dv = 0; e = 1; v = 0; r = 0; g = 0; b = 0; inverted = false; upColor = Qt::darkGreen; downColor = Qt::darkRed; updateTimer.setInterval(33); connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateColor())); }
void updateFinal(vector<vector<item> > *matriz, vector<formiga> *formigas, int qtdFormigas, int tamMatrizI, int tamMatrizJ, sf::RenderWindow *window, std::vector<std::vector<sf::RectangleShape> > *grid, normalDim normalDim) { for (int i = 0; i < qtdFormigas; i++) { while (formigas->at(i).item.classe != 0) { //cout << "formig" << formigas->at(i).item.classe << endl; //cout << "map" << matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe << endl; motionAnt(matriz, &formigas->at(i), tamMatrizI, tamMatrizJ, normalDim); } if (matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe == 6) { matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number1 = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number2 = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number3 = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number4 = 0; } if (matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe == 7) { matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe = matriz->at(formigas->at(i).i).at( formigas->at(i).j).classePast; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number1 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number1Past; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number2 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number2Past; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number3 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number3Past; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number4 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number4Past; } } updateColor(matriz, tamMatrizI, tamMatrizJ, grid); for (int i = 0; i < tamMatrizI; i++) for (int j = 0; j < tamMatrizJ; j++) window->draw(grid->at(i).at(j)); window->display(); getchar(); }
int main() { void updateColor(); Display *d = XOpenDisplay( NULL ); Window w = RootWindow(d, DefaultScreen(d)); void parseField(); int ix; for(ix = 0; ix < 110; ix++){ //main loop int j; //index convention (0-63) printf("Loop %d/110. Colours updated:\n\n", ix); for(j = 63; j >= 0; j--){ //update from below to increase accuracy updateColor(j, d, w, tlx + dx*(j % 8), tly + dy*(j / 8), dx, dy); printf("%d:%x ", j + 1, colArr[j]); if(j % 8 == 0){printf("\n");} } parseField(); system("sleep 0.6"); } return 0; }
void createScrollBars(HWND hwnd){ //TextBoxThicknes thicknesBox = new TextBox("",hwnd,new Dimensions(270,49,30,30)); //Eraser Scroll eraserScrollBar = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,50,255,20),hwnd,hInstance); eraserScrollBar->setRange(0,255); eraserScrollBar->setThumbPosition(rand() % 100 +1); //Colors Scrolls colorScrollbarR = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,80,255,20),hwnd,hInstance); colorScrollbarR->setRange(0,255); colorScrollbarR->setThumbPosition(rand() % 100 +1); colorScrollbarG = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,100,255,20),hwnd,hInstance); colorScrollbarG->setRange(0,255); colorScrollbarG->setThumbPosition(rand() % 100 +1); colorScrollbarB = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,120,255,20),hwnd,hInstance); colorScrollbarB->setRange(0,255); colorScrollbarB->setThumbPosition(rand() % 100 +1); updateColor(hwnd); }
//-------------------------------------------------------------- void AudioPlayer::update(){ // update the sound playing system: ofSoundUpdate(); // (5) grab the fft, and put in into a "smoothed" array, // by taking maximums, as peaks and then smoothing downward float * val = ofSoundGetSpectrum(nBandsToGet); // request 128 values for fft for (int i = 0;i < nBandsToGet; i++){ // let the smoothed calue sink to zero: fftSmoothed[i] *= 0.96f; // take the max, either the smoothed or the incoming: if (fftSmoothed[i] < val[i]) fftSmoothed[i] = val[i]; } updateColor(BG_R_, BG_G_, BG_B_); float BG_R = BG_R_; float BG_G = BG_G_; float BG_B = BG_B_; amplifyColor(BG_R, BG_G, BG_B); ofBackground(BG_R,BG_G,BG_B); }
void CGradientView::setCompressedInterpolation(bool bCompressedInterpolation) { m_bCompressedInterpolation = bCompressedInterpolation; updateColor(); }
void CGradientView::setVector(const CCPoint& tPoint) { m_tAlongVector = tPoint; updateColor(); }
void CGradientView::setEndOpacity(GLubyte cOpacity) { m_cEndOpacity = cOpacity; updateColor(); }
void CGradientView::setStartOpacity(GLubyte cOpacity) { m_cStartOpacity = cOpacity; updateColor(); }
void CGradientView::setEndColor(const ccColor3B& tColor) { m_tEndColor = tColor; updateColor(); }
void Label::alignText() { if (_fontAtlas == nullptr || _currentUTF16String.empty()) { setContentSize(Size::ZERO); return; } _fontAtlas->prepareLetterDefinitions(_currentUTF16String); auto& textures = _fontAtlas->getTextures(); if (textures.size() > _batchNodes.size()) { for (auto index = _batchNodes.size(); index < textures.size(); ++index) { auto batchNode = SpriteBatchNode::createWithTexture(textures.at(index)); batchNode->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); batchNode->setPosition(Vec2::ZERO); Node::addChild(batchNode,0,Node::INVALID_TAG); _batchNodes.push_back(batchNode); } } LabelTextFormatter::createStringSprites(this); if(_maxLineWidth > 0 && _contentSize.width > _maxLineWidth && LabelTextFormatter::multilineText(this) ) LabelTextFormatter::createStringSprites(this); if(_labelWidth > 0 || (_currNumLines > 1 && _hAlignment != TextHAlignment::LEFT)) LabelTextFormatter::alignText(this); if (!_children.empty()) { int strLen = static_cast<int>(_currentUTF16String.length()); Rect uvRect; Sprite* letterSprite; for (auto index = 0; index < _children.size();) { auto child = _children.at(index); int tag = child->getTag(); if (tag >= strLen) { child->removeFromParentAndCleanup(true); } else if (tag >= 0) { letterSprite = dynamic_cast<Sprite*>(child); if (letterSprite) { auto& letterDef = _lettersInfo[tag].def; uvRect.size.height = letterDef.height; uvRect.size.width = letterDef.width; uvRect.origin.x = letterDef.U; uvRect.origin.y = letterDef.V; letterSprite->setBatchNode(_batchNodes[letterDef.textureID]); letterSprite->setTextureRect(uvRect, false, uvRect.size); letterSprite->setPosition(_lettersInfo[tag].position.x + letterDef.width/2, _lettersInfo[tag].position.y - letterDef.height/2); } ++index; } else { ++index; } } } for (const auto& batchNode : _batchNodes) { batchNode->getTextureAtlas()->removeAllQuads(); } updateQuads(); updateColor(); }
void LayerGradient::setCompressedInterpolation(bool compress) { _compressedInterpolation = compress; updateColor(); }