Exemple #1
0
int
Clause::remove(Literal &key, int idx,
	BinaryTree<Tuple<Literal, List<Literal> > > &clause)
{
	// delete literal from the clause
	Tuple<Literal, List<Literal> > tuple(key, List<Literal>());
	int status = clause.retrieve(tuple);
	if (status != OK)
		return(status);
	status = tuple.data.removeNth(idx, key);
	if (status != OK)
		return(status);
	if (tuple.data.isEmpty())
	{
		// remove class, we just removed the last member
		status = clause.remove(tuple);
		if (status != OK)
			return(status);
	}

	// update the type
	updateType();

	// all done
	return(OK);
}
Object::Object(int x, int y, int x1, int y1, ObjectType typ) {
	int width, heigth;

	if (x < x1) {
		lastImageTopLeftX = x;
		width = x1 - x;
	} else {
		lastImageTopLeftX = x1;
		width = x - x1;
	}

	if (y < y1) {
		lastImageTopLeftY = y;
		heigth = y1 - y;
	} else {
		lastImageTopLeftY = y1;
		heigth = y - y1;
	}

	lastImageX = lastImageTopLeftX + width / 2;
	lastImageY = lastImageTopLeftY + heigth / 2;
	lastImageHeight = heigth;
	lastImageWidth = width;
	lastImageSeen = true;
	type = typ;
	lastVector = Vector(0.0, 0.0);
	matched = false;
	lastSeenCounter = 0;
	originalHeight = 0;
	originalWidth = 0;
	updateType();
}
LRESULT CommandDlg::onType(WORD , WORD, HWND , BOOL& ) {
	updateType();
	updateCommand();
	ctrlResult.SetWindowText(command.c_str());
	updateControls();
	return 0;
}
Exemple #4
0
int
Clause::insert(const Literal &key,
	BinaryTree<Tuple<Literal, List<Literal> > > &clause)
{
	// check if a class already exists
	Tuple<Literal, List<Literal> > tuple(key, List<Literal>());
	int status = clause.retrieve(tuple);
	if (status == OK)
	{
		if ((status = tuple.data.insertAtEnd(key)) != OK)
			return(status);
		if ((status = clause.update(tuple)) != OK)
			return(status);
	}
	else if (status == NOMATCH)
	{
		if ((status = tuple.data.insertAtEnd(key)) != OK)
			return(status);
		if ((status = clause.insert(tuple)) != OK)
			return(status);
	}
	else
		return(status);

	// update the type
	updateType();

	// all done
	return(OK);
}
bool RObject::updateStructure (RData *new_data) {
	RK_TRACE (OBJECTS);
	if (new_data->getDataLength () == 0) { // can happen, if the object no longer exists
		return false;
	}

	RK_ASSERT (new_data->getDataLength () >= 5);
	RK_ASSERT (new_data->getDataType () == RData::StructureVector);

	if (!canAccommodateStructure (new_data)) return false;

	bool properties_change = false;

	properties_change = updateName (new_data->getStructureVector ()[0]);
	properties_change = updateType (new_data->getStructureVector ()[1]);
	properties_change = updateClasses (new_data->getStructureVector ()[2]);
	properties_change = updateMeta (new_data->getStructureVector ()[3]);
	properties_change = updateDimensions (new_data->getStructureVector ()[4]);

	if (properties_change) RKGlobals::tracker ()->objectMetaChanged (this);
	if (type & NeedDataUpdate) updateDataFromR (0);
	if (isPending ()) type -= Pending;

	return true;
}
NearFieldTarget::NearFieldTarget(QAndroidJniObject intent, const QByteArray uid, QObject *parent) :
    QNearFieldTarget(parent),
    m_intent(intent),
    m_uid(uid)
{
    updateTechList();
    updateType();
    setupTargetCheckTimer();
}
Exemple #7
0
uv_err_t UVDElfSymbol::applyRelocationsForWrite()
{
	//Types tend to change depending on whether or not data was set
	uv_assert_err_ret(updateType());

	/*
	Update st_shndx if we linked to a section, or SHN_UNDEF otherwise
	*/
	if( m_relevantSectionHeader )
	{
		uint32_t index = 0;

		//Specifies the section to link to
		uv_assert_err_ret(m_symbolSectionHeader->m_elf->getSectionHeaderIndex(m_relevantSectionHeader, &index));
		m_symbol.st_shndx = index;
	}

	{
		UVDData *data = NULL;

		uv_assert_err_ret(getData(&data));
		//Defined
		if( data )
		{
			//FIXME: assume single symbol per object file for now
			uint32_t offset = 0;
			uint32_t size = 0;
			
			uv_assert_err_ret(m_symbolSectionHeader->getSymbolSectionOffset(this, &offset));
			uv_assert_err_ret(data->size(&size));
			
			m_symbol.st_value = offset;
			m_symbol.st_size = size;
		}
	}

	//uv_err_t UVDElfSymbol::addSymbolNameRelocation()
	{
		std::string name;
		uint32_t offset = 0;

		uv_assert_err_ret(getName(name));
		
		//The value
		uv_assert_ret(m_symbolSectionHeader);
		uv_assert_err_ret(m_symbolSectionHeader->getSymbolStringIndex(name, &offset));	
		
		ELF_SYMBOL_DEBUG
		({
			UVDData *data = NULL;
			m_relocatableData.getRelocatableData(&data);
			printf_elf_symbol_debug("name: %s, %s, symbol string table index: 0x%.8X, relocatable data: 0x%.8X, data: 0x%.8X\n", name.c_str(), m_sName.c_str(), offset, (unsigned int)&m_relocatableData, (unsigned int)data);
		});
		
		m_symbol.st_name = offset;

	}
Exemple #8
0
int
Clause::remove(Literal &key)
{
	// check if the key is negated
	int status;
	if (key.isNegated())
		status = negativeClause.remove(key);
	else
		status = positiveClause.remove(key);
	if (status == OK)
		updateType();
	return(status);
}
Exemple #9
0
int
Clause::removeEqSet(Literal &key, List<Literal> &data)
{
	int status;
	Tuple<Literal, List<Literal> > tuple(key, List<Literal>());
	if (key.isNegated())
		status = negativeClause.remove(tuple);
	else
		status = positiveClause.remove(tuple);
	if (status == OK)
	{
		updateType();
		data = tuple.data;
	}
	return(status);
}
Object::Object(BoundingBox boundingBox, ObjectType typ) {
	lastImageTopLeftX = boundingBox.topLeft.getX();
	lastImageTopLeftY = boundingBox.topLeft.getY();
	lastImageX = lastImageTopLeftX + boundingBox.width / 2;
	lastImageY = lastImageTopLeftY + boundingBox.height / 2;
	lastImageHeight = boundingBox.height;
	lastImageWidth = boundingBox.width;
	lastImageSeen = true;
	type = typ;
	lastVector = Vector(0.0, 0.0);
	matched = false;
	lastSeenCounter = 0;
	originalHeight = 0;
	originalWidth = 0;
	updateType();
}
bool ColumnEditorModel::setData(QModelIndex const &oIndex, QVariant const &oValue, int nRole)
{
	if(!oIndex.isValid())
		return QStandardItemModel::setData(oIndex, oValue, nRole);

	StdString s = oValue.value<StdString>();
	bool rc;
	bool update = true;

	int n = rowCount()-1;
	int ir = oIndex.row();
	int ic = oIndex.column();
	if(ir == n)
	{
		// Add new empty line at the end if the last item has got some text
		if(ic == COL_NAME && s.size() > 0)
		{
			updateName(n, s);
			insertRow(n+1);
		}
	}
	else
	{
		if(ic == COL_NAME)
		{
			if(s.size() == 0)
			{
				n = oIndex.row();
				deleteRow(n);
				update = false;
			}
			else
				updateName(ir, s);
		}
		else
			updateType(ir, s);
	}

	if(update)
		rc = QStandardItemModel::setData(oIndex, oValue, nRole);
	else
		rc = false;

	return rc;
}
Exemple #12
0
int
Clause::insertEqSet(const Literal &key, const List<Literal> &data)
{
	int status;

	// insert tuple
	Tuple<Literal, List<Literal> > tuple(key, data);
	if (key.isNegated())
	{
		if ((status = negativeClause.insert(tuple)) != OK)
			return(status);
	}
	else
	{
		if ((status = positiveClause.insert(tuple)) != OK)
			return(status);
	}

	// update the type
	updateType();

	// all done
	return(OK);
}
Exemple #13
0
// parse input string
int
Clause::parse(const List<String> &list)
{
	// set defaults values
	clear();

	// check if list is empty
	if (list.isEmpty())
	{
		// nothing to parse
		type = Empty;
		return(OK);
	}

	// list is not empty, get options.
	ListIterator<String> listIter(list);
	String options = listIter();

	// parse options
	StringMatcher conclusionopt(options, String("CONCLUSION"));
	if (!conclusionopt.done())
		partOfConclusion = 1;
	StringMatcher queryopt(options, String("QUERY"));
	if (!queryopt.done())
		partOfQuery = 1;
	StringMatcher setofsupportopt(options, String("SET-OF-SUPPORT"));
	if (!setofsupportopt.done())
		setOfSupport = 1;
	
	// scan list of literal strings
	for (listIter++; !listIter.done(); listIter++)
	{
		// insert literal into clause; will set type.
		Literal literal(listIter());
		if (insert(literal) != OK)
		{
			ERROR("insert failed.", errno);
			return(NOTOK);
		}
	}

	// convert to a string
	convertToString(inputstring);

	// add answer literal 
	if (partOfQuery)
	{
		int ivar = 0;
		String answerstring("( ANSWER ");
		StringTokens st(inputstring, " \t");
		for ( ; !st.done(); st++)
		{
			String token = st();
			if (token(0,2) == String("_V"))
			{
				ivar++;
				answerstring += token + String(" ");
			}
			else if (token(0,3) == String("_RV"))
			{
				ivar++;
				answerstring += token + String(" ");
			}
		}
		if (ivar == 0)
		{
			// no variables were found
			answerstring = String("ANSWER");
		}
		else
		{
			// finish answer literal
			answerstring += String(") ");
		}

		// insert answer literal into answer clause
		Literal answerliteral(answerstring);
		if (insertAnswer(answerliteral) != OK)
		{
			ERROR("insertAnswer failed.", errno);
			return(NOTOK);
		}
	}

	// update clause type
	updateType();

	// all done
	return(OK);
}
Exemple #14
0
void SCgNode::setTypeAlias(const QString &typeAlias)
{
    SCgObject::setTypeAlias(typeAlias);
    updateType();
}
/**
Set up the CCntSqlStatement objects held by the class.
*/
void CPplGroupsTable::ConstructL()
	{
	// Statement types
	TCntSqlStatementType insertType(EInsert, KSqlContactGroupTableName);
	TCntSqlStatementType selectType(ESelect, KSqlContactGroupTableName);
	TCntSqlStatementType updateType(EUpdate, KSqlContactGroupTableName);
	TCntSqlStatementType deleteType(EDelete, KSqlContactGroupTableName);
	TCntSqlStatementType countContactsType(ESelect, KSqlContactTableName);
	
	// Where clauses

	// sizes of the clauses
	const TInt KWhereGroupClauseBufSize(KGroupContactGroupId().Size() + 
		KWhereStringEqualsStringFormatText().Size() + KGroupContactGroupIdParam().Size() );
	const TInt KWhereMemberClauseBufSize(KGroupContactGroupMemberId().Size() + 
		KWhereStringEqualsStringFormatText().Size() + KGroupContactGroupMemberIdParam().Size() );
	const TInt KWhereOrClauseBufSize(KWhereGroupClauseBufSize + KSqlOr().Size() + KWhereMemberClauseBufSize);
	
	// for WHERE contact_group_id = [contact id value]
	HBufC* whereGroupIdClause = HBufC::NewLC(KWhereGroupClauseBufSize);
	whereGroupIdClause->Des().AppendFormat(KWhereStringEqualsStringFormatText, 
		&KGroupContactGroupId, &KGroupContactGroupIdParam );

	// for WHERE contact_group_member_id = [contact id value]
	HBufC* whereMemberIdClause = HBufC::NewLC(KWhereMemberClauseBufSize);
	whereMemberIdClause->Des().AppendFormat(KWhereStringEqualsStringFormatText, 
		&KGroupContactGroupMemberId, &KGroupContactGroupMemberIdParam );

	// for WHERE contact_group_id = [contact id value] 
	//	OR contact_group_member_id = [contact id value]
	HBufC* whereGroupOrMemberIdClause = HBufC::NewLC(KWhereOrClauseBufSize);
	TPtr whereGroupOrMemberIdClausePtr = whereGroupOrMemberIdClause->Des();
	whereGroupOrMemberIdClausePtr.AppendFormat(KWhereStringEqualsStringFormatText, 
		&KGroupContactGroupId, &KGroupContactGroupIdParam);
	whereGroupOrMemberIdClausePtr.Append(KSqlOr);
	whereGroupOrMemberIdClausePtr.AppendFormat(KWhereStringEqualsStringFormatText, 
		&KGroupContactGroupMemberId, &KGroupContactGroupMemberIdParam);

	// for WHERE contact_id = [contact_id]
	HBufC* whereContactIdClause = HBufC::NewLC(KWhereGroupClauseBufSize);
	whereContactIdClause->Des().AppendFormat(KWhereStringEqualsStringFormatText, 
		&KContactId, &KContactIdParam );
		
	// INSERT

	// insert group-member relationships
	// For a statement in the following format:
	// 	INSERT INTO groups 
	//		(group_id, contact_group_id, contact_group_member_id) 
	//		VALUES (NULL, [contact group id value], [contact group member id value]);
	//
	iInsertStmnt = TSqlProvider::GetSqlStatementL(insertType);
	iInsertStmnt->SetParamL(KGroupContactGroupId(), KGroupContactGroupIdParam());
	iInsertStmnt->SetParamL(KGroupContactGroupMemberId(), KGroupContactGroupMemberIdParam());

	// SELECT
	
	// select group id
	// For a statement in the following format:
	// 	SELECT contact_group_id FROM groups 
	//		WHERE contact_group_member_id = [contact id value];
	//
	iSelectGroupsStmnt = TSqlProvider::GetSqlStatementL(selectType);
	iSelectGroupsStmnt->SetParamL(KGroupContactGroupId(), KNullDesC() );
	iSelectGroupsStmnt->SetConditionL(*whereMemberIdClause);

	// select member id
	// For a statement in the following format:
	// 	SELECT contact_group_member_id FROM groups 
	//		WHERE contact_group_id = [contact id value];
	//
	iSelectMembersStmnt = TSqlProvider::GetSqlStatementL(selectType);
	iSelectMembersStmnt->SetParamL(KGroupContactGroupMemberId(), KNullDesC() );
	iSelectMembersStmnt->SetConditionL(*whereGroupIdClause);

	// DELETE

	// delete all where group or member equals id
	// For a statement in the following format:
	// 	DELETE FROM groups WHERE contact_group_id = [contact id value]
	//		OR contact_group_member_id = [contact id value];
	//
	iDeleteStmnt = TSqlProvider::GetSqlStatementL(deleteType);
	iDeleteStmnt->SetConditionL(*whereGroupOrMemberIdClause);

	// SELECT
	
	// SELECt count(*) FROM contact WHERE contact_id = [contact_id]
	iCountContactsStmnt = TSqlProvider::GetSqlStatementL(countContactsType);
	iCountContactsStmnt->SetParamL(KSqlCount, KSpace);
	iCountContactsStmnt->SetConditionL(*whereContactIdClause);
	
	CleanupStack::PopAndDestroy(4, whereGroupIdClause); // and whereContactIdClause, whereMemberIdClause, whereGroupOrMemberIdClause
	}
Exemple #16
0
LaneSettings::LaneSettings(ProjectSettings *projectSettings, SettingsElement *parentSettingsElement, Lane *lane)
    : SettingsElement(projectSettings, parentSettingsElement, lane)
    , ui(new Ui::LaneSettings)
    , lane_(lane)
    , init_(false)
    , roadSystemItemPolyGraph_(NULL)
    , insertWidthSectionHandle_(NULL)
    , lswItem_(NULL)
{
    ui->setupUi(this);

	activateWidthGroupBox(false);
	activateInsertGroupBox(false);
	connect(ui->insertPushButton, SIGNAL(clicked(bool)), this, SLOT(activateInsertGroupBox(bool)));
	connect(ui->editPushButton, SIGNAL(clicked(bool)), this, SLOT(activateWidthGroupBox(bool)));

    // List //
    //
    QStringList typeNames;
    typeNames << Lane::parseLaneTypeBack(Lane::LT_NONE)
              << Lane::parseLaneTypeBack(Lane::LT_DRIVING)
              << Lane::parseLaneTypeBack(Lane::LT_STOP)
              << Lane::parseLaneTypeBack(Lane::LT_SHOULDER)
              << Lane::parseLaneTypeBack(Lane::LT_BIKING)
              << Lane::parseLaneTypeBack(Lane::LT_SIDEWALK)
              << Lane::parseLaneTypeBack(Lane::LT_BORDER)
              << Lane::parseLaneTypeBack(Lane::LT_RESTRICTED)
              << Lane::parseLaneTypeBack(Lane::LT_PARKING)
              << Lane::parseLaneTypeBack(Lane::LT_MWYENTRY)
              << Lane::parseLaneTypeBack(Lane::LT_MWYEXIT)
              << Lane::parseLaneTypeBack(Lane::LT_SPECIAL1)
              << Lane::parseLaneTypeBack(Lane::LT_SPECIAL2)
              << Lane::parseLaneTypeBack(Lane::LT_SPECIAL3);
    ui->typeBox->addItems(typeNames);

    /*heightGraph_ = new ProfileGraph(projectSettings->getProjectWidget(), projectSettings->getProjectData());
	heightGraph_->setParent(ui->widthGroup);
	ui->horizontalLayout_3->insertWidget(0,heightGraph_);
	//heightGraph_->getView()->setDragMode(QGraphicsView::ScrollHandDrag);
	//QGraphicsScene* pScene = new NoDeselectScene(this); 
    //heightGraph_->getView()->setScene(pScene);
	heightGraph_->getScene()->doDeselect(false);// we don't want to deselect ourselves if we click on the background, otherwise we delete ourselves--> chrash and it would not be practical anyway
	*/

    heightGraph_ = projectSettings->getProjectWidget()->getHeightGraph();

    laneEditor_ = dynamic_cast<LaneEditor *>(projectSettings->getProjectWidget()->getProjectEditor());
    if (!laneEditor_)
    {
        return; // another editor is active
    }

    roadSystemItemPolyGraph_ = new LaneWidthRoadSystemItem(heightGraph_, projectSettings->getProjectData()->getRoadSystem());
    heightGraph_->getScene()->addItem(roadSystemItemPolyGraph_);

    // Section Handle //
    //
    //insertWidthSectionHandle_ = new SectionHandle(roadSystemItemPolyGraph_);
    //insertWidthSectionHandle_->hide();
    roadSystemItemPolyGraph_->setSettings(this);
    roadSystemItemPolyGraph_->setAcceptHoverEvents(true);
    // Activate Road in ProfileGraph //
    //
    lswItem_ = new LaneSectionWidthItem(roadSystemItemPolyGraph_, lane_);
    //selectedElevationRoadItems_.insert(road, roadItem);

    // Fit View //
    //
    QRectF boundingBox = lswItem_->boundingRect();
    if (boundingBox.width() < 15.0)
    {
        boundingBox.setWidth(15.0);
    }
    if (boundingBox.height() < 10.0)
    {
        boundingBox.setHeight(10.0);
    }

    heightGraph_->getView()->fitInView(boundingBox);
    heightGraph_->getView()->zoomOut(Qt::Horizontal | Qt::Vertical);

    //ui->horizontalLayout_3->insertWidget(0,heightGraph_);
    //heightGraph_->show();
    // Initial Values //
    //
    updateId();
    updateType();
    updateLevel();
    updatePredecessor();
    updateSuccessor();
    updateWidth();

    // Done //
    //
    init_ = true;
}
/**
Set up the CCntSqlStatement objects held by the class.
*/
void CPplCommAddrTable::ConstructL()
	{
	// Statement types
	TCntSqlStatementType insertType(EInsert, KSqlContactCommAddrTableName() );
	TCntSqlStatementType selectType(ESelect, KSqlContactCommAddrTableName() );
	TCntSqlStatementType updateType(EUpdate, KSqlContactCommAddrTableName() );
	TCntSqlStatementType deleteType(EDelete, KSqlContactCommAddrTableName() );

	// Where clauses

	// sizes of the clauses
	const TInt KWhereContactIdBufSize(KCommAddrContactId().Size() +
		KWhereStringEqualsStringFormatText().Size() + KCommAddrContactIdParam().Size() );
	const TInt KWhereCommAddrIdBufSize(KCommAddrId().Size() +
		KWhereStringEqualsStringFormatText().Size() + KCommAddrIdParam().Size() );
	const TInt KWhereAndClauseBufSize(KWhereCommAddrIdBufSize + KSqlAnd().Size() + KWhereCommAddrIdBufSize);

	HBufC* whereContactIdClause = HBufC::NewLC(KWhereContactIdBufSize);
	// for WHERE contact_id = [contact id value]
	whereContactIdClause->Des().AppendFormat(KWhereStringEqualsStringFormatText,
		&KCommAddrContactId, &KCommAddrContactIdParam );

	// for WHERE comm_addr_id = [comm addr id value]
	HBufC* whereCommAddrIdClause = HBufC::NewLC(KWhereCommAddrIdBufSize);
	whereCommAddrIdClause->Des().AppendFormat(KWhereStringEqualsStringFormatText,
		&KCommAddrId, &KCommAddrIdParam );

	// for WHERE value = [value string] AND type = [type value]
	HBufC* whereValueAndTypeClause = HBufC::NewLC(KWhereAndClauseBufSize);
	TPtr whereValueAndTypeClausePtr = whereValueAndTypeClause->Des();
	whereValueAndTypeClausePtr.AppendFormat(KWhereStringEqualsStringFormatText,
		&KCommAddrValue, &KCommAddrValueParam );
	whereValueAndTypeClausePtr.Append(KSqlAnd);
	whereValueAndTypeClausePtr.AppendFormat(KWhereStringEqualsStringFormatText,
		&KCommAddrType, &KCommAddrTypeParam );

	// INSERT

	// insert new comm addr record
	// 	INSERT INTO comm_addr
	//		(comm_addr_id, contact_id, type, value, extra_value, extra_type_info)
	//		VALUES (NULL, [contact id value], [type value],
	//			[value string], [extra value string], [extra type info]);
	//
	iInsertStmnt = TSqlProvider::GetSqlStatementL(insertType);
	iInsertStmnt->SetParamL(KCommAddrId(), KCommAddrIdParam() );
	iInsertStmnt->SetParamL(KCommAddrContactId(), KCommAddrContactIdParam() );
	iInsertStmnt->SetParamL(KCommAddrValue(), KCommAddrValueParam() );
	iInsertStmnt->SetParamL(KCommAddrExtraValue(), KCommAddrExtraValueParam() );
	iInsertStmnt->SetParamL(KCommAddrType(), KCommAddrTypeParam() );
	iInsertStmnt->SetParamL(KCommAddrExtraTypeInfo(), KCommAddrExtraTypeInfoParam() );

	// SELECT

	// select all fields for all comm addrs for a particular item id
	// For a statement in the following format:
	// 	SELECT comm_addr_id, type, value, extra_value,extra_type_info FROM comm_addr
	//		WHERE contact_id = [contact id value];
	//
	iWholeSelectStmnt = TSqlProvider::GetSqlStatementL(selectType);
	iWholeSelectStmnt->SetParamL(KCommAddrId(), KNullDesC() );
	iWholeSelectStmnt->SetParamL(KCommAddrType(), KNullDesC() );
	iWholeSelectStmnt->SetParamL(KCommAddrValue(), KNullDesC() );
	iWholeSelectStmnt->SetParamL(KCommAddrExtraValue(), KNullDesC() );
	iWholeSelectStmnt->SetParamL(KCommAddrExtraTypeInfo(), KNullDesC() );
	iWholeSelectStmnt->SetConditionL(*whereContactIdClause);

	// select fields for contacts that match phone, email or SIP lookup
	// For a statement in the following format:
	// 	SELECT contact_id, extra_value FROM comm_addr
	//		WHERE value = [value string] AND type = [type value];
	//
	iMatchSelectStmnt = TSqlProvider::GetSqlStatementL(selectType);
	iMatchSelectStmnt->SetParamL(KCommAddrContactId(), KNullDesC() );
	iMatchSelectStmnt->SetParamL(KCommAddrExtraValue(), KNullDesC() );
	iMatchSelectStmnt->SetConditionL(*whereValueAndTypeClause);

	// UPDATE

	// update comm addr record
	// For a statement in the following format:
	// 	UPDATE comm_addr SET
	//		contact_id = [contact id value],
	//		type = [type value],
	//		value = [value string],
	//		extra_value = [extra value string]
	//      extra_type_info = [ extra type info ] 
	//		WHERE comm_addr_id = [comm addr id value];
	//
	iUpdateStmnt = TSqlProvider::GetSqlStatementL(updateType);
	iUpdateStmnt->SetParamL(KCommAddrContactId(), KCommAddrContactIdParam() );
	iUpdateStmnt->SetParamL(KCommAddrValue(), KCommAddrValueParam() );
	iUpdateStmnt->SetParamL(KCommAddrExtraValue(), KCommAddrExtraValueParam() );
	iUpdateStmnt->SetParamL(KCommAddrType(), KCommAddrTypeParam() );
	iUpdateStmnt->SetParamL(KCommAddrExtraTypeInfo(), KCommAddrExtraTypeInfoParam() );
	iUpdateStmnt->SetConditionL(*whereCommAddrIdClause);

	// DELETE

	// delete single comm addr record
	// For a statement in the following format:
	// 	DELETE FROM comm_addr WHERE comm_addr_id = [comm addr id value];
	//
	iSingleDeleteStmnt = TSqlProvider::GetSqlStatementL(deleteType);
	iSingleDeleteStmnt->SetConditionL(*whereCommAddrIdClause);

	// delete all comm addrs for a particular contact item
	// For a statement in the following format:
	// 	DELETE FROM comm_addr WHERE contact_id = [contact id value];
	//
	iAllForItemDeleteStmnt = TSqlProvider::GetSqlStatementL(deleteType);
	iAllForItemDeleteStmnt->SetConditionL(*whereContactIdClause);

	CleanupStack::PopAndDestroy(3, whereContactIdClause); // and whereCommAddrIdClause, whereValueAndTypeClause
	}
LRESULT CommandDlg::onType(WORD , WORD, HWND , BOOL& ) {
	updateType();
	updateCommand();
	updateControls();
	return 0;
}
void CommandDlg::handleTypeChanged() {
	updateType();
	updateCommand();
	updateControls();
}
Exemple #20
0
//-----------------------------------------------------------------------------
void GuiEditor::valueChanged (CControl* control)
{
	//effect->setParameterAutomated (control->getTag (), control->getValue ());

	float value;
	int ival;
	const char* text;
	std::string result;
	char* tempt;

	switch (control->getTag())
	{

		case kBufferSize:
			((COptionMenu*)(control))->getCurrent(tempt);
			ival = ((COptionMenu*)(control))->getIndex(tempt);
			updateBufferSize(ival);
			break;
	
		case kGain:
			value = control->getValue();
			result = floatToString(value*maxGain);
			gainDisplay->setText(result.c_str());
			updateGain(value*maxGain);
			break;

		case kGainText:
			text = ((CTextEdit*)(control))->getText();
			value = charToFloat(text);
			gainFader->setValue(value/(float)maxGain);
			updateGain(value);
			break;

		case kXScale:
			value = control->getValue();
			result = floatToString(value*maxXScale);
			xScaleDisplay->setText(result.c_str());
			updateXScale(value*maxXScale);
			break;

		case kXScaleText:
			text = ((CTextEdit*)(control))->getText();
			value = charToFloat(text);
			xScaleFader->setValue(value/(float)maxXScale);
			updateXScale(value);
			break;

		case kYScale:
			value = control->getValue();
			result = floatToString(value*maxYScale);
			yScaleDisplay->setText(result.c_str());
			updateYScale(value*maxYScale);
			break;

		case kYScaleText:
			text = ((CTextEdit*)(control))->getText();
			value = charToFloat(text);
			yScaleFader->setValue(value/(float)maxYScale);
			updateYScale(value);
			break;

		case kResponse:
			value = control->getValue();
			result = floatToString(value);
			responseDisplay->setText(result.c_str());
			updateResponse(value);
			break;

		case kResponseText:
			text = ((CTextEdit*)(control))->getText();
			value = charToFloat(text);
			responseFader->setValue(value);
			updateResponse(value);
			break;

		case kBands:
			ival = (int)(control->getValue()*maxBands);
			result = intToString(ival);
			bandsDisplay->setText(result.c_str());
			bandsFader->setValue(((float)ival)/(float)maxBands);
			updateBands(ival);
			break;

		case kBandsText:
			text = ((CTextEdit*)(control))->getText();
			ival = charToInt(text);
			bandsFader->setValue((float)value/(float)maxBands);
			updateBands(ival);
			break;

		case kAmpScale:
			((COptionMenu*)(control))->getCurrent(tempt);
			ival = ((COptionMenu*)(control))->getIndex(tempt);
			updateAmpScale(ival);
			break;

		case kType:
			((COptionMenu*)(control))->getCurrent(tempt);
			ival = ((COptionMenu*)(control))->getIndex(tempt);
			updateType(ival);
			break;

		case kDisplay:
			((COptionMenu*)(control))->getCurrent(tempt);
			ival = ((COptionMenu*)(control))->getIndex(tempt);
			updateDisplayt(ival);
			break;

		case kResampling:
			((COptionMenu*)(control))->getCurrent(tempt);
			ival = ((COptionMenu*)(control))->getIndex(tempt);
			updateResampling(ival);
			break;

		case kFreqScale:
			((COptionMenu*)(control))->getCurrent(tempt);
			ival = ((COptionMenu*)(control))->getIndex(tempt);
			updateFreqScale(ival);
			break;



		case kAddress:
			text = ((CTextEdit*)(control))->getText();
			updateAddress(text);
			break;

		case kPort:
			text = ((CTextEdit*)(control))->getText();
			ival = charToInt(text);
			updatePort(ival);
			break;

		case kHost:
			text = ((CTextEdit*)(control))->getText();
			updateHost(text);
			break;
	}

}