Пример #1
0
const HashMap<String, String> *DatabaseQueryResult::FetchRow()
{
	if (EndOfRow())
		return nullptr; // Error!

	m_mapRow.Clear();
	for (int i=0; i<m_nColumn; i++)
		m_mapRow.Add(GetFieldName(i), !GetCurrentValue(i) ? "" : GetCurrentValue(i));
	IncRow();

	// Return a pointer to the row map
	return &m_mapRow;
}
Пример #2
0
    void ExportSettingsEntry::SetValue( INT iValue )
    {
        assert( m_Type == CT_BOUNDEDINTSLIDER || m_Type == CT_CHECKBOX || m_Type == CT_ENUM );

        if ( m_CurrentValue.m_Type == ExportVariant::VT_BOOL )
        {
            auto pValue = reinterpret_cast<bool*>( GetCurrentValue() );
            *pValue = iValue ? true : false;
        }
        else
        {
            auto pValue = reinterpret_cast<INT*>( GetCurrentValue() );
            *pValue = iValue;
        }
    }
Пример #3
0
/*
int i: either the number of existing watches minus 1, or the index of the watch to edit.
*/
bool InsertWatch(const AddressWatcher& Watch, char *Comment, int i)
{

	if (i == WatchCount) // append new watch
	{
		if(!VerifyWatchNotAlreadyAdded(Watch))
			return false;
		if(WatchCount >= MAX_WATCH_COUNT)
			return false;

		WatchCount++;
	}
	else // replace existing watch
	{
		// TODO: minor bug: we have not checked that they haven't changed the address to an already-existing watch.
		//       We can't just use VerifyWatchNotAlreadyAdded because doing so doesn't let us keep the same address but change the comment.
		free(rswatches[i].comment);
	}
	AddressWatcher& NewWatch = rswatches[i];
	NewWatch = Watch;
	NewWatch.comment = (char *) malloc(strlen(Comment)+2);
	NewWatch.CurValue = GetCurrentValue(NewWatch);
	strcpy(NewWatch.comment, Comment);
	ListView_SetItemCount(GetDlgItem(RamWatchHWnd,IDC_WATCHLIST),WatchCount);
	RWfileChanged=true;

	return true;
}
NS_IMETHODIMP
ProgressMeterAccessible<Max>::GetValue(nsAString& aValue)
{
  nsresult rv = nsFormControlAccessible::GetValue(aValue);
  NS_ENSURE_SUCCESS(rv, rv);

  if (!aValue.IsEmpty())
    return NS_OK;

  double maxValue = 0;
  rv = GetMaximumValue(&maxValue);
  NS_ENSURE_SUCCESS(rv, rv);

  double curValue = 0;
  rv = GetCurrentValue(&curValue);
  NS_ENSURE_SUCCESS(rv, rv);

  // Treat the current value bigger than maximum as 100%.
  double percentValue = (curValue < maxValue) ?
    (curValue / maxValue) * 100 : 100;

  nsAutoString value;
  value.AppendFloat(percentValue); // AppendFloat isn't available on nsAString
  value.AppendLiteral("%");
  aValue = value;
  return NS_OK;
}
NS_IMETHODIMP
nsXULProgressMeterAccessible::GetValue(nsAString& aValue)
{
  nsresult rv = nsFormControlAccessible::GetValue(aValue);
  NS_ENSURE_SUCCESS(rv, rv);

  if (!aValue.IsEmpty())
    return NS_OK;

  double maxValue = 0;
  rv = GetMaximumValue(&maxValue);
  NS_ENSURE_SUCCESS(rv, rv);

  if (maxValue != 1) {
    double curValue = 0;
    rv = GetCurrentValue(&curValue);
    NS_ENSURE_SUCCESS(rv, rv);

    double percentValue = (curValue / maxValue) * 100;
    nsAutoString value;
    value.AppendFloat(percentValue); // AppendFloat isn't available on nsAString
    value.AppendLiteral("%");
    aValue = value;
    return NS_OK;
  }

  mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::value, aValue);
  if (aValue.IsEmpty())
    aValue.AppendLiteral("0");  // Empty value for progress meter = 0%

  aValue.AppendLiteral("%");
  return NS_OK;
}
Пример #6
0
void clGUISlider::UpdateCVar()
{
	if ( GetConsoleVariable() )
	{
		GetConsoleVariable()->SetDouble( GetCurrentValue() );
	}
}
Пример #7
0
void DoubleAnimation::OnMeasure(suic::FrameworkElement* pElem)
{
    if (_isEndOf)
    {
        return;
    }

    double dValue = GetCurrentValue();

    pElem->SetValue(_property, new suic::ODouble(dValue));

    if (GetRelayout())
    {
        if (pElem->GetParent())
        {
            pElem->GetParent()->UpdateLayout();
        }
        else
        {
            pElem->UpdateLayout();
        }
    }
    else
    {
        pElem->InvalidateVisual();
    }
}
Пример #8
0
bool InsertWatch(const AddressWatcher& Watch, char *Comment, int atIndex)
{
	if(!VerifyWatchNotAlreadyAdded(Watch))
		return false;

	if(WatchCount >= MAX_WATCH_COUNT)
		return false;

	int i = WatchCount;
	if(atIndex == -1) {}
	else
	{
		//move watches down
		i = atIndex;
		for(int x=WatchCount;x>atIndex;x--)
			rswatches[x] = rswatches[x-1];
	}
	WatchCount++;
	AddressWatcher& NewWatch = rswatches[i];
	NewWatch = Watch;
	//if (NewWatch.comment) free(NewWatch.comment);
	NewWatch.comment = (char *) malloc(strlen(Comment)+2);
	NewWatch.CurValue = GetCurrentValue(NewWatch);
	strcpy(NewWatch.comment, Comment);
	ListView_SetItemCount(GetDlgItem(RamWatchHWnd,IDC_WATCHLIST),WatchCount);
	RWfileChanged=true;

	return true;
}
Пример #9
0
	//------------------------------------------------------------------------------
	void CGUIAsWidgetChildrenAlpha::ApplyValue( )
	{
		GUI_ASSERT( GetReceiver(), "no receiver");
		CGUIWidget* pChild = GetReceiver()->GetChild();
		while( pChild )
		{
			pChild->SetAlpha(GetCurrentValue());
			pChild = pChild->GetNextSibling();
		}
	}
