//------------------------------------------------------------------
bool textInput::mouseReleased(ofMouseEventArgs &e) {
    
    if (hit) {
        
        if (isFocused()) {
            
            if (getTextString() != "midi device") {
                this->dropdownList->setVisible(true);
            }
            else if (midiList != NULL){
                this->midiList->setVisible(true);
            }
        }
        else {
            dropdownList->clearSelected();
            if (getTextString() != "midi device") {
                this->dropdownList->setVisible(false);
            }
            else if (midiList != NULL) {
                
                this->midiList->setVisible(false);
                midiList->clearSelected();
            }
        }
    }
    return ofxUITextInput::mouseReleased(e);
}
Example #2
0
/*!
 * \brief TextAnnotation::duplicate
 * Creates a duplicate of this object.
 */
void TextAnnotation::duplicate()
{
  TextAnnotation *pTextAnnotation = new TextAnnotation("", false, mpGraphicsView);
  QPointF gridStep(mpGraphicsView->getCoOrdinateSystem()->getHorizontalGridStep(),
                   mpGraphicsView->getCoOrdinateSystem()->getVerticalGridStep());
  pTextAnnotation->setOrigin(mOrigin + gridStep);
  pTextAnnotation->setRotationAngle(mRotation);
  pTextAnnotation->initializeTransformation();
  pTextAnnotation->setLineColor(getLineColor());
  pTextAnnotation->setFillColor(getFillColor());
  pTextAnnotation->setLinePattern(getLinePattern());
  pTextAnnotation->setFillPattern(getFillPattern());
  pTextAnnotation->setLineThickness(getLineThickness());
  pTextAnnotation->setExtents(getExtents());
  pTextAnnotation->setTextString(getTextString());
  pTextAnnotation->setFontSize(getFontSize());
  pTextAnnotation->setFontName(getFontName());
  pTextAnnotation->setTextStyles(getTextStyles());
  pTextAnnotation->setTextHorizontalAlignment(getTextHorizontalAlignment());
  pTextAnnotation->drawCornerItems();
  pTextAnnotation->setCornerItemsPassive();
  pTextAnnotation->update();
  mpGraphicsView->addClassAnnotation();
  mpGraphicsView->setCanAddClassAnnotation(true);
}
Example #3
0
SaveFileData *SagaEngine::getSaveFile(uint idx) {
	if (idx >= MAX_SAVES) {
		error("getSaveFileName wrong idx");
	}
	if (isSaveListFull()) {
		return &_saveFiles[_saveFilesCount - idx - 1];
	} else {
		if (!emptySlot.name[0])
			Common::strlcpy(emptySlot.name, getTextString(kTextNewSave), SAVE_TITLE_SIZE);

		return (idx == 0) ? &emptySlot : &_saveFiles[_saveFilesCount - idx];
	}
}
Example #4
0
void SagaEngine::getExcuseInfo(int verb, const char *&textString, int &soundResourceId) {
	textString = NULL;

	if (verb == _script->getVerbType(kVerbOpen)) {
		textString = getTextString(kTextNoPlaceToOpen);
		soundResourceId = 239;		// Boar voice 0
	}
	if (verb == _script->getVerbType(kVerbClose)) {
		textString = getTextString(kTextNoOpening);
		soundResourceId = 241;		// Boar voice 2
	}
	if (verb == _script->getVerbType(kVerbUse)) {
		textString = getTextString(kTextDontKnow);
		soundResourceId = 244;		// Boar voice 5
	}
	if (verb == _script->getVerbType(kVerbLookAt)) {
		textString = getTextString(kTextNothingSpecial);
		soundResourceId = 245;		// Boar voice 6
	}
	if (verb == _script->getVerbType(kVerbPickUp)) {
		textString = getTextString(kTextICantPickup);
		soundResourceId = 246;		// Boar voice 7
	}
}
Example #5
0
void ofxUITextInput::loadState(ofxXmlSettings *XML)
{
    setTextString(XML->getValue("Value", getTextString(), 0));
    setInputTriggerType(OFX_UI_TEXTINPUT_ON_LOAD);
}
Example #6
0
void ofxUITextInput::saveState(ofxXmlSettings *XML)
{
    XML->setValue("Value", getTextString(), 0);    
}