Пример #1
0
void CRoiDlg::OnKillfocusROIHeight()
{
    m_Roi.height = GetInt(&m_HeightEdit);
    m_Roi.y = GetInt(&m_YEdit);
    UpdateValue(m_Roi.height, 1, GetMaxHeight());
    UpdateValue(m_Roi.y, 0, GetMaxY(), &m_SpinY);
    UpdateData(FALSE);
}
Пример #2
0
TAstNode::ValueReturned TAstNodeForSentence::Execute() const
{
	auto secondChild = m_firstChild->GetSibling();
	auto thirdChild = secondChild->GetSibling();

	auto firstValue = m_firstChild->Execute();
	auto sencondValue = secondChild->Execute();
	//auto thirdValue = thirdChild->Execute();

	auto scope = GetScope();
	auto name = m_firstChild->GetFirstChild()->GetToken()->Name();
	auto type = TVariateManager::GetInstance()->GetVariateSrollUp(scope, name)->GetType();

	UpdateValue(type, scope, name, firstValue.value);
	
	if (GetValue(type, scope, name)<sencondValue.value)
	{
		Context::interpreterContext.SetNextNode(thirdChild->GetSibling().get());
	}
	else
	{
		Context::interpreterContext.SetNextNode(FindNextValidNode());
	}

	return ValueReturned{ 0, SYMBOL_TYPE::TYPE_VOID };
}
Пример #3
0
void EventDlg::UpdateColumnEntry(int iItem, int hcol, LPTSTR val)
{
	UINT icol =ImpEditCol::m_fileheadermap[hcol];  // see this garbage? a result of poor design
	CString s;

	if (ImpEditCol::eMeasType == icol)   // for string to numeric internal maps, handle the update differently
	{
		MEvent* pm = (MEvent*)m_List.GetItemData(iItem);
		if (pm)
		{
			CString szDisplayableResult;
			pm->UpdateMeasurementInfo(ImpEditCol::m_meacolmap[icol], val, szDisplayableResult);
			m_List.SetItemText(iItem,ImpEditCol::eMeasType,tMeasurementTypeImage((tMeasurementType)pm->m_vr._iMPMeasurementType));
		}	
	}
	else
	{
		if (UpdateValue(iItem , icol, val, s)) // icol is ImpEd enum
		{
			m_List.SetItemText(iItem , icol, s);
		}
	}


}
Пример #4
0
void XaLibDom::UpdateElementValueByXPath(xmlDocPtr XmlDomDoc, VectorXPathExpr XPathExpr, VectorXPathValue XPathValue) {

	if (XmlDomDoc != NULL) {
    
		if(XPathExpr.size()==XPathValue.size()){

			for(unsigned n=0; n<XPathExpr.size(); ++n) {

				string xpath=XPathExpr.at(n);
				string value=XPathValue.at(n);

				UpdateValue(XmlDomDoc, (const xmlChar *)xpath.c_str(),(const xmlChar *)value.c_str());
			}

			xmlXPathFreeObject(xpathObj);
			xmlXPathFreeContext(xpathCtx);

		} else{

			cout<<"wrong number of value and expression";
		}
	
	} else {
	}
};
Пример #5
0
void CMyEdit::OnKillFocus(CWnd* pNewWnd)
{
	if (m_nType == EditUnits)
		UpdateValue();

	CEdit::OnKillFocus(pNewWnd);
}
Пример #6
0
void COpenCVStitch2013Dlg::DoStitch()
{
	Mat stitched;
	vector<Mat> images;

	for (size_t i = 0; i < camera.size(); i++)
	{
		Mat image;
		camera[i] >> image;

		imshow(camera[i].GetName(), image);
		images.push_back(image);
	}
	if (2 <= camera.size())
	{
		int64 t = getTickCount();
		if (MyStitcher::Status::OK == stitcher.composePanorama(images, stitched)) {
			UpdateValue((getTickCount() - t) / getTickFrequency() * 1000);
			imshow(STITCHED, stitched);
			//if (writer.isOpened())
			//{
			//	writer << stitched;
			//}
		}
		else {
			MessageBox(L"内部処理でのエラー");
		}
		images.clear();
	}
	else
	{
		MessageBox(L"カメラが少ないためキャリブレートできません");
	}
}
Пример #7
0
void SetMine(context_t *ctxt, int x, int y)
{
    ctxt->board[y*ctxt->columns + x].value = MINE;
    int i;
    for(i = 0; i < 8; ++i)
        UpdateValue(ctxt, x+moveX[i], y+moveY[i]);
}
Пример #8
0
void ModifyXmlNodeValue(const char *NodeElement,char *NewValue)
{

	char *Value = NULL;
	char *Path = NULL;

	Value = malloc(sizeof(char) * (strlen(UDEVNAME) + strlen(NewValue) + 4));
	Path = malloc(sizeof(char) * (strlen(WEB_PATH) + strlen(DOC_NAME) + 2));
	memset(Path,0,sizeof(Path));
	memset(Value,0,sizeof(Value));

	strcpy(Value,UDEVNAME);
	strcat(Value,"(");
	strcat(Value,NewValue);//ip_address
	strcat(Value,")");

	strcpy(Path,WEB_PATH);
	strcat(Path,"/");
	strcat(Path,DOC_NAME);

	//path,  friendlyName
	UpdateValue(Path,NodeElement,Value);

	free(Path);
	Path = NULL;
	free(Value);
	Value = NULL;

	return;
}
Пример #9
0
void CMeter2DGraphView::valueChanged()
{
   if( model() )
   {
      UpdateValue();
   }
}
Пример #10
0
/*
============
idInternalCVar::Set
============
*/
void idInternalCVar::Set( const char *newValue, bool force, bool fromServer )
{
    if ( session && session->IsMultiplayer() && !fromServer )
    {
#ifndef ID_TYPEINFO
        if ( ( flags & CVAR_NETWORKSYNC ) && idAsyncNetwork::client.IsActive() )
        {
            common->Printf( "%s is a synced over the network and cannot be changed on a multiplayer client.\n", nameString.c_str() );
#if ID_ALLOW_CHEATS
            common->Printf( "ID_ALLOW_CHEATS override!\n" );
#else
            return;
#endif
        }
#endif
        if ( ( flags & CVAR_CHEAT ) && !cvarSystem->GetCVarBool( "net_allowCheats" ) )
        {
            common->Printf( "%s cannot be changed in multiplayer.\n", nameString.c_str() );
#if ID_ALLOW_CHEATS
            common->Printf( "ID_ALLOW_CHEATS override!\n" );
#else
            return;
#endif
        }
    }

    if ( !newValue )
    {
        newValue = resetString.c_str();
    }

    if ( !force )
    {
        if ( flags & CVAR_ROM )
        {
            common->Printf( "%s is read only.\n", nameString.c_str() );
            return;
        }

        if ( flags & CVAR_INIT )
        {
            common->Printf( "%s is write protected.\n", nameString.c_str() );
            return;
        }
    }

    if ( valueString.Icmp( newValue ) == 0 )
    {
        return;
    }

    valueString = newValue;
    value = valueString.c_str();
    UpdateValue();

    SetModified();
    cvarSystem->SetModifiedFlags( flags );
}
Пример #11
0
void SpinButton::KeyDown(const char *bytes, int32 numBytes)
{
    if (numBytes == 1) {
        if (bytes[0] == B_UP_ARROW) {
            UpdateValue(Value() + 1);
        }
        else if (bytes[0] == B_DOWN_ARROW) {
            UpdateValue(Value() - 1);
        }
        if (bytes[0] == B_PAGE_UP) {
            UpdateValue(Value() + fStepValue);
        }
        else if (bytes[0] == B_PAGE_DOWN) {
            UpdateValue(Value() - fStepValue);
        }
        else if (bytes[0] == B_HOME) {
            UpdateValue(fMaxValue);
        }
        else if (bytes[0] == B_END) {
            UpdateValue(fMinValue);
        }
        else if (bytes[0] == B_ENTER || bytes[0] == B_SPACE) {
            UpdateValue(fDefaultValue);
        }
        else {
            BControl::KeyDown(bytes, numBytes);
        }
    }
    else {
        BControl::KeyDown(bytes, numBytes);
    }
}
//++ ------------------------------------------------------------------------------------
// Details:	CMICmnLLDBDebugSessionInfoVarObj constructor.
// Type:	Method.
// Args:	vrStrNameReal	- (R) The actual name of the variable, the expression.
//			vrStrName		- (R) The name given for *this var object.
//			vrValue			- (R) The LLDB SBValue object represented by *this object.
// Return:	None.
// Throws:	None.
//--
CMICmnLLDBDebugSessionInfoVarObj::CMICmnLLDBDebugSessionInfoVarObj( const CMIUtilString & vrStrNameReal, const CMIUtilString & vrStrName, const lldb::SBValue & vrValue )
:	m_eVarFormat( eVarFormat_Natural )
,	m_eVarType( eVarType_Internal )
,	m_strName( vrStrName )
,	m_SBValue( vrValue )
,	m_strNameReal( vrStrNameReal )
{
	UpdateValue();
}
Пример #13
0
void SpinButton::MouseDown(BPoint point)
{
    if (IsEnabled()) {
        fButton = ButtonAt(point);
        if (fButton != kSpinButtonNone) {
            SetMouseEventMask(B_POINTER_EVENTS,
                              B_NO_POINTER_HISTORY | B_SUSPEND_VIEW_FOCUS);

            if (fButton == kSpinButtonUp)
                UpdateValue(Value() + 1);

            if (fButton == kSpinButtonDown)
                UpdateValue(Value() - 1);
        }
        fPoint = point;
    }
    BControl::MouseDown(point);
}
//++ ------------------------------------------------------------------------------------
// Details:	Set the var format type for *this object and upate the formatting.
// Type:	Method.
// Args:	None.
// Return:	MIstatus::success - Functional succeeded.
//			MIstatus::failure - Functional failed.
// Throws:	None.
//--
bool CMICmnLLDBDebugSessionInfoVarObj::SetVarFormat( const varFormat_e veVarFormat )
{
	if( veVarFormat >= eVarFormat_count )
		return MIstatus::failure;

	m_eVarFormat = veVarFormat;
	UpdateValue();
	return MIstatus::success;
}
void KMaterialUniformToolAlphaOperation::OnDeltaposSpinAlphabase(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
	m_dwAlphaTestValue = static_cast<DWORD>(LOWORD(m_ctlAlphaCmpBase.GetPos()));
	UpdateData(FALSE);

	UpdateValue();
	*pResult = 0;
}
Пример #16
0
//--------------------------------------------------------------------------------------
// Slot: Fuel scheme has changed
//--------------------------------------------------------------------------------------
void tVesselSetupDialog::OnFuelSchemeChanged(eFuelScheme fuelScheme)
{
    if( m_PowersteerAllowed )
    {
        if( UpdateValue(m_FuelScheme, fuelScheme) )
        {
            SetFuelScheme(m_FuelScheme);
        }
    }
}
Пример #17
0
void Motor::SetPinNegative(uint8_t pinNegative, bool resetPinMode)
{
	if (resetPinMode)
	{
		pinMode(this->pinNegative, INPUT);
	}
	this->pinNegative = pinNegative;
	pinMode(pinNegative, OUTPUT);
	UpdateValue();
}
void KMaterialUniformToolAlphaOperation::OnEnChangeEditAlphatestvalue()
{
	UpdateData(TRUE);
	m_dwAlphaTestValue = min(m_dwAlphaTestValue, 255);
	m_dwAlphaTestValue = max(0, m_dwAlphaTestValue);
	UpdateData(FALSE);
	m_ctlAlphaCmpBase.SetPos(m_dwAlphaTestValue);

	UpdateValue();
}
Пример #19
0
void Motor::SetPinHBridge(uint8_t pinHBridge, bool resetPinMode)
{
	if (resetPinMode && hasHBridge)
	{
		pinMode(this->pinHBridge, INPUT);
	}
	this->pinHBridge = pinHBridge;
	pinMode(pinHBridge, OUTPUT);
	hasHBridge = true;
	UpdateValue();
}
Пример #20
0
bool List::MoveIndex( int itemid, int direction )
{
	int swapitemid = itemid + (direction < 0 ? 1 : -1); //ListCtrl indices are logically in reverse (so up is down, and down is up)

	if( swapitemid < 0 || swapitemid >= list->GetItemCount() )
		return false;

	for( int i = 0; i < list->GetColumnCount(); ++i )
	{
		wxString v0 = GetColumnValue(itemid, i);
		wxString v1 = GetColumnValue(swapitemid, i);

		UpdateValue(itemid, i, v1);
		UpdateValue(swapitemid, i, v0);
	}

	list->SetItemState(swapitemid, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);

	return true;
}
Пример #21
0
void VCommand::UpdateValue(const VValueSingle& inValue, const ICommandListener* inExcept)
{
	VValueBag* bag = new VValueBag;
	if (bag != NULL)
	{
		bag->SetAttribute(CVSTR("__command_value__"), dynamic_cast<VValueSingle*>(inValue.Clone()));
		
		UpdateValue(bag, inExcept);

		bag->Release();
	}
}
Пример #22
0
int DropGrid::SetIndex(int n)
{
	int r = rowid;
	n = list.GetRowId(n);
	if(n >= 0)
	{
		list.SetCursor(n);
		UpdateValue();
		DoAction(n);
	}
	return r;
}
Пример #23
0
// Function name	: CPerfMon::GetCounterValue
// Description	    : return the value of the counter
// Return type		: long ; -999 on failed ; value on success
// Argument         : int nIndex
//
// R E V I S I O N S:
// DATE       PROGRAMMER      CHANGES
//
long CPerfMon::GetCounterValue(int nIndex)
{
	PPDHCOUNTERSTRUCT pCounter = GetCounterStruct(nIndex);
	if (!pCounter) return -999L;

	// update the value(s)
	if (!UpdateValue(pCounter)) return -999L;
	if (!UpdateRawValue(pCounter)) return -999L;

	// return the value
	return pCounter->lValue;
}
Пример #24
0
/*
============
idInternalCVar::Update
============
*/
void idInternalCVar::Update( const idCVar *cvar )
{

    // if this is a statically declared variable
    if ( cvar->GetFlags() & CVAR_STATIC )
    {

        if ( flags & CVAR_STATIC )
        {

            // the code has more than one static declaration of the same variable, make sure they have the same properties
            if ( resetString.Icmp( cvar->GetString() ) != 0 )
            {
                common->Warning( "CVar '%s' declared multiple times with different initial value", nameString.c_str() );
            }
            if ( ( flags & (CVAR_BOOL|CVAR_INTEGER|CVAR_FLOAT) ) != ( cvar->GetFlags() & (CVAR_BOOL|CVAR_INTEGER|CVAR_FLOAT) ) )
            {
                common->Warning( "CVar '%s' declared multiple times with different type", nameString.c_str() );
            }
            if ( valueMin != cvar->GetMinValue() || valueMax != cvar->GetMaxValue() )
            {
                common->Warning( "CVar '%s' declared multiple times with different minimum/maximum", nameString.c_str() );
            }

        }

        // the code is now specifying a variable that the user already set a value for, take the new value as the reset value
        resetString = cvar->GetString();
        descriptionString = cvar->GetDescription();
        description = descriptionString.c_str();
        valueMin = cvar->GetMinValue();
        valueMax = cvar->GetMaxValue();
        Mem_Free( valueStrings );
        valueStrings = CopyValueStrings( cvar->GetValueStrings() );
        valueCompletion = cvar->GetValueCompletion();
        UpdateValue();
        cvarSystem->SetModifiedFlags( cvar->GetFlags() );
    }

    flags |= cvar->GetFlags();

    UpdateCheat();

    // only allow one non-empty reset string without a warning
    if ( resetString.Length() == 0 )
    {
        resetString = cvar->GetString();
    }
    else if ( cvar->GetString()[0] && resetString.Cmp( cvar->GetString() ) != 0 )
    {
        common->Warning( "cvar \"%s\" given initial values: \"%s\" and \"%s\"\n", nameString.c_str(), resetString.c_str(), cvar->GetString() );
    }
}
Пример #25
0
	bool MenuElementSlider::MouseMotionEvent( const struct MouseMotionEvent &ev ) {
		if ( common.decorative ) {
			return false;
		}

		const bool mouseWithinBounds = vector2::PointWithinBounds(
			properties.centered ? common.position - properties.size / 2.0f : common.position,
			Client::cursorPos,
			properties.size
		);
		if ( mouseWithinBounds ) {
			tooltip.mouseHovering = true;
			tooltip.lastMousePos = Client::cursorPos;
		}
		else {
			tooltip.mouseHovering = false;
			if ( data.updatingValue ) {
				const real32_t cursorX = Client::cursorPos[0];
				const real32_t realPos = cursorX - common.position[0];
				const real32_t f = realPos / properties.size[0];
				UpdateValue( f );
				if ( !properties.postExecCommand.empty() ) {
					Command::Append( properties.postExecCommand.c_str() );
				}
			}
			data.updatingValue = false;
			return false;
		}

		if ( data.updatingValue ) {
			// find the fractional point we clicked at
			const real32_t cursorX = Client::cursorPos[0];
			const real32_t realPos = cursorX - common.position[0];
			const real32_t f = realPos / properties.size[0];

			UpdateValue( f );
		}

		return false;
	}
