Esempio n. 1
0
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();
	}
}
Esempio n. 2
0
void BasicTextInput::eraseWordRight() {
	if(m_cursorPos < m_text.size()) {
		size_t end = findWordRight();
		m_text.erase(m_cursorPos, end - m_cursorPos);
		textUpdated();
	}
}
Esempio n. 3
0
void BasicTextInput::eraseStart() {
	if(m_cursorPos > 0) {
		m_text.erase(0, m_cursorPos);
		m_cursorPos = 0;
		textUpdated();
	}
}
Esempio n. 4
0
void BasicTextInput::clear() {
	if(!m_text.empty()) {
		m_text.clear();
		m_cursorPos = 0;
		textUpdated();
	}
}
Esempio n. 5
0
void BasicTextInput::insert(const std::string & text) {
	if(!text.empty()) {
		m_text.insert(m_cursorPos, text);
		m_cursorPos += text.length();
		textUpdated();
	}
}
Esempio n. 6
0
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;
    }
}
Esempio n. 7
0
void BasicTextInput::eraseWordLeft() {
	if(m_cursorPos > 0) {
		size_t start = findWordLeft();
		m_text.erase(start, m_cursorPos - start);
		m_cursorPos = start;
		textUpdated();
	}
}
Esempio n. 8
0
LRESULT ListFilter::onFilterChar(WORD /*wNotifyCode*/, WORD, HWND hWndCtl, BOOL & bHandled) {
    if (hWndCtl == text.m_hWnd) {
        textUpdated(false);
    }

    bHandled = FALSE;
    return 0;
}
Esempio n. 9
0
void FloatNode::loadSettings( QSettings &pSettings )
{
	mFloat->setVariant( pSettings.value( "Value" ).toDouble() );

	emit textUpdated( QString::number( mFloat->variant().toDouble() ) );

	pinUpdated( mPinValue );
}
Esempio n. 10
0
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();
	}
}
Esempio n. 11
0
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();
	}
}
Esempio n. 12
0
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)));
}
Esempio n. 13
0
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();
	}
}
Esempio n. 14
0
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 );
}
Esempio n. 15
0
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;
}
Esempio n. 16
0
TextWidget::TextWidget(sf::Vector2f position, sf::Vector2f size)
	: Widget(position, size), m_textSize(12), m_font(GUICore::getDefaultFont()), m_alignment(CentrallyAligned)
{
	textUpdated();
}
Esempio n. 17
0
void TextWidget::setOriginBehaviour(Widget::OriginBehaviour origin){
	Widget::setOriginBehaviour(origin);
	textUpdated();
	updateDrawableTextPosition();
}
Esempio n. 18
0
void TextWidget::setSize(sf::Vector2f size){
	Widget::setSize(size);
	textUpdated();
	updateDrawableTextPosition();
}
Esempio n. 19
0
void TextWidget::setPosition(sf::Vector2f position){
	Widget::setPosition(position);
	textUpdated();
	updateDrawableTextPosition();
}
Esempio n. 20
0
void TextWidget::setTextAlignment(TextWidget::TextAlignment alignment){
	m_alignment = alignment;
	textUpdated();
}
Esempio n. 21
0
void TextWidget::setFont(sf::Font& font){
	m_font = font;
	textUpdated();
}
Esempio n. 22
0
void TextWidget::setTextColor(sf::Color color){
	m_textColor = color;
	textUpdated();
}
Esempio n. 23
0
void TextWidget::setTextSize(sf::Uint32 size){
	m_textSize = size;
	textUpdated();
}
Esempio n. 24
0
void TextWidget::setText(std::string text){
	m_text = text;
	textUpdated();
}
Esempio n. 25
0
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();
}
Esempio n. 26
0
TextWidget::TextWidget()
	: m_textSize(12), m_font(GUICore::getDefaultFont()), m_alignment(CentrallyAligned)
{
	textUpdated();
}
Esempio n. 27
0
void BasicTextInput::eraseEnd() {
	if(m_cursorPos < m_text.size()) {
		m_text.erase(m_cursorPos);
		textUpdated();
	}
}