void BasicTextInput::setText(const std::string & text, size_t cursorPos) { if(text != m_text) { m_text = text; m_cursorPos = std::min(cursorPos, text.length()); textUpdated(); } }
void BasicTextInput::eraseWordRight() { if(m_cursorPos < m_text.size()) { size_t end = findWordRight(); m_text.erase(m_cursorPos, end - m_cursorPos); textUpdated(); } }
void BasicTextInput::eraseStart() { if(m_cursorPos > 0) { m_text.erase(0, m_cursorPos); m_cursorPos = 0; textUpdated(); } }
void BasicTextInput::clear() { if(!m_text.empty()) { m_text.clear(); m_cursorPos = 0; textUpdated(); } }
void BasicTextInput::insert(const std::string & text) { if(!text.empty()) { m_text.insert(m_cursorPos, text); m_cursorPos += text.length(); textUpdated(); } }
void ListFilter::columnChanged(bool doFilter) { if(column.IsWindow() && method.IsWindow()) { auto n = method.GetCount(); size_t col = getColumn(); for (int i = StringMatch::METHOD_LAST; i < n; ++i) { method.DeleteString(StringMatch::METHOD_LAST); } if (getMethod() == -1) { method.SetCurSel(StringMatch::PARTIAL); } if (col >= colCount || columns[col]->isNumericType()) { method.AddString(_T("=")); method.AddString(_T(">=")); method.AddString(_T("<=")); method.AddString(_T(">")); method.AddString(_T("<")); method.AddString(_T("!=")); } if (doFilter) textUpdated(true); usingTypedMethod = false; } }
void BasicTextInput::eraseWordLeft() { if(m_cursorPos > 0) { size_t start = findWordLeft(); m_text.erase(start, m_cursorPos - start); m_cursorPos = start; textUpdated(); } }
LRESULT ListFilter::onFilterChar(WORD /*wNotifyCode*/, WORD, HWND hWndCtl, BOOL & bHandled) { if (hWndCtl == text.m_hWnd) { textUpdated(false); } bHandled = FALSE; return 0; }
void FloatNode::loadSettings( QSettings &pSettings ) { mFloat->setVariant( pSettings.value( "Value" ).toDouble() ); emit textUpdated( QString::number( mFloat->variant().toDouble() ) ); pinUpdated( mPinValue ); }
void BasicTextInput::eraseRight() { if(m_cursorPos < m_text.size()) { size_t end = m_cursorPos + 1; while(end < m_text.size() && util::UTF8::isContinuationByte(m_text[end])) { end++; } m_text.erase(m_cursorPos, end - m_cursorPos); textUpdated(); } }
void BasicTextInput::newText(const std::string & text) { if(!text.empty() || !m_editText.empty()) { m_text.insert(m_cursorPos, text); m_cursorPos += text.length(); m_editText.clear(); m_editCursorPos = 0; m_editCursorLength = 0; textUpdated(); } }
GraphicalString::GraphicalString(const QString & value, QWidget * parent) : GraphicalValue(parent) { m_lineEdit = new QLineEdit(this); m_layout->addWidget(m_lineEdit); this->setValue(value); connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textUpdated(QString))); }
void BasicTextInput::eraseLeft() { if(m_cursorPos > 0) { size_t count = 1; while(m_cursorPos > 0 && util::UTF8::isContinuationByte(m_text[m_cursorPos - 1])) { count++; m_cursorPos--; } m_text.erase(m_cursorPos - 1, count); m_cursorPos--; textUpdated(); } }
QWidget *FloatNode::gui() { QLineEdit *GUI = new QLineEdit(); GUI->setText( QString::number( mFloat->variant().toDouble() ) ); connect( GUI, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)) ); connect( this, SIGNAL(textUpdated(QString)), GUI, SLOT(setText(QString)) ); return( GUI ); }
void AuthorEditor::textModified(QString text) { this->blockSignals(true); NoteTable noteTable(global.db); noteTable.updateAuthor(currentLid, text, true); if (text.trimmed() == "" && !hasFocus()) setText(defaultText); else setText(text); this->blockSignals(false); if (text.trimmed() != initialText.trimmed() || priorText.trimmed() != text.trimmed()) emit(textUpdated()); priorText = text; }
TextWidget::TextWidget(sf::Vector2f position, sf::Vector2f size) : Widget(position, size), m_textSize(12), m_font(GUICore::getDefaultFont()), m_alignment(CentrallyAligned) { textUpdated(); }
void TextWidget::setOriginBehaviour(Widget::OriginBehaviour origin){ Widget::setOriginBehaviour(origin); textUpdated(); updateDrawableTextPosition(); }
void TextWidget::setSize(sf::Vector2f size){ Widget::setSize(size); textUpdated(); updateDrawableTextPosition(); }
void TextWidget::setPosition(sf::Vector2f position){ Widget::setPosition(position); textUpdated(); updateDrawableTextPosition(); }
void TextWidget::setTextAlignment(TextWidget::TextAlignment alignment){ m_alignment = alignment; textUpdated(); }
void TextWidget::setFont(sf::Font& font){ m_font = font; textUpdated(); }
void TextWidget::setTextColor(sf::Color color){ m_textColor = color; textUpdated(); }
void TextWidget::setTextSize(sf::Uint32 size){ m_textSize = size; textUpdated(); }
void TextWidget::setText(std::string text){ m_text = text; textUpdated(); }
TextWidget::TextWidget(sf::Vector2f position, sf::Vector2f size, std::string text, sf::Uint32 textSize, sf::Color color, sf::Font& font) : Widget(position, size), m_text(text), m_textSize(textSize), m_textColor(color), m_font(font), m_alignment(CentrallyAligned) { textUpdated(); }
TextWidget::TextWidget() : m_textSize(12), m_font(GUICore::getDefaultFont()), m_alignment(CentrallyAligned) { textUpdated(); }
void BasicTextInput::eraseEnd() { if(m_cursorPos < m_text.size()) { m_text.erase(m_cursorPos); textUpdated(); } }