Пример #26
0
void COptionsDlg::OnLoggingButton() 
{
    UpdateData(TRUE); // get values from controls
    int level = _ttoi(m_LogLevel);
    if (level < 0)
        level = 0;
    if (level > 4)
        level = 4;
    int mask;
    int res = _stscanf(m_LogMask, _T("%X"), &mask);
    if (res <= 0 || res == EOF)
        mask = 0;
    CLoggingDlg dlg(level, mask);
    res = dlg.DoModal();
    if (res == IDCANCEL)
        return;
    m_LogLevel.Format(_T("%d"), dlg.GetLevel());
    m_LogMask.Format(_T("0x%04X"), dlg.GetMask());
    UpdateData(FALSE); // write to controls

#if 1
    UpdateValue(LOGLEVEL);
    UpdateValue(LOGMASK);
#else
    // FIXME: change in place...for now we just remove and re-add
    CButton *button = (CButton *) GetDlgItem(checkboxes[LOGLEVEL]);
    assert(button != NULL);
    if (button->GetCheck() > 0) {
        RemoveOption(LOGLEVEL);
        CheckOption(LOGLEVEL);
    }
    button = (CButton *) GetDlgItem(checkboxes[LOGMASK]);
    assert(button != NULL);
    if (button->GetCheck() > 0) {
        RemoveOption(LOGMASK);
        CheckOption(LOGMASK);
    }
#endif
}
Пример #27
0
void DropGrid::CancelUpdate()
{
	int prevrow = list.GetPrevCursor();
	if(prevrow >= 0)
	{
		list.SetCursor(prevrow);
		UpdateValue();
		rowid = list.GetRowId(prevrow);
		Refresh();
	}
	else
		ClearValue();
}
Пример #28
0
void DropGrid::SetData(const Value& v)
{
	int row = list.Find(v, key_col);
	if(row >= 0)
	{
		list.SetCursor(row);
		UpdateValue();
		DoAction(row, data_action, false);
		Refresh();
	}
	else
		ClearValue();
}
Пример #29
0
void SpinButton::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
{
    if (fButton != kSpinButtonNone) {
        int32 delta = int32(point.y - fPoint.y);
        if (delta <= -kSpinButtonThreshold || delta >= kSpinButtonThreshold) {
            UpdateValue(Value() + (delta < 0 ? fStepValue : -fStepValue));
            fPoint = point;
            fButton = kSpinButtonWheel;
            be_app->SetCursor(kVerticalResizeCursor);
        }
    }
    BControl::MouseMoved(point, transit, message);
}
Пример #30
0
void SpinButton::MessageReceived(BMessage *message)
{
#if B_BEOS_VERSION >= 0x0500
    if (message->what == B_MOUSE_WHEEL_CHANGED) {
        float delta = message->FindFloat("be:wheel_delta_y");
        UpdateValue(Value() + (delta < 0 ? fStepValue : -fStepValue));
    }
    else {
        BControl::MessageReceived(message);
    }
#else
    BControl::MessageReceived(message);
#endif
}