bool CBratSettings::LoadConfig() { return base_t::LoadConfig() && ReadSection( GROUP_COMMON, k_v( ENTRY_LAST_DATA_PATH, &m_lastDataPath ), k_v( ENTRY_LAST_PAGE_REACHED, &m_lastPageReached ), k_v( ENTRY_ADVANCED_OPERATIONS, &mAdvancedOperations, false ), k_v( ENTRY_LOAD_WKSPC_AT_STARTUP, &mLoadLastWorkspaceAtStartUp ), k_v( ENTRY_MAIN_LAYER_BASE_TYPE, (int*)&mMainLayerBaseType, (int)smDefaultLayerBaseType ), k_v( ENTRY_VIEWS_LAYER_BASE_TYPE, (int*)&mViewsLayerBaseType, (int)smDefaultLayerBaseType ), k_v( ENTRY_VECTOR_SIMPLIFY_METHOD, &mVectorSimplifyMethod, true ), k_v( ENTRY_DESKTOP_MANAGER_SDI, &mDesktopManagerSdi, true ), k_v( ENTRY_CHECK_OPENGL, &mCheckOpenGL, true ) ) && ReadValues( GROUP_WKS, { { ENTRY_LAST, m_lastWksPath }, } ) && ReadValues( GROUP_COLORTABLE, { { ENTRY_LAST, m_lastColorTable }, } ) && LoadPaths(); }
bool dlgTaskPointShowModal(OrderedTask **task, const unsigned index) { ordered_task = *task; task_modified = false; active_index = index; wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(), Layout::landscape ? _T("IDR_XML_TASKPOINT_L") : _T("IDR_XML_TASKPOINT")); assert(wf != nullptr); wTaskView = (WndFrame*)wf->FindByName(_T("frmTaskView")); assert(wTaskView != nullptr); dock = (DockWindow *)wf->FindByName(_T("properties")); assert(dock != nullptr); RefreshView(); if (wf->ShowModal() == mrOK) ReadValues(); delete wf; if (*task != ordered_task) { *task = ordered_task; task_modified = true; } if (task_modified) { ordered_task->ClearName(); ordered_task->UpdateGeometry(); } return task_modified; }
bool PDBFileObject::GetIntegerArray(const char *name, int **i, int *nvals) { int *dims = 0; int nDims = 0; int length = 0; TypeEnum t = NO_TYPE; // Initially set the return value to zero. *i = 0; *nvals = 0; if(AutoOpen()) { // Read the variable. void *val = ReadValues(name, &t, &length, &dims, &nDims); // Set up the return array. if(val) { free_mem(dims); if(t == INTEGER_TYPE || t == INTEGERARRAY_TYPE) { *i = (int *)val; *nvals = length; } else pdb_free_void_mem(val, t); } } return *i != 0; }
static void OnOZLineLengthData(gcc_unused DataField *Sender, gcc_unused DataField::DataAccessKind_t Mode) { if (!Refreshing) ReadValues(); wTaskView->invalidate(); }
static void OnOZSectorFinishRadialData(gcc_unused DataField *Sender, gcc_unused DataField::DataAccessKind_t Mode) { if (!Refreshing) ReadValues(); wTaskView->invalidate(); }
void ConfigTestCase::RecordingDefaultsTest() { wxString app = wxT("wxConfigTestCaseRD"); wxString vendor = wxT("wxWidgets"); wxConfig *config = new wxConfig(app, vendor, wxT(""), wxT(""), wxCONFIG_USE_LOCAL_FILE); config->DeleteAll(); config->SetRecordDefaults(false); // by default it is false ReadValues(config, false); CPPUNIT_ASSERT_EQUAL( 0, config->GetNumberOfEntries() ); config->SetRecordDefaults(true); int read = ReadValues(config, false); CPPUNIT_ASSERT_EQUAL( read, config->GetNumberOfEntries() ); ReadValues(config, true); config->DeleteAll(); delete config; }
bool TaskPropertiesPanel::Leave() { ReadValues(); if (orig_taskType != ordered_task->GetFactoryType()) ordered_task->GetFactory().MutateTPsToTaskType(); return true; }
static void OnNextClicked() { if (active_index >= ordered_task->TaskSize() - 1 || !ReadValues()) return; ++active_index; RefreshView(); }
static void OnPreviousClicked() { if (active_index == 0 || !ReadValues()) return; --active_index; RefreshView(); }
inline void TaskPointWidget::OnPreviousClicked() { if (active_index == 0 || !ReadValues()) return; --active_index; RefreshView(); }
inline void TaskPointWidget::OnNextClicked() { if (active_index >= ordered_task.TaskSize() - 1 || !ReadValues()) return; ++active_index; RefreshView(); }
bool pnlTaskProperties::OnTabPreHide() { ReadValues(); if (orig_taskType != ordered_task->get_factory_type()) ordered_task->get_factory().mutate_tps_to_task_type(); return true; }
//-------------------------------------------------- // UnSerialize face data // void UnSerializeFace( MessageBuffer * pmb, int facenum, int iSource ) { int i, n; dface_t * f = &g_pFaces[facenum]; facelight_t * fl = &facelight[facenum]; if (pmb->read(f, sizeof(dface_t)) < 0) Error("UnSerializeFace - invalid dface_t from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() ); if (pmb->read(fl, sizeof(facelight_t)) < 0) Error("UnSerializeFace - invalid facelight_t from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() ); fl->sample = (sample_t *) calloc(fl->numsamples, sizeof(sample_t)); if (pmb->read(fl->sample, sizeof(sample_t) * fl->numsamples) < 0) Error("UnSerializeFace - invalid sample_t from %s (mb len: %d, offset: %d, fl->numsamples: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset(), fl->numsamples ); // // Read the light information // for (i=0; i<MAXLIGHTMAPS; ++i) { for (n=0; n<NUM_BUMP_VECTS+1; ++n) { if (fl->light[i][n]) { fl->light[i][n] = (LightingValue_t *) calloc( fl->numsamples, sizeof(LightingValue_t ) ); if ( ReadValues( pmb, fl->light[i][n], fl->numsamples) < 0) Error("UnSerializeFace - invalid fl->light from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() ); } } } if (fl->luxel) { fl->luxel = (Vector *) calloc(fl->numluxels, sizeof(Vector)); if (ReadValues( pmb, fl->luxel, fl->numluxels) < 0) Error("UnSerializeFace - invalid fl->luxel from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() ); } if (fl->luxelNormals) { fl->luxelNormals = (Vector *) calloc(fl->numluxels, sizeof( Vector )); if ( ReadValues( pmb, fl->luxelNormals, fl->numluxels) < 0) Error("UnSerializeFace - invalid fl->luxelNormals from %s (mb len: %d, offset: %d)", VMPI_GetMachineName( iSource ), pmb->getLen(), pmb->getOffset() ); } }
void TaskPropertiesPanel::OnTaskTypeChange(DataFieldEnum &df) { const TaskFactoryType newtype = (TaskFactoryType)df.GetAsInteger(); if (newtype != ordered_task->GetFactoryType()) { ReadValues(); ordered_task->SetFactory(newtype); *task_changed =true; RefreshView(); } }
static void OnAATEnabled(DataField *Sender, DataField::DataAccessKind_t Mode) { switch(Mode){ case DataField::daGet: break; case DataField::daPut: case DataField::daChange: ReadValues(); SetValues(); GetWaypointValues(); SetWaypointValues(); break; } }
void pnlTaskProperties::OnTaskTypeData(DataField *Sender, DataField::DataAccessKind_t Mode) { if (Mode == DataField::daChange) { const DataFieldEnum &df = *(DataFieldEnum *)Sender; const TaskBehaviour::Factory_t newtype = (TaskBehaviour::Factory_t)df.GetAsInteger(); if (newtype != ordered_task->get_factory_type()) { ReadValues(); ordered_task->set_factory(newtype); *task_changed =true; RefreshView(); } } }
bool PDBFileObject::GetDoubleArray(const char *name, double **d, int *nvals) { int *dims = 0; int nDims = 0; int length = 0; TypeEnum t = NO_TYPE; // Initially set the return value to zero. *d = 0; *nvals = 0; if(AutoOpen()) { // Read the variable. void *val = ReadValues(name, &t, &length, &dims, &nDims); // Set up the return array. if(val) { free_mem(dims); if(t == DOUBLE_TYPE || t == DOUBLEARRAY_TYPE) { *d = (double *)val; *nvals = length; } else if(t == FLOAT_TYPE || t == FLOATARRAY_TYPE) { float *fptr = (float *)val; double *dstorage = new double[length]; double *dptr = dstorage; for(int i = 0; i < length; ++i) *dptr++ = double(*fptr++); pdb_free_void_mem(val, t); *d = dstorage; *nvals = length; } else pdb_free_void_mem(val, t); } } return *d != 0; }
bool dlgTaskPointShowModal(SingleWindow &parent, OrderedTask** task, const unsigned index) { ordered_task = *task; task_modified = false; active_index = index; wf = LoadDialog(CallBackTable, parent, Layout::landscape ? _T("IDR_XML_TASKPOINT_L") : _T("IDR_XML_TASKPOINT")); assert(wf != NULL); wTaskView = (WndFrame*)wf->FindByName(_T("frmTaskView")); assert(wTaskView != NULL); WndFrame* wType = (WndFrame*) wf->FindByName(_T("lblType")); assert (wType); wType->SetFont(Fonts::MapBold); WndFrame* wLocation = (WndFrame*) wf->FindByName(_T("lblLocation")); assert (wLocation); wLocation->SetFont(Fonts::MapBold); do { RefreshView(); next_previous=0; if (wf->ShowModal() == mrOK) ReadValues(); active_index += next_previous; } while (next_previous != 0); delete wf; if (*task != ordered_task) { *task = ordered_task; task_modified = true; } if (task_modified) { ordered_task->update_geometry(); } return task_modified; }
static void OnTaskPointPicto(WindowControl * Sender, LKSurface& Surface) { (void) Sender; WndFrame *wPicto = ((WndFrame *) wf->FindByName(TEXT("frmTaskPointPicto"))); if(wPicto) { /********************/ ReadValues(); GetWaypointValues(); // CalculateTaskSectors(); // if (AATEnabled) // CalculateAATTaskSectors(); RefreshTask(); /*******************/ const RECT rc = wPicto->GetClientRect(); MapWindow::DrawWaypointPictoBg(Surface, rc); MapWindow::DrawTaskPicto(Surface, twItemIndex, rc, 2000); } }
bool PDBFileObject::GetString(const char *name, char **str, int *len) { int *dims = 0; int nDims = 0; int length = 0; TypeEnum t = NO_TYPE; // Initially set the return value to zero. *str = 0; if(AutoOpen()) { // Read the variable. void *val = ReadValues(name, &t, &length, &dims, &nDims, 1); // Set up the return array. if(val) { free_mem(dims); if(t == CHAR_TYPE || t == CHARARRAY_TYPE) { *str = (char *)val; // We allocated the array so it can hold the extra // character required for a NULL terminator. (*str)[length] = '\0'; if(len != 0) *len = length; } else pdb_free_void_mem(val, t); } } return *str != 0; }
void TaskPointWidget::OnModified(ObservationZoneEditWidget &widget) { ReadValues(); map.Invalidate(); }
void Config::Reload() { LoadINI(DefaultINI::sdl2_config_file); ReadValues(); }
bool Save(bool &changed) override { ReadValues(); changed = task_modified; return true; }
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){ wf = NULL; if (!ScreenLandscape) { char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgTaskWaypoint_L.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_TASKWAYPOINT_L")); } else { char filename[MAX_PATH]; LocalPathS(filename, TEXT("dlgTaskWaypoint.xml")); wf = dlgLoadFromXML(CallBackTable, filename, hWndMainWindow, TEXT("IDR_XML_TASKWAYPOINT")); } if (ISPARAGLIDER) { if(DoOptimizeRoute()) AATEnabled=TRUE; EnableMultipleStartPoints=false; } twItemIndex = itemindex; twType = tasktype; if (!wf) return; //ASSERT(wf!=NULL); // wf->SetKeyDownNotify(FormKeyDown); wStart = ((WndFrame *)wf->FindByName(TEXT("frmStart"))); wTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmTurnpoint"))); wAATTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmAATTurnpoint"))); wFinish = ((WndFrame *)wf->FindByName(TEXT("frmFinish"))); //ASSERT(wStart!=NULL); //ASSERT(wTurnpoint!=NULL); //ASSERT(wAATTurnpoint!=NULL); //ASSERT(wFinish!=NULL); WndButton* wb; if (addonly) { wb = (WndButton *)wf->FindByName(TEXT("butSelect")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butRemove")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butDetails")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butDown")); if (wb) { wb->SetVisible(false); } wb = (WndButton *)wf->FindByName(TEXT("butUp")); if (wb) { wb->SetVisible(false); } } else { if (!ValidTaskPoint(twItemIndex-1)) { wb = (WndButton *)wf->FindByName(TEXT("butUp")); if (wb) { wb->SetVisible(false); } } if (!ValidTaskPoint(twItemIndex+1)) { wb = (WndButton *)wf->FindByName(TEXT("butDown")); if (wb) { wb->SetVisible(false); } } } SetWaypointValues(true); switch (twType) { case 0: wStart->SetVisible(1); wTurnpoint->SetVisible(0); wAATTurnpoint->SetVisible(0); wFinish->SetVisible(0); break; case 1: wStart->SetVisible(0); if (AATEnabled) { wTurnpoint->SetVisible(0); wAATTurnpoint->SetVisible(1); } else { wTurnpoint->SetVisible(1); wAATTurnpoint->SetVisible(0); } wFinish->SetVisible(0); break; case 2: wStart->SetVisible(0); wTurnpoint->SetVisible(0); wAATTurnpoint->SetVisible(0); wFinish->SetVisible(1); break; } // set properties... SetValues(true); UpdateCaption(); wf->ShowModal(); // now retrieve changes GetWaypointValues(); ReadValues(); delete wf; wf = NULL; }
void Config::Reload() { ReadValues(); }
TFileVersionInfo::TFileVersionInfo(String fname) { ReadValues(fname); }
void Config::Reload() { LoadINI(glfw_config, glfw_config_loc.c_str(), DefaultINI::glfw_config_file); ReadValues(); }
void TPOZListener::OnModified(ObservationZoneEditWidget &widget) { ReadValues(); wTaskView->Invalidate(); }
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){ wf = NULL; if (!Layout::landscape) { wf = dlgLoadFromXML(CallBackTable, _T("dlgTaskWaypoint_L.xml"), XCSoarInterface::main_window, _T("IDR_XML_TASKWAYPOINT_L")); } else { wf = dlgLoadFromXML(CallBackTable, _T("dlgTaskWaypoint.xml"), XCSoarInterface::main_window, _T("IDR_XML_TASKWAYPOINT")); } twItemIndex = itemindex; twType = tasktype; if (!wf) return; assert(wf!=NULL); // wf->SetKeyDownNotify(FormKeyDown); settings_task = task.getSettings(); wStart = ((WndFrame *)wf->FindByName(_T("frmStart"))); wTurnpoint = ((WndFrame *)wf->FindByName(_T("frmTurnpoint"))); wAATTurnpoint = ((WndFrame *)wf->FindByName(_T("frmAATTurnpoint"))); wFinish = ((WndFrame *)wf->FindByName(_T("frmFinish"))); assert(wStart!=NULL); assert(wTurnpoint!=NULL); assert(wAATTurnpoint!=NULL); assert(wFinish!=NULL); WndButton* wb; if (addonly) { wb = (WndButton *)wf->FindByName(_T("butSelect")); if (wb) { wb->hide(); } wb = (WndButton *)wf->FindByName(_T("butRemove")); if (wb) { wb->hide(); } wb = (WndButton *)wf->FindByName(_T("butDetails")); if (wb) { wb->hide(); } wb = (WndButton *)wf->FindByName(_T("butDown")); if (wb) { wb->hide(); } wb = (WndButton *)wf->FindByName(_T("butUp")); if (wb) { wb->hide(); } } else { if (!task.ValidTaskPoint(twItemIndex-1)) { wb = (WndButton *)wf->FindByName(_T("butUp")); if (wb) { wb->hide(); } } if (!task.ValidTaskPoint(twItemIndex+1)) { wb = (WndButton *)wf->FindByName(_T("butDown")); if (wb) { wb->hide(); } } } SetWaypointValues(true); switch (twType) { case 0: wStart->show(); wTurnpoint->hide(); wAATTurnpoint->hide(); wFinish->hide(); break; case 1: wStart->hide(); wTurnpoint->set_visible(!settings_task.AATEnabled); wAATTurnpoint->set_visible(settings_task.AATEnabled); wFinish->hide(); break; case 2: wStart->hide(); wTurnpoint->hide(); wAATTurnpoint->hide(); wFinish->show(); break; } // set properties... SetValues(true); UpdateCaption(); wf->ShowModal(); // now retrieve changes GetWaypointValues(); ReadValues(); delete wf; wf = NULL; }