Пример #10
0
void  DSC_RealMSSpec::DoCheck(const char*      specID,
                              FuncObjC&        specFO)
{
    valueDO.Reset(valueID);
    if ((!valueIsMaster) && specFO.CheckInputFO(valueMasterObjRef,  specID))
        slaveRealValue  = (static_cast<DO_Real*> (specFO.GetInPortData(valueMasterObjRef)))->realVal;

    valueDO.realVal = GetCurrentValue();
    valueDO.SetValueLabel(valueDO.realVal);
}
Пример #11
0
double  DSC_RealMSSpec::GetLimitedValue(const double& minVal,
                                        const double& maxVal) const
{
    double temp = GetCurrentValue();
    if (temp < minVal)
        temp = minVal;
    if (temp > maxVal)
        temp = maxVal;
    return temp;
}
Пример #12
0
unsigned int GpTimer::GetMicrosUntilFire(void)
{
	unsigned int current = 0xffffffff - GetCurrentValue();

	if (m_whichTimer == 1)
		//1/32.768 = 1 us
		return (unsigned int)(current * 32.768f);
	else
		//38.4 = 1 us
		return (unsigned int)(current / 38.4f);
}
Пример #13
0
void clGUISlider::PostRender()
{
	clGUIPanel::PostRender();

	UpdateUniformsV( FSlideBarShader, GetSliderCoords() );

	Env->Renderer->AddBuffer( FSlideBarGeometry, FSlideBarShader, 1, false );

	if ( FShowValue )
	{
		OutTextXY( 0.0, 0.0, LStr::ToStr( GetCurrentValue() ), LVector4( 1.0f, 0.0f, 0.0f, 0.5f ) );
	}
}
Пример #14
0
void Update_RAM_Watch()
{
	BOOL watchChanged[MAX_WATCH_COUNT] = {0};

	if(WatchCount)
	{
		// update cached values and detect changes to displayed listview items

		EnterCriticalSection(&g_processMemCS);
		for(int i = 0; i < WatchCount; i++)
		{
			RSVal prevCurValue = rswatches[i].CurValue;
			RSVal newCurValue = GetCurrentValue(rswatches[i]);
			if(!prevCurValue.CheckBinaryEquality(newCurValue))
			{
				rswatches[i].CurValue = newCurValue;
				watchChanged[i] = TRUE;
			}
		}
		LeaveCriticalSection(&g_processMemCS);
	}

	// refresh any visible parts of the listview box that changed
	HWND lv = GetDlgItem(RamWatchHWnd,IDC_WATCHLIST);
	int top = ListView_GetTopIndex(lv);
	int bottom = top + ListView_GetCountPerPage(lv) + 1; // +1 is so we will update a partially-displayed last item
	if(top < 0) top = 0;
	if(bottom > WatchCount) bottom = WatchCount;
	int start = -1;
	for(int i = top; i <= bottom; i++)
	{
		if(start == -1)
		{
			if(i != bottom && watchChanged[i])
			{
				start = i;
				//somethingChanged = true;
			}
		}
		else
		{
			if(i == bottom || !watchChanged[i])
			{
				ListView_RedrawItems(lv, start, i-1);
				start = -1;
			}
		}
	}
}
Пример #15
0
extern "C" void Update_RAM_Watch()
{
	if (!RamWatchHWnd) return;
	
	HWND lv;
	int top;
	int bottom;
	int start;
	int i;
	// update cached values and detect changes to displayed listview items
	int watchChanged[MAX_WATCH_COUNT] = {0};
	for(i = 0; i < WatchCount; i++)
	{
		unsigned int prevCurValue = rswatches[i].CurValue;
		unsigned int newCurValue = GetCurrentValue(&rswatches[i]);
		if(prevCurValue != newCurValue)
		{
			rswatches[i].CurValue = newCurValue;
			watchChanged[i] = 1;
		}
	}

	// refresh any visible parts of the listview box that changed
	lv = GetDlgItem(RamWatchHWnd,IDC_WATCHLIST);
	top = ListView_GetTopIndex(lv);
	bottom = top + ListView_GetCountPerPage(lv) + 1; // +1 is so we will update a partially-displayed last item
	if(top < 0) top = 0;
	if(bottom > WatchCount) bottom = WatchCount;
	start = -1;
	for(i = top; i <= bottom; i++)
	{
		if(start == -1)
		{
			if(i != bottom && watchChanged[i])
			{
				start = i;
				//somethingChanged = 1;
			}
		}
		else
		{
			if(i == bottom || !watchChanged[i])
			{
				ListView_RedrawItems(lv, start, i-1);
				start = -1;
			}
		}
	}
}
Пример #16
0
bool InsertWatch(const AddressWatcher& Watch, HWND parent)
{
	if(!VerifyWatchNotAlreadyAdded(Watch))
		return false;

	if(!parent)
		parent = RamWatchHWnd;
	if(!parent)
		parent = MainWindow->getHWnd();

	int prevWatchCount = WatchCount;

	rswatches[WatchCount] = Watch;
	rswatches[WatchCount].CurValue = GetCurrentValue(rswatches[WatchCount]);
	DialogBox(hAppInst, MAKEINTRESOURCE(IDD_PROMPT), parent, (DLGPROC) PromptWatchNameProc);

	return WatchCount > prevWatchCount;
}
Пример #17
0
bool InsertWatch(const AddressWatcher& Watch, HWND parent)
{
	if(!VerifyWatchNotAlreadyAdded(Watch))
		return false;

	if(!parent)
		parent = RamWatchHWnd;
	if(!parent)
		parent = hWnd;

	int prevWatchCount = WatchCount;

	rswatches[WatchCount] = Watch;
	EnterCriticalSection(&g_processMemCS);
	rswatches[WatchCount].CurValue = GetCurrentValue(rswatches[WatchCount]);
	LeaveCriticalSection(&g_processMemCS);
	DialogBox(hInst, MAKEINTRESOURCE(IDD_PROMPT), parent, (DLGPROC) PromptWatchNameProc);

	return WatchCount > prevWatchCount;
}
Пример #18
0
int InsertWatchHwnd(const struct AddressWatcher *Watch, HWND parent)
{
	int prevWatchCount;

	if(!VerifyWatchNotAlreadyAdded(Watch))
		return 0;

	if(!parent)
		parent = RamWatchHWnd;
	if(!parent)
		parent = YabWin;

	prevWatchCount = WatchCount;

	rswatches[WatchCount] = *Watch;
	rswatches[WatchCount].CurValue = GetCurrentValue(&rswatches[WatchCount]);
	DialogBox(y_hInstance, MAKEINTRESOURCE(IDD_PROMPT), parent, (DLGPROC) PromptWatchNameProc);

	return WatchCount > prevWatchCount;
}
Пример #19
0
bool InsertWatch(const AddressWatcher& Watch, LPCSTR Comment)
{
	if(!VerifyWatchNotAlreadyAdded(Watch))
		return false;

	if(WatchCount >= MAX_WATCH_COUNT)
		return false;

	int i = WatchCount++;
	AddressWatcher& NewWatch = rswatches[i];
	NewWatch = Watch;
	//if(NewWatch.comment) free(NewWatch.comment);
	NewWatch.comment = (char *) malloc(strlen(Comment)+2);
	EnterCriticalSection(&g_processMemCS);
	NewWatch.CurValue = GetCurrentValue(NewWatch);
	LeaveCriticalSection(&g_processMemCS);
	strcpy(NewWatch.comment, Comment);
	ListView_SetItemCount(GetDlgItem(RamWatchHWnd,IDC_WATCHLIST),WatchCount);
	RWfileChanged=true;

	return true;
}
Пример #20
0
int InsertWatch(const struct AddressWatcher *Watch, char *Comment)
{
	int i;
	struct AddressWatcher *NewWatch;

	if(!VerifyWatchNotAlreadyAdded(Watch))
		return 0;

	if(WatchCount >= MAX_WATCH_COUNT)
		return 0;

	i = WatchCount++;

	NewWatch = &rswatches[i];
	//	NewWatch = Watch;
//	if (NewWatch->comment) free(NewWatch->comment);
	NewWatch->comment = (char *) malloc(strlen(Comment)+2);
	NewWatch->CurValue = GetCurrentValue((AddressWatcher*)Watch);;//Watch->CurValue;//GetCurrentValue(NewWatch);
	NewWatch->Address = Watch->Address;
	NewWatch->Size = Watch->Size;
	NewWatch->Type = Watch->Type;

	strcpy(NewWatch->comment, Comment);
	ListView_SetItemCount(GetDlgItem(RamWatchHWnd,IDC_WATCHLIST),WatchCount);
	RWfileChanged=1;

	/*
	NewWatch = rswatches[i];
	NewWatch = Watch;
	//if (NewWatch.comment) free(NewWatch.comment);
	NewWatch->comment = (char *) malloc(strlen(Comment)+2);
	NewWatch->CurValue = GetCurrentValue(NewWatch);
	strcpy(NewWatch->comment, Comment);
	ListView_SetItemCount(GetDlgItem(RamWatchHWnd,IDC_WATCHLIST),WatchCount);
	RWfileChanged=1;
	*/
	return 1;
}
Пример #21
0
 float ExportSettingsEntry::GetValueFloat() const
 {
     assert( m_Type == CT_BOUNDEDFLOATSLIDER );
     auto pValue = reinterpret_cast<const float*>( GetCurrentValue() );
     return *pValue;
 }
