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; }
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; } }
/* 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; }
void clGUISlider::UpdateCVar() { if ( GetConsoleVariable() ) { GetConsoleVariable()->SetDouble( GetCurrentValue() ); } }
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(); } }
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; }
//------------------------------------------------------------------------------ void CGUIAsWidgetChildrenAlpha::ApplyValue( ) { GUI_ASSERT( GetReceiver(), "no receiver"); CGUIWidget* pChild = GetReceiver()->GetChild(); while( pChild ) { pChild->SetAlpha(GetCurrentValue()); pChild = pChild->GetNextSibling(); } }
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); }
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; }
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); }
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 ) ); } }
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; } } } }
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; } } } }
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; }
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; }
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; }
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; }
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; }
float ExportSettingsEntry::GetValueFloat() const { assert( m_Type == CT_BOUNDEDFLOATSLIDER ); auto pValue = reinterpret_cast<const float*>( GetCurrentValue() ); return *pValue; }
void ExportSettingsEntry::SetValue( float fValue ) { assert( m_Type == CT_BOUNDEDFLOATSLIDER ); auto pValue = reinterpret_cast<float*>( GetCurrentValue() ); *pValue = fValue; }
bool ExportSettingsEntry::GetValueBool() const { assert( m_Type == CT_CHECKBOX ); auto pValue = reinterpret_cast<const bool*>( GetCurrentValue() ); return *pValue; }
gfx::Rect Animation::CurrentValueBetween(const gfx::Rect& start_bounds, const gfx::Rect& target_bounds) const { return Tween::ValueBetween(GetCurrentValue(), start_bounds, target_bounds); }
//------------------------------------------------------------------------------ void CGUIAsWidgetScale::ApplyValue( ) { GUI_ASSERT( GetReceiver(), "no receiver"); GetReceiver()->SetScale(GetCurrentValue()); }
void clGUIGauge::Increment( int Delta ) { SetCurrentValue( GetCurrentValue() + Delta ); }
int getRSSILevel(){ return GetCurrentValue(); //return 0; }
INT ExportSettingsEntry::GetValueInt() const { assert( m_Type == CT_BOUNDEDINTSLIDER || m_Type == CT_ENUM ); auto pValue = reinterpret_cast<const INT*>( GetCurrentValue() ); return *pValue; }
bool ParSampVar::CheckLimits(int sampleNum) const { double dVal = GetCurrentValue(sampleNum); return (dVal >= minLim) && (dVal <= maxLim); }
//------------------------------------------------------------------------------ void CGUIAsWidgetRotation::ApplyValue( ) { GUI_ASSERT( GetReceiver(), "no receiver"); GetReceiver()->SetRotation(GetCurrentValue()); }