LLConsole::LLConsole(const std::string& name, const LLRect &rect, S32 font_size_index, F32 persist_time ) : LLLineBuffer(), LLView(name, rect, FALSE), mLinePersistTime(persist_time), mFadeTime(persist_time - FADE_DURATION), mFont(LLFontGL::getFontSansSerif()), mConsoleWidth(0), mConsoleHeight(0) { mTimer.reset(); setFontSize( font_size_index ); }
// Constructor Counter::Counter(int newWidth, int newHeight, int newX, int newY, int newFontSize, string newMessage, int newCountValue) { setWidth(newWidth); setHeight(newHeight); setX(newX); setY(newY); setFontSize(newFontSize); setMessage(newMessage); renderBox(); setCountValue(newCountValue); }
void Text::copySpecialProperties(Widget *widget) { Text* label = dynamic_cast<Text*>(widget); if (label) { setFontName(label->_fontName); setFontSize(label->getFontSize()); setString(label->getString()); setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled); setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment()); setTextVerticalAlignment(label->_labelRenderer->getVerticalAlignment()); setTextAreaSize(label->_labelRenderer->getDimensions()); } }
void RichTextLabel::setTextProps(TextField* t) { if (t) { setFontSize(t->getFontSize()); setFont(t->getFont()); colorGrp.setColor(QPalette::Text, t->getColor()); QTextCharFormat format; format.setForeground(QBrush(colorGrp.color(QPalette::Text))); QTextCursor cursor(text); cursor.select(QTextCursor::Document); cursor.mergeCharFormat(format); } }
void QWebPreferencesPrivate::initializeDefaultFontSettings() { setFontSize(MinimumFontSize, 0); setFontSize(DefaultFontSize, 16); setFontSize(DefaultFixedFontSize, 13); QFont defaultFont; defaultFont.setStyleHint(QFont::Serif); setFontFamily(StandardFont, defaultFont.defaultFamily()); setFontFamily(SerifFont, defaultFont.defaultFamily()); defaultFont.setStyleHint(QFont::Fantasy); setFontFamily(FantasyFont, defaultFont.defaultFamily()); defaultFont.setStyleHint(QFont::Cursive); setFontFamily(CursiveFont, defaultFont.defaultFamily()); defaultFont.setStyleHint(QFont::SansSerif); setFontFamily(SansSerifFont, defaultFont.defaultFamily()); defaultFont.setStyleHint(QFont::Monospace); setFontFamily(FixedFont, defaultFont.defaultFamily()); }
LLConsole::LLConsole(const std::string& name, const U32 max_lines, const LLRect &rect, S32 font_size_index, F32 persist_time ) : LLFixedBuffer(max_lines), LLView(name, rect, FALSE), mLastBoxHeight(0), mLastBoxWidth(0) { mLinePersistTime = persist_time; // seconds mFadeTime = persist_time - FADE_DURATION; setFontSize( font_size_index ); setMaxLines(gSavedSettings.getS32("ConsoleMaxLines")); }
LabelWidget::LabelWidget ( const string &label, const vec2 &pos ) : fontSize(FONT_SIZE_NORMAL), font(0) { setFont(g_Application.fontLarge); setFontSize(FONT_SIZE_NORMAL); setLabel(label); setColor(white); setRelativePos(pos); }
LLConsole::LLConsole(const LLConsole::Params& p) : LLUICtrl(p), LLFixedBuffer(p.max_lines), mLinePersistTime(p.persist_time), // seconds mFont(p.font), mConsoleWidth(0), mConsoleHeight(0) { if (p.font_size_index.isProvided()) { setFontSize(p.font_size_index); } mFadeTime = mLinePersistTime - FADE_DURATION; setMaxLines(LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines")); }
MenuButton::MenuButton(const char* label, std::tr1::function<void ()> callback) : osgWidget::Label("", ""), _callback(callback) { // styling setFont("fonts/times.ttf"); setFontSize(MENU_BUTTON_FONT_SIZE); setFontColor(MENU_BUTTON_FONT_COLOR); setLabel(label); setPadding(MENU_BUTTON_PADDING); setAlignHorizontal(osgWidget::Widget::HA_LEFT); // activate event handling for mouse clicks and moves setEventMask(osgWidget::EVENT_MOUSE_PUSH | osgWidget::EVENT_MASK_MOUSE_MOVE); }
////////////////////////////////////////////////////////////////////////////////////////// // RtfWriter::open //! Initialises the writer //! //! \param[in] const* font - Font name //! \param[in] size - Font size in points //! \param[in] const& cols - List of colours //! //! \throw wtl::logic_error - [Debug only] Writer is already open //! \throw wtl::domain_error - I/O error occurred ////////////////////////////////////////////////////////////////////////////////////////// void open(const char* font, UINT size, const std::list<COLORREF>& cols) { // Check stream is closed if (!Closed) throw wtl::logic_error(HERE, "Writer is already open"); Closed = false; // Copy colours for (COLORREF c : cols) Colours.push_back(c); // Write header writeHeader(font); setFontSize(size); }
void PointerCoordinates::loadConfiguration(void) { conf->beginGroup("PointerCoordinates"); setFlagEnableAtStartup(conf->value("enable_at_startup", false).toBool()); textColor = StelUtils::strToVec3f(conf->value("text_color", "1,0.5,0").toString()); setFontSize(conf->value("font_size", 14).toInt()); flagShowCoordinatesButton = conf->value("flag_show_button", true).toBool(); setCurrentCoordinatesPlaceKey(conf->value("current_displaying_place", "TopRight").toString()); setCurrentCoordinateSystemKey(conf->value("current_coordinate_system", "RaDecJ2000").toString()); QStringList cc = conf->value("custom_coordinates", "1,1").toString().split(","); setCustomCoordinatesPlace(cc[0].toInt(), cc[1].toInt()); conf->endGroup(); }
ColorLabel(const char* label): osgWidget::Label(label, "") { setFont("fonts/VeraMono.ttf"); setFontSize(14); setFontColor(1.0f, 1.0f, 1.0f, 1.0f); setColor(0.3f, 0.3f, 0.3f, 1.0f); setPadding(2.0f); setCanFill(true); addSize(150.0f, 25.0f); setLabel(label); setEventMask(osgWidget::EVENT_MOUSE_PUSH | osgWidget::EVENT_MASK_MOUSE_MOVE); }
void CTFTSerial::setLockoutInt() { // Clear the screen clearScreen(); setFontSize(FONT_LARGE); // Draw MMDVM logo displayBitmap(0U, 0U, "MMDVM_sm.bmp"); gotoPosPixel(20U, 60U); displayText("LOCKOUT"); m_mode = MODE_LOCKOUT; }
InfoOverlay::InfoOverlay(QWidget *parent) : OverlayWidget(parent), fm(NULL) { setPalette(Qt::transparent); setAttribute(Qt::WA_TransparentForMouseEvents); textMarginX = 8; textMarginY = 4; textColor.setRgb(255, 255, 255, 255); textShadowColor.setRgb(0, 0, 0, 200); bgColor.setRgb(0, 0, 0, 90); setFontSize(11); setText("No file opened."); hide(); }
void TextOverlay::setProperties(const QScriptValue& properties) { Overlay2D::setProperties(properties); _qmlElement->setX(_bounds.left()); _qmlElement->setY(_bounds.top()); _qmlElement->setWidth(_bounds.width()); _qmlElement->setHeight(_bounds.height()); _qmlElement->settextColor(toQmlColor(vec4(toGlm(_color), _alpha))); QScriptValue font = properties.property("font"); if (font.isObject()) { if (font.property("size").isValid()) { setFontSize(font.property("size").toInt32()); } QFont font(_qmlElement->fontFamily()); font.setPixelSize(_qmlElement->fontSize()); QFontMetrics fm(font); _qmlElement->setlineHeight(fm.lineSpacing() * 1.2); } QScriptValue text = properties.property("text"); if (text.isValid()) { setText(text.toVariant().toString()); } QScriptValue backgroundColor = properties.property("backgroundColor"); if (backgroundColor.isValid()) { QScriptValue red = backgroundColor.property("red"); QScriptValue green = backgroundColor.property("green"); QScriptValue blue = backgroundColor.property("blue"); if (red.isValid() && green.isValid() && blue.isValid()) { _backgroundColor.red = red.toVariant().toInt(); _backgroundColor.green = green.toVariant().toInt(); _backgroundColor.blue = blue.toVariant().toInt(); } } if (properties.property("backgroundAlpha").isValid()) { _backgroundAlpha = properties.property("backgroundAlpha").toVariant().toFloat(); } _qmlElement->setbackgroundColor(toQmlColor(vec4(toGlm(_backgroundColor), _backgroundAlpha))); if (properties.property("leftMargin").isValid()) { setLeftMargin(properties.property("leftMargin").toVariant().toInt()); } if (properties.property("topMargin").isValid()) { setTopMargin(properties.property("topMargin").toVariant().toInt()); } }
void TextLabel::setTextProps(TextField *field) { if (field) { text = *field; //lineHeight = t->getLineHeight(); shadow = field->getShadow(); alignment = field->getAlignment(); setFontSize(field->getFontSize()); setFont(field->getFont()); setColor(field->getColor()); setBGColor(field->getBGColor()); } calculateTextSize(); }
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: setFontSize((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: setMonth((*reinterpret_cast< int(*)>(_a[1]))); break; case 2: setYear((*reinterpret_cast< QDate(*)>(_a[1]))); break; default: ; } _id -= 3; } return _id; }
GraphicalAxes3D::GraphicalAxes3D(vtkRendererPtr renderer) : m_vtkAxisLength(100) { mViewportListener.reset(new ViewportListener); mViewportListener->setCallback(boost::bind(&GraphicalAxes3D::rescale, this)); mActor = vtkAxesActorPtr::New(); mActor->SetAxisLabels(false); mActor->SetTotalLength( m_vtkAxisLength, m_vtkAxisLength, m_vtkAxisLength ); this->setAxisLength(0.2); this->setShowAxesLabels(true); setTransform(Transform3D::Identity()); setFontSize(0.04); this->setRenderer(renderer); }
Input::Input(tank::Vectorf pos, tank::Vectoru size, std::string label, std::function<void()> callback) : tank::Entity(pos) , callback_ {callback} { box_ = makeGraphic<tank::RectangleShape>(size); text_ = makeGraphic<tank::Text>(StartWorld::font); label_ = makeGraphic<tank::Text>(StartWorld::titleFont); text_->setColor({}); text_->setOrigin({-5, 2}); box_->setOutlineColor({200,200,200}); setFontSize(size.y - 2); setLabel(label); }
void CTFTSerial::writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type) { assert(type != NULL); if (m_mode != MODE_DMR) { // Clear the screen clearScreen(); setFontSize(FONT_MEDIUM); // Draw DMR insignia displayBitmap(0U, 0U, "DMR_sm.bmp"); if (slotNo == 1U) { gotoPosPixel(5U, 90U); displayText("2 Listening"); } else { gotoPosPixel(5U, 55U); displayText("1 Listening"); } } if (slotNo == 1U) { char text[30U]; ::sprintf(text, "1 %s %s", type, src.c_str()); gotoPosPixel(5U, 55U); displayText(text); ::sprintf(text, "%s%s", group ? "TG" : "", dst.c_str()); gotoPosPixel(65U, 72U); displayText(text); } else { char text[30U]; ::sprintf(text, "2 %s %s", type, src.c_str()); gotoPosPixel(5U, 90U); displayText(text); ::sprintf(text, "%s%s", group ? "TG" : "", dst.c_str()); gotoPosPixel(65U, 107U); displayText(text); } m_mode = MODE_DMR; }
void Button::drawInternal(QPainter* p) { if (!pixmap.isNull()) { int centerX = (getInnerSize().width() - pixmap.width()) / 2; int centerY = (getInnerSize().height() - pixmap.height()) / 2; p->drawPixmap(centerX, centerY, pixmap, 0, 0, getInnerSize().width() - centerX, getInnerSize().height() - centerY); } p->save(); setFontSize(p); drawText(p, label, QPoint(0, 0), TEXTCOLOR_DEFAULT, Qt::AlignCenter); p->restore(); }
DebugFont::DebugFont(int initSz, const std::string &initText) { align = ALIGN_LEFT; followCamera = 1; fontDrawSize = 5; textWidth = 800; maxW = 0; if (initSz) { setFontSize(initSz); } if (!initText.empty()) { setText(initText); } }
void TextRenderer::loadAttributes() { std::string position = getStringAttribute("position"); if(position == "center") { setPosition(POSITION_CENTER); } else if(position == "top_left") { setPosition(POSITION_TOP_LEFT); } else if(position == "top_right") { setPosition(POSITION_TOP_RIGHT); } else if(position == "bottom_left") { setPosition(POSITION_BOTTOM_LEFT); } else if(position == "bottom_right") { setPosition(POSITION_BOTTOM_RIGHT); } else { throw Exception("Uknown position for TextRenderer: " + position); } setFontSize(getIntegerAttribute("font_size")); }
LabelWidget::LabelWidget ( const string &label, const vec2 &pos, const COLOR &color, FONT_SIZE FontSize, TextWriter &font ) : fontSize(FONT_SIZE_NORMAL), font(0) { setFont(font); setFontSize(FontSize); setLabel(label); setColor(color); setRelativePos(pos); }
TextField& TextField::operator=(const TextField& rhs) { if( this == &rhs) return *this; setFontSize( rhs.getFontSize() ); setColor(rhs.getColor()); setBGColor(rhs.getBGColor()); setFont( rhs.getFont() ); setAlignment( rhs.getAlignment() ); setFixedPitch( rhs.getFixedPitch() ); setShadow( rhs.getShadow() ); return *this; }
void MeteorShowersMgr::loadConfig() { setActiveRadiantOnly(m_conf->value(MS_CONFIG_PREFIX + "/flag_active_radiant_only", true).toBool()); setShowEnableButton(m_conf->value(MS_CONFIG_PREFIX + "/show_enable_button", true).toBool()); setShowSearchButton(m_conf->value(MS_CONFIG_PREFIX + "/show_search_button", true).toBool()); setColorARG(StelUtils::strToVec3f(m_conf->value(MS_CONFIG_PREFIX + "/colorARG", "0,255,240").toString())); setColorARC(StelUtils::strToVec3f(m_conf->value(MS_CONFIG_PREFIX + "/colorARC", "255,240,0").toString())); setColorIR(StelUtils::strToVec3f(m_conf->value(MS_CONFIG_PREFIX + "/colorIR", "255,255,255").toString())); setEnableAtStartup(m_conf->value(MS_CONFIG_PREFIX + "/enable_at_startup", true).toBool()); setFontSize(m_conf->value(MS_CONFIG_PREFIX + "/font_size", 13).toInt()); setEnableLabels(m_conf->value(MS_CONFIG_PREFIX + "/flag_radiant_labels", true).toBool()); setEnableMarker(m_conf->value(MS_CONFIG_PREFIX + "/flag_radiant_marker", true).toBool()); setUpdateFrequencyHours(m_conf->value(MS_CONFIG_PREFIX + "/update_frequency_hours", 720).toInt()); setEnableAutoUpdates(m_conf->value(MS_CONFIG_PREFIX + "/automatic_updates_enabled", true).toBool()); setUrl(m_conf->value(MS_CONFIG_PREFIX + "/url", "http://stellarium.org/json/showers.json").toString()); setLastUpdate(m_conf->value(MS_CONFIG_PREFIX + "/last_update", "2015-07-01T00:00:00").toDateTime()); setStatusOfLastUpdate(m_conf->value(MS_CONFIG_PREFIX + "/last_update_status", 0).toInt()); }
KDateTable::KDateTable(QWidget *parent, QDate date_, const char* name, WFlags f) : QGridView(parent, name, f) { setFontSize(10); if(!date_.isValid()) { kdDebug() << "KDateTable ctor: WARNING: Given date is invalid, using current date." << endl; date_=QDate::currentDate(); } setFocusPolicy( QWidget::StrongFocus ); setNumRows(7); // 6 weeks max + headline setNumCols(7); // 7 days a week setHScrollBarMode(AlwaysOff); setVScrollBarMode(AlwaysOff); #if 0 viewport()->setEraseColor(lightGray); #endif setDate(date_); // this initializes firstday, numdays, numDaysPrevMonth }
void TextField::copySpecialProperties(Widget *widget) { TextField* textField = dynamic_cast<TextField*>(widget); if (textField) { setText(textField->_textFieldRenderer->getString()); setPlaceHolder(textField->getStringValue()); setFontSize(textField->_textFieldRenderer->getFontSize()); setFontName(textField->_textFieldRenderer->getFontName().c_str()); setMaxLengthEnabled(textField->isMaxLengthEnabled()); setMaxLength(textField->getMaxLength()); setPasswordEnabled(textField->isPasswordEnabled()); setPasswordStyleText(textField->_passwordStyleText.c_str()); setAttachWithIME(textField->getAttachWithIME()); setDetachWithIME(textField->getDetachWithIME()); setInsertText(textField->getInsertText()); setDeleteBackward(textField->getDeleteBackward()); } }
KstViewLabel::KstViewLabel(const QString& txt, KstLJustifyType justify, float rotation) : KstBorderedViewObject("Label") { _fallThroughTransparency = false; _container = false; _dataPrecision = 8; _txt = txt; _interpret = true; _replace = true; _rotation = rotation; _justify = justify; _fontName = KstApp::inst()->defaultFont(); _fontSize = -1; setFontSize(0); _standardActions |= Delete | Edit | Rename; _parsed = 0L; _labelMargin = 0; _isResizable = false; reparse(); computeTextSize(_parsed); }
VolumeMeterWidget::VolumeMeterWidget(QWidget *parent) : DrawWidget(parent) { //setPaletteBackgroundColor(colorGroup().background()); //make the widget get updated when the view changes connect(gdata->view, SIGNAL(onFastUpdate(double)), this, SLOT(update())); // Define the number of labels to use for available places //labelNumbers = new labelNumbers( {2, 3, 4, 4, 6, 6} ); labelNumbers.push_back(1); labelNumbers.push_back(2); labelNumbers.push_back(3); labelNumbers.push_back(3); labelNumbers.push_back(3); labelNumbers.push_back(6); setFontSize(9); }