Пример #22
0
 void ExportSettingsEntry::SetValue( float fValue )
 {
     assert( m_Type == CT_BOUNDEDFLOATSLIDER );
     auto pValue = reinterpret_cast<float*>( GetCurrentValue() );
     *pValue = fValue;
 }
Пример #23
0
 bool ExportSettingsEntry::GetValueBool() const
 {
     assert( m_Type == CT_CHECKBOX );
     auto pValue = reinterpret_cast<const bool*>( GetCurrentValue() );
     return *pValue;
 }
Пример #24
0
 gfx::Rect Animation::CurrentValueBetween(const gfx::Rect& start_bounds,
     const gfx::Rect& target_bounds) const
 {
     return Tween::ValueBetween(GetCurrentValue(), start_bounds, target_bounds);
 }
Пример #25
0
	//------------------------------------------------------------------------------
	void CGUIAsWidgetScale::ApplyValue( )
	{
		GUI_ASSERT( GetReceiver(), "no receiver");
		GetReceiver()->SetScale(GetCurrentValue());
	}
Пример #26
0
void clGUIGauge::Increment( int Delta )
{
	SetCurrentValue( GetCurrentValue() + Delta );
}
Пример #27
0
	int getRSSILevel(){
		return GetCurrentValue();
		//return 0;
	}
Пример #28
0
 INT ExportSettingsEntry::GetValueInt() const
 {
     assert( m_Type == CT_BOUNDEDINTSLIDER || m_Type == CT_ENUM );
     auto pValue = reinterpret_cast<const INT*>( GetCurrentValue() );
     return *pValue;
 }
Пример #29
0
bool ParSampVar::CheckLimits(int sampleNum) const
{
  double dVal = GetCurrentValue(sampleNum);
  return (dVal >= minLim) && (dVal <= maxLim);
}
Пример #30
0
	//------------------------------------------------------------------------------
	void CGUIAsWidgetRotation::ApplyValue( )
	{
		GUI_ASSERT( GetReceiver(), "no receiver");
		GetReceiver()->SetRotation(GetCurrentValue());
	}