Beispiel #1
0
//------------------------------------------------------------
bool Mouse::isRelease(int aCode) const
{
    if (!isValidate(aCode))
        return false;

    return mPrev.get(aCode) && !mCurrent.get(aCode);
}
Beispiel #2
0
//------------------------------------------------------------
bool Mouse::isDown(int aCode) const
{
    if (!isValidate(aCode))
        return false;

    return mCurrent.get(aCode);
}
Beispiel #3
0
//------------------------------------------------------------
bool Mouse::isPress(int aCode) const
{
    if (!isValidate(aCode))
        return false;

    return !mPrev.get(aCode) && mCurrent.get(aCode);
}
	void PropertyIntControl::notifyEditTextChange(MyGUI::EditBox* _sender)
	{
		PropertyPtr proper = getProperty();
		if (proper != nullptr)
		{
			bool validate = isValidate();
			if (validate)
				executeAction(getClearValue());

			setColour(validate);
		}
	}
	void PropertyInt2Control::notifyEditTextChange(MyGUI::EditBox* _sender)
	{
		Property* proper = getProperty();
		if (proper != nullptr)
		{
			bool validate = isValidate();
			if (validate)
				proper->setValue(getClearValue(), getTypeName());

			setColour(validate);
		}
	}
/*!
    \fn ULLineEditor::validateLine()
 */
void ULLineEditor::validateLine()
{
// 	clearPreview();
	editing = false;
//	QPainterPath  sel;
//	sel.addRect ( sceneRect() );
//	setSelectionArea ( sel );
	QList<QGraphicsItem*> l;
	foreach(QGraphicsItem* gi, glyphs)
	{
		l << gi;
	}

	QGraphicsItemGroup * g = createItemGroup (l);
//	g->setSelected(false);
//	foreach(QGraphicsItem* i, g->childItems())
//	{
//		i->setSelected(false);
//	}

	m_mainScene->addItem ( g );
	g->setFlags ( QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable);
	g->setData ( 1,"group" );
	qDebug() << "set data 3 to "<<m_baseLine;
	g->setData ( 3,QVariant ( m_baseLine ) );
	g->setData ( 4,m_marginRight );
	g->setData ( 5,m_curPpos );
	g->setData( 6, (ltr ? 1 : 0) );
	g->setZValue ( 10.0 );
	g->setHandlesChildEvents ( true );
	if ( reedit )
	{
		g->setPos ( reeditPos );
// 		g->moveBy(0.0,-(g->boundingRect().height()));
		g->setData ( 2, QVariant ( reedit_id ) );
		PageBuffer::getInstance()->insert ( reedit_id,glyphs );
		reedit = false;
	}
	else
	{
		g->setData ( 2, QVariant ( PageBuffer::getInstance()->put ( glyphs ) ) );
		g->setPos ( m_mainScene->cur_pos );
		g->moveBy ( 0.0,-m_baseLine );
		m_mainScene->setCur ( m_mainScene->cur_pos.x(), m_mainScene->cur_pos.y() + m_baseLine );
	}
	m_mainScene->views() [0]->centerOn ( g );
	m_curPpos = 0.0;
	adjust();
	glyphs.clear();
	keyLast.clear();
	emit isValidate();

}
	void PropertyInt2Control::updateProperty()
	{
		Property* proper = getProperty();
		if (proper != nullptr)
		{
			mEdit->setEnabled(!proper->getReadOnly());
			mEdit->setCaption(proper->getValue());

			bool validate = isValidate();
			setColour(validate);
		}
		else
		{
			mEdit->setCaption("");
			mEdit->setEnabled(false);
		}
	}
  void PropertyFloatControl::updateProperty()
  {
    PropertyPtr proper = getProperty();
    if (proper != nullptr)
    {
      mEdit->setEnabled(!proper->getType()->getReadOnly());
      if (mEdit->getOnlyText() != proper->getValue())
        mEdit->setCaption(proper->getValue());

      bool validate = isValidate();
      setColour(validate);
    }
    else
    {
      mEdit->setCaption("");
      mEdit->setEnabled(false);
    }
  }
Beispiel #9
0
//------------------------------------------------------------
void Mouse::setInternalRelease(int aCode)
{
    if (isValidate(aCode))
        mInternal.buttons.set(aCode, false);
}
Beispiel #10
0
//------------------------------------------------------------
void Mouse::setInternalPress(int aCode)
{
    if (isValidate(aCode))
        mInternal.buttons.set(aCode, true);
}