//! Reads attributes of the element void CGUIProgressBar::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) { IGUIProgressBar::deserializeAttributes(in,options); Horizontal = in->getAttributeAsBool("Horizontal"); setMax(in->getAttributeAsInt("Max")); setPos(in->getAttributeAsInt("Value")); setBackground(in->getAttributeAsColor("Background")); setForeground(in->getAttributeAsColor("Foreground")); }
caNumeric::caNumeric(QWidget *parent) : ENumeric(parent) { setAccessW(true); setPrecisionMode(Channel); setLimitsMode(Channel); thisMaximum = 100000.0; thisMinimum = -100000.0; setDigitsFontScaleEnabled(true); setForeground(Qt::black); setBackground(QColor(230,230,230)); }
void EasyTreeWidgetItem::colorize(bool _colorize) { if (_colorize) { for (int i = 0; i < COL_COLUMNS_NUMBER; ++i) { setBackground(i, QColor::fromRgb(m_customBGColor)); setForeground(i, QColor::fromRgb(m_customTextColor)); } } else { const QBrush nobrush; for (int i = 0; i < COL_COLUMNS_NUMBER; ++i) { setBackground(i, nobrush); setForeground(i, nobrush); } } }
void BsonTreeItem::setupDocument(MongoDocumentPtr document) { setText(0, buildObjectFieldName()); setIcon(0, GuiRegistry::instance().bsonObjectIcon()); setText(2, "Object"); setForeground(2, GuiRegistry::instance().typeBrush()); setExpanded(true); setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator); }
void setLink(int column, bool enable = true) { ChannelListWidget *tw = static_cast<ChannelListWidget *>(treeWidget()); m_link[column] = enable; if (!enable) { setFont(column, QFont()); if (!m_channel->isPlayable()) setForeground(column, QBrush(tw->style()->standardPalette() .color(QPalette::Disabled, QPalette::WindowText))); else setForeground(column, QBrush()); return; } QFont f(font(column)); f.setUnderline(tw->linkUnderline()); f.setBold(tw->linkBold()); setFont(column, f); if (tw->linkColor().isValid()) setForeground(column, QBrush(tw->linkColor())); }
MsgTextEdit::MsgTextEdit(MsgEdit *edit, QWidget *parent) : TextEdit(parent) { m_edit = edit; setBackground(CorePlugin::m_plugin->getEditBackground()); setForeground(CorePlugin::m_plugin->getEditForeground(), true); #if defined(USE_KDE) #if KDE_IS_VERSION(3,2,0) setCheckSpellingEnabled(CorePlugin::m_plugin->getEnableSpell()); #endif #endif }
bool ccPolyline::initWith(ccPointCloud*& vertices, const ccPolyline& poly) { bool success = true; if (!vertices) { ccPointCloud* cloud = dynamic_cast<ccPointCloud*>(poly.m_theAssociatedCloud); ccPointCloud* clone = cloud ? cloud->partialClone(&poly) : ccPointCloud::From(&poly); if (clone) { if (cloud) clone->setName(cloud->getName()); //as 'partialClone' adds the '.extract' suffix by default else clone->setGLTransformationHistory(poly.getGLTransformationHistory()); } else { //not enough memory? ccLog::Warning("[ccPolyline::initWith] Not enough memory to duplicate vertices!"); success = false; } vertices = clone; } if (vertices) { setAssociatedCloud(vertices); addChild(vertices); //vertices->setEnabled(false); assert(m_theAssociatedCloud); if (m_theAssociatedCloud) addPointIndex(0,m_theAssociatedCloud->size()); } setClosed(poly.m_isClosed); set2DMode(poly.m_mode2D); setForeground(poly.m_foreground); setVisible(poly.isVisible()); lockVisibility(poly.isVisiblityLocked()); setColor(poly.m_rgbColor); setWidth(poly.m_width); showColors(poly.colorsShown()); showVertices(poly.verticesShown()); setVertexMarkerWidth(poly.getVertexMarkerWidth()); setVisible(poly.isVisible()); showArrow(m_showArrow,m_arrowIndex,m_arrowLength); setGlobalScale(poly.getGlobalScale()); setGlobalShift(poly.getGlobalShift()); setGLTransformationHistory(poly.getGLTransformationHistory()); setMetaData(poly.metaData()); return success; }
void TextEdit::drawCursor(int cx, int cy, bool on, bool createGC /* = false */) { bool cursorOn = on; if (!focusIn || inputDisabled) cursorOn = false; if (cx < windowX || cy < windowY || cx >= windowX + windowWidth || cy >= windowY + windowHeight) return; // Cursor outside of window GC savedGC; if (createGC) { // Save the previous graphic contex, create a temporary GC savedGC = m_GC; m_GC = XCreateGC(m_Display, m_Window, 0, 0); setFont(textFont); } if (cursorOn) setForeground(fgColor); else setForeground(bgColor); int x = leftMargin + (cx - windowX) * dx; int y = topMargin + (cy - windowY) * dy; fillRectangle(I2Rectangle(x, y, dx, ascent + descent)); if (cursorOn) setForeground(bgColor); else setForeground(fgColor); if (cy <= text.size()) { TextLine* line; if (cy == text.size()) { line = &(endOfText); } else { line = &(text.getLine(cy)); } if (cx < line->length()) { drawString(x, y + ascent, line->getString() + cx, 1); } } if (createGC) { // Release the temporary graphic contex, restore the previous GC XFreeGC(m_Display, m_GC); m_GC = savedGC; } }
caApplyNumeric::caApplyNumeric(QWidget *parent) : EApplyNumeric(parent) { setAccessW(true); setPrecisionMode(Channel); setLimitsMode(Channel); thisMaximum = 100000.0; thisMinimum = -100000.0; setDigitsFontScaleEnabled(true); setForeground(Qt::black); setBackground(QColor(230,230,230)); thisFixedFormat = false; installEventFilter(this); }
ccPolyline::ccPolyline(GenericIndexedCloudPersist* associatedCloud) : Polyline(associatedCloud) , ccHObject("Polyline") { set2DMode(false); setForeground(true); setVisible(true); lockVisibility(false); setColor(ccColor::white); showVertices(false); setVertexMarkerWidth(3); setWidth(0); }
void TextEdit::drawStatusLine(bool createGC /* = false */) { GC savedGC; if (createGC) { // Save the previous graphic contex, create a temporary GC savedGC = m_GC; m_GC = XCreateGC(m_Display, m_Window, 0, 0); setFont(textFont); } setForeground(bgStatusLineColor); fillRectangle( I2Rectangle(0, 0, m_IWinRect.width(), dy + statusLineMargin) ); setForeground(fgStatusLineColor); char statusLine[256]; int x = leftMargin; int y = statusLineMargin + ascent; sprintf(statusLine, "col=%d", cursorX+1); drawString(x, y, statusLine); sprintf(statusLine, "row=%d", cursorY+1); drawString(x + 8*dx, y, statusLine); if (textChanged) drawString(x + 19*dx, y, "Modified"); else if (textSaved) drawString(x + 19*dx, y, "Saved"); drawString(m_IWinRect.width() - 15*dx, y, "Ctrl+Q to quit"); if (createGC) { // Release the temporary graphic contex, restore the previous GC XFreeGC(m_Display, m_GC); m_GC = savedGC; } }
void RegisterColumn::RefreshValue() { QBrush brush = QPalette().brush(QPalette::Text); if (m_value != m_get_register()) { m_value = m_get_register(); brush.setColor(Qt::red); } setForeground(brush); Update(); }
ccPolyline::ccPolyline(const ccPolyline& poly) : Polyline(ccPointCloud::From(poly.getAssociatedCloud())) , ccHObject("Polyline") { assert(m_theAssociatedCloud); if (m_theAssociatedCloud) addPointIndex(0,m_theAssociatedCloud->size()); setClosingState(poly.m_isClosed); set2DMode(poly.m_mode2D); setForeground(poly.m_foreground); setVisible(poly.isVisible()); lockVisibility(poly.isVisiblityLocked()); setColor(poly.m_rgbColor); }
void ColorListEditorWidget::AddColor (const QColor& color) { QPixmap px (32, 32); QPainter p (&px); p.fillRect (px.rect (), color); p.end (); auto item = new QStandardItem; item->setText (color.name ()); item->setIcon (px); item->setForeground (color); item->setData (color, ColorListRoles::Color); Model_->appendRow (item); }
void TextEdit::slotColorChanged(const QColor &c) { if (c == curFG) return; int parag; int index; getCursorPosition(¶g, &index); if (QTextEdit::text(parag).isEmpty()){ setColor(curFG); return; } if (c != curFG) setForeground(c, false); }
int caNumeric::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = ENumeric::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = getPV(); break; case 1: *reinterpret_cast< QColor*>(_v) = getForeground(); break; case 2: *reinterpret_cast< QColor*>(_v) = getBackground(); break; case 3: *reinterpret_cast< SourceMode*>(_v) = getPrecisionMode(); break; case 4: *reinterpret_cast< bool*>(_v) = getFixedFormat(); break; case 5: *reinterpret_cast< SourceMode*>(_v) = getLimitsMode(); break; case 6: *reinterpret_cast< double*>(_v) = getMaxValue(); break; case 7: *reinterpret_cast< double*>(_v) = getMinValue(); break; } _id -= 8; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setPV(*reinterpret_cast< QString*>(_v)); break; case 1: setForeground(*reinterpret_cast< QColor*>(_v)); break; case 2: setBackground(*reinterpret_cast< QColor*>(_v)); break; case 3: setPrecisionMode(*reinterpret_cast< SourceMode*>(_v)); break; case 4: setFixedFormat(*reinterpret_cast< bool*>(_v)); break; case 5: setLimitsMode(*reinterpret_cast< SourceMode*>(_v)); break; case 6: setMaxValue(*reinterpret_cast< double*>(_v)); break; case 7: setMinValue(*reinterpret_cast< double*>(_v)); break; } _id -= 8; } else if (_c == QMetaObject::ResetProperty) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 8; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 8; } #endif // QT_NO_PROPERTIES return _id; }
void CTFTSerial::setErrorInt(const char* text) { assert(text != NULL); // Clear the screen clearScreen(); setFontSize(FONT_MEDIUM); // Draw MMDVM logo displayBitmap(0U, 0U, "MMDVM_sm.bmp"); setForeground(COLOUR_RED); gotoPosPixel(18U, 55U); displayText(text); gotoPosPixel(18U, 90U); displayText("ERROR"); setForeground(COLOUR_BLACK); m_mode = MODE_ERROR; }
void DesktopWindow::updateFromSettings(Settings& settings) { setDesktopFolder(); setWallpaperFile(settings.wallpaper()); setWallpaperMode(settings.wallpaperMode()); setFont(settings.desktopFont()); setIconSize(Fm::FolderView::IconMode, QSize(settings.desktopIconSize(), settings.desktopIconSize())); setMargins(settings.desktopCellMargins()); // setIconSize and setMargins may trigger relayout of items by QListView, so we need to do the layout again. queueRelayout(); setForeground(settings.desktopFgColor()); setBackground(settings.desktopBgColor()); setShadow(settings.desktopShadowColor()); showWmMenu_ = settings.showWmMenu(); updateWallpaper(); update(); }
void VarUnit::buildVarTree(QTreeWidgetItem* p, TVar* var, bool showHidden) { QList<QTreeWidgetItem*> cList; QListIterator<TVar*> it(var->getChildren(true)); while (it.hasNext()) { TVar* child = it.next(); if (showHidden || !isHidden(child)) { QStringList s1; s1 << child->getName(); auto pItem = new QTreeWidgetItem(s1); pItem->setText(0, child->getName()); pItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsTristate | Qt::ItemIsUserCheckable); pItem->setToolTip(0, "Checked variables will be saved and loaded with your profile."); pItem->setCheckState(0, Qt::Unchecked); if (isSaved(child)) { pItem->setCheckState(0, Qt::Checked); } if (!shouldSave(child)) { // 6 is lua_tfunction, parent must be saveable as well if not global pItem->setFlags(pItem->flags() & ~(Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable)); pItem->setForeground(0, QBrush(QColor("grey"))); pItem->setToolTip(0, ""); } pItem->setData(0, Qt::UserRole, child->getValueType()); QIcon icon; switch (child->getValueType()) { case 5: icon.addPixmap(QPixmap(QStringLiteral(":/icons/table.png")), QIcon::Normal, QIcon::Off); break; case 6: icon.addPixmap(QPixmap(QStringLiteral(":/icons/function.png")), QIcon::Normal, QIcon::Off); break; default: icon.addPixmap(QPixmap(QStringLiteral(":/icons/variable.png")), QIcon::Normal, QIcon::Off); break; } pItem->setIcon(0, icon); wVars.insert(pItem, child); cList.append(pItem); if (child->getValueType() == 5) { buildVarTree((QTreeWidgetItem*)pItem, child, showHidden); } } } p->addChildren(cList); }
caNumeric::caNumeric(QWidget *parent) : ENumeric(parent) { setStyleSheet(""); setAccessW(true); setPrecisionMode(Channel); setLimitsMode(Channel); setMaxValue(100000.0); setMinValue(-100000.0); thisFixedFormat = false; thisColorMode = Static; setDigitsFontScaleEnabled(true); setForeground(Qt::black); renewStyleSheet = true; setBackground(QColor(230,230,230)); setElevation(on_top); }
tft_t::tft_t(void) { setX(0); setY(0); d.tfa = 0; d.bfa = 0; d.vsp = SIZE_H; setTopMask(0); setBottomMask(0); setTransform(false); setZoom(1); d.orient = Portrait; setTabSize(4); setWidth(SIZE_W); setHeight(SIZE_H); setForeground(DEF_FGC); setBackground(DEF_BGC); }
void ccPolyline::importParametersFrom(const ccPolyline& poly) { setClosed(poly.m_isClosed); set2DMode(poly.m_mode2D); setForeground(poly.m_foreground); setVisible(poly.isVisible()); lockVisibility(poly.isVisiblityLocked()); setColor(poly.m_rgbColor); setWidth(poly.m_width); showColors(poly.colorsShown()); showVertices(poly.verticesShown()); setVertexMarkerWidth(poly.getVertexMarkerWidth()); setVisible(poly.isVisible()); showArrow(m_showArrow,m_arrowIndex,m_arrowLength); setGlobalScale(poly.getGlobalScale()); setGlobalShift(poly.getGlobalShift()); setGLTransformationHistory(poly.getGLTransformationHistory()); setMetaData(poly.metaData()); }
void EventsSettingsManager::modifyRequested (const QString&, int rowIdx, const QVariantList& datas) { const auto colorItem = Model_->item (rowIdx, 1); const auto& color = datas.value (1).value<QColor> (); disconnect (Model_, SIGNAL (itemChanged (QStandardItem*)), this, SLOT (handleItemChanged ())); colorItem->setText (color.name ()); colorItem->setForeground (color); connect (Model_, SIGNAL (itemChanged (QStandardItem*)), this, SLOT (handleItemChanged ())); saveSettings (); RebuildEnabledEvents (); }
//TODO fix this qword sys_kill(qword pid, qword msg, qword rcx, qword r8, qword r9) { switch(msg) { case 0: // kill custom process changeProcessState(pid, DEAD); break; case 1: // sleep custom process changeProcessState(pid, SLEEPING); break; case 2: // wake up custom process changeProcessState(pid, READY); break; case 3: setForeground(pid); break; } return 0; }
bool CTFTSerial::open() { bool ret = m_serial.open(); if (!ret) { LogError("Cannot open the port for the TFT Serial"); return false; } setRotation(ROTATION_LANDSCAPE); setBrightness(m_brightness); setBackground(COLOUR_WHITE); setForeground(COLOUR_BLACK); setIdle(); return true; }
int main() { print("HOLA"); setupEverything(); void ** pargs= (void**)malloc(sizeof(void*)); pargs[0] = (void*)"init"; insertProcess(&init, 1, pargs); pargs[0] = (void*)"shell"; insertProcess(sampleCodeModuleAddress, 1, pargs); setForeground(1); beginScheduler(); //((EntryPoint)sampleCodeModuleAddress)(); return 0; }
static void kTermChangeForeground() { int key=0; print("\r\n0:Black 1:Blue 2:Green 3:Cyan 4:Red 5:Magenta\r\n"); print("6:Brown 7:Light Grey 8:Dark Grey 9:Light Blue\r\n"); print("10:Light Green 11:Light Cyan 12:Light Red \r\n"); print("13:Light Magenta 14:Light Brown 15:White\r\n"); memset((unsigned char *)command,0,CMD_LENGTH); getCommand(command); if(command[0]>=48) key=command[0]-48; if(command[1]>=48){ key*=10; key+=command[1]-48; } if(key>15) key%=16; setForeground(key); clearScreen(); }
void PresentationAudioListItem::showErrorDialog() { QMessageBox msgBox(QApplication::activeWindow()); msgBox.setWindowTitle(i18n("Error")); msgBox.setText(i18n("%1 may not be playable.", d->url.fileName())); msgBox.setDetailedText(d->mediaObject->errorString()); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); msgBox.setIcon(QMessageBox::Critical); msgBox.exec(); d->artist = d->url.fileName(); d->title = i18n("This file may not be playable."); setText(i18nc("artist - title", "%1 - %2", artist(), title())); setBackground(QBrush(Qt::red)); setForeground(QBrush(Qt::white)); QFont errorFont = font(); errorFont.setBold(true); errorFont.setItalic(true); setFont(errorFont); }
ccPolyline::ccPolyline(GenericIndexedCloudPersist* associatedCloud) : Polyline(associatedCloud) , ccShiftedObject("Polyline") { set2DMode(false); setForeground(true); setVisible(true); lockVisibility(false); setColor(ccColor::white); showVertices(false); setVertexMarkerWidth(3); setWidth(0); showArrow(false,0,0); ccGenericPointCloud* cloud = dynamic_cast<ccGenericPointCloud*>(associatedCloud); if (cloud) { setGlobalScale(cloud->getGlobalScale()); setGlobalShift(cloud->getGlobalShift()); } }
void SoundItem::slotMediaStateChanged(Phonon::State newstate, Phonon::State /*oldstate*/) { if ( newstate == Phonon::ErrorState ) { KMessageBox::detailedError( (QWidget*)(this), i18n("%1 is damaged and may not be playable.", m_url.fileName()), m_mediaObject->errorString(), i18n("Phonon error") ); m_artist = m_url.fileName(); m_title = i18n("This file is damaged and may not be playable."); setText(artist().append(" - ").append(title())); setBackground(QBrush(Qt::red)); setForeground(QBrush(Qt::white)); QFont errorFont = font(); errorFont.setBold(true); errorFont.setItalic(true); setFont(errorFont); return; } if ( newstate != Phonon::StoppedState ) return; long int total = m_mediaObject->totalTime(); int hours = (int)(total / (long int)( 60 * 60 * 1000 )); int mins = (int)((total / (long int)( 60 * 1000 )) - (long int)(hours * 60)); int secs = (int)((total / (long int)1000) - (long int)(hours * 60 * 60) - (long int)(mins * 60)); m_totalTime = QTime(hours, mins, secs); m_artist = (m_mediaObject->metaData(Phonon::ArtistMetaData)).join(","); m_title = (m_mediaObject->metaData(Phonon::TitleMetaData)).join(","); if ( m_artist.isEmpty() && m_title.isEmpty() ) setText(m_url.fileName()); else setText(artist().append(" - ").append(title())); emit signalTotalTimeReady(m_url, m_totalTime); }