void GPXRoute::Save(kGUITableObj *table,kGUITickBoxObj *draw,kGUIComboBoxObj *color) { unsigned int e; unsigned int nr; kGUIObj *obj; GPXRow *row; GPXRouteEntry *re; /* delete old entries if there are any? */ for(e=0;e<m_numentries;++e) delete m_entries.GetEntry(e); SetDraw(draw->GetSelected()); SetColorIndex(color->GetSelection()); nr=table->GetNumChildren(0); /* number of valid entries */ m_numentries=nr; m_entries.Alloc(nr); for(e=0;e<nr;++e) { obj=table->GetChild(e); row=static_cast<GPXRow *>(obj); re=new GPXRouteEntry(); re->m_wptname.SetString(row->GetWptName()); m_entries.SetEntry(e,re); } }
void GPXRoute::Load(kGUIXMLItem *xml) { int i,nc; GPXRouteEntry *fe; kGUIXMLItem *flxml; flxml=xml->Locate("draw"); if(flxml) SetDraw(flxml->GetValueInt()?true:false); flxml=xml->Locate("color"); /* convert string to color index */ if(flxml) SetColorIndex(GPX::GetTableColorIndex(flxml->GetValueString())); nc=xml->GetNumChildren(); for(i=0;i<nc;++i) { flxml=xml->GetChild(i); if(!strcmp(flxml->GetName(),"wptname")) { fe=new GPXRouteEntry(); m_entries.SetEntry(m_numentries++,fe); fe->m_wptname.SetString(flxml->GetValue()); } } }
void SummaryWindow::Activate() { if (m_active) return; draws_controller->AttachObserver(this); m_active = true; m_draws.resize(draws_controller->GetDrawsCount(), NULL); m_labels.resize(draws_controller->GetDrawsCount(), NULL); m_lines.resize(draws_controller->GetDrawsCount(), NULL); for (size_t i = 0; i < draws_controller->GetDrawsCount(); ++i) SetDraw(draws_controller->GetDraw(i)); Resize(); }