// Nominal tempo value (BPM) accessors. void qtractorTempoSpinBox::setTempo ( float fTempo, bool bNotifyChange ) { if (updateValue(fTempo, m_iBeatsPerBar, m_iBeatDivisor, bNotifyChange)) updateText(); }
void TextField::updateTextLine(uint32_t line, const char* text) { updateText(line * numCharsPerLine, text); }
void TextTools::boldClicked(bool val) { cursor->setFormat(FormatId::Bold, val); updateText(); }
void CompletionLabel::setValues(const QStringList& v) { values=v; updateText(); }
void CompletionLabel::clearValues() { values.clear(); selectedIdx=0; updateText(); }
void DiveTextItem::setAlignment(int alignFlags) { internalAlignFlags = alignFlags; updateText(); }
void DiveTextItem::setText(const QString& t) { internalText = t; updateText(); }
void TextTools::italicClicked(bool val) { _textElement->setCurItalic(val); updateText(); }
void TextTools::orderedListClicked() { _textElement->orderedList(); updateText(); }
void TextTools::boldClicked(bool val) { _textElement->setCurBold(val); updateText(); }
void TextTools::underlineClicked(bool val) { _textElement->setCurUnderline(val); updateText(); }
void TextTools::fontChanged(const QFont& f) { _textElement->setCurFontFamily(f.family()); updateText(); }
void TextTools::sizeChanged(double value) { _textElement->setCurFontPointSize(value); updateText(); }
// Nominal time-signature denominator (beat-divisor) accessors. void qtractorTempoSpinBox::setBeatDivisor ( unsigned short iBeatDivisor, bool bNotifyChange ) { if (updateValue(m_fTempo, m_iBeatsPerBar, iBeatDivisor, bNotifyChange)) updateText(); }
LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p) : LLF32UICtrl(p), mLabelBox( NULL ), mEditor( NULL ), mTextBox( NULL ), mFont(p.font), mShowText(p.show_text), mCanEditText(p.can_edit_text), mPrecision(p.decimal_digits), mTextEnabledColor(p.text_color()), mTextDisabledColor(p.text_disabled_color()), mLabelWidth(p.label_width) { S32 top = getRect().getHeight(); S32 bottom = 0; S32 left = 0; S32 label_width = p.label_width; S32 text_width = p.text_width; // Label if( !p.label().empty() ) { if (!p.label_width.isProvided()) { label_width = p.font()->getWidth(p.label); } LLRect label_rect( left, top, label_width, bottom ); LLTextBox::Params params(p.slider_label); if (!params.rect.isProvided()) { params.rect = label_rect; } if (!params.font.isProvided()) { params.font = p.font; } params.initial_value(p.label()); mLabelBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mLabelBox); mLabelFont = params.font(); } if (p.show_text && !p.text_width.isProvided()) { // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) if ( p.max_value ) text_width = p.font()->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( p.max_value ) ) + p.decimal_digits + 1 ); if ( p.increment < 1.0f ) text_width += p.font()->getWidth(std::string(".")); // (mostly) take account of decimal point in value if ( p.min_value < 0.0f || p.max_value < 0.0f ) text_width += p.font()->getWidth(std::string("-")); // (mostly) take account of minus sign // padding to make things look nicer text_width += 8; } S32 text_left = getRect().getWidth() - text_width; static LLUICachedControl<S32> sliderctrl_spacing ("UISliderctrlSpacing", 0); S32 slider_right = getRect().getWidth(); if( p.show_text ) { slider_right = text_left - sliderctrl_spacing; } S32 slider_left = label_width ? label_width + sliderctrl_spacing : 0; LLSlider::Params slider_p(p.slider_bar); slider_p.name("slider_bar"); if (!slider_p.rect.isProvided()) { slider_p.rect = LLRect(slider_left,top,slider_right,bottom); } if (!slider_p.initial_value.isProvided()) { slider_p.initial_value = p.initial_value().asReal(); } if (!slider_p.min_value.isProvided()) { slider_p.min_value = p.min_value; } if (!slider_p.max_value.isProvided()) { slider_p.max_value = p.max_value; } if (!slider_p.increment.isProvided()) { slider_p.increment = p.increment; } if (!slider_p.orientation.isProvided()) { slider_p.orientation = p.orientation; } slider_p.commit_callback.function = &LLSliderCtrl::onSliderCommit; slider_p.control_name = p.control_name; slider_p.mouse_down_callback( p.mouse_down_callback ); slider_p.mouse_up_callback( p.mouse_up_callback ); mSlider = LLUICtrlFactory::create<LLSlider> (slider_p); addChild( mSlider ); if( p.show_text() ) { LLRect text_rect( text_left, top, getRect().getWidth(), bottom ); if( p.can_edit_text() ) { LLLineEditor::Params line_p(p.value_editor); if (!line_p.rect.isProvided()) { line_p.rect = text_rect; } if (!line_p.font.isProvided()) { line_p.font = p.font; } line_p.commit_callback.function(&LLSliderCtrl::onEditorCommit); line_p.prevalidate_callback(&LLTextValidate::validateFloat); mEditor = LLUICtrlFactory::create<LLLineEditor>(line_p); mEditor->setFocusReceivedCallback( boost::bind(&LLSliderCtrl::onEditorGainFocus, _1, this )); // don't do this, as selecting the entire text is single clicking in some cases // and double clicking in others //mEditor->setSelectAllonFocusReceived(TRUE); addChild(mEditor); } else { LLTextBox::Params text_p(p.value_text); if (!text_p.rect.isProvided()) { text_p.rect = text_rect; } if (!text_p.font.isProvided()) { text_p.font = p.font; } mTextBox = LLUICtrlFactory::create<LLTextBox>(text_p); addChild(mTextBox); } } updateText(); }
void TextTools::indentMoreClicked() { _textElement->indentMore(); updateText(); }
void UIHostComboEditor::sltClear() { m_shownKeys.clear(); updateText(); }
void TextTools::indentLessClicked() { _textElement->indentLess(); updateText(); }
void DiveTextItem::setBrush(const QBrush& b) { brush = b; updateText(); }
void Counter::inc() { m_count++; updateText(); }
void CompletionLabel::selectFirst() { selectedIdx=0; updateText(); }
GCUserViewGroupItem::GCUserViewGroupItem(GCUserView *par, const QString& t, int k) :Q3ListViewItem(par,t), key_(k), baseText(t) { setDragEnabled(false); updateText(); }
void CompletionLabel::appendValues(const QStringList& v) { values+=v; updateText(); }
//----------------------------------------------- void guiBaseObject::update(){ updateText(); }
void TextField::updateTextBack(uint32_t rStart, const char* text) { updateText(numCharsTotal - rStart, text); }
void NGM::Model::ResourceContentItem::setFilepath(const QString &filepath) { content->filepath = filepath; updateText(); }
void TextTools::sizeChanged(double value) { cursor->setFormat(FormatId::FontSize, value); cursor->format()->setFontSize(value); updateText(); }
void LLSliderCtrl::setValue(F32 v, BOOL from_event) { mSlider->setValue( v, from_event ); mValue = mSlider->getValueF32(); updateText(); }
void TextTools::underlineClicked(bool val) { cursor->setFormat(FormatId::Underline, val); updateText(); }
// Nominal value (in frames) accessors. void qtractorTimeSpinBox::setValue ( unsigned long iValue, bool bNotifyChange ) { if (updateValue(iValue, bNotifyChange)) updateText(); }