//--------------------------------------------------------- bool CACTIVE_History::_Set_History(void) { Freeze(); DeleteAllItems(); CSG_Data_Object *pObject = _Get_Object(); if( pObject == NULL || pObject->Get_History().Get_Children_Count() <= 0 ) { AddRoot(_TL("no history"), IMG_ROOT); } else if( SG_Compare_Version(pObject->Get_History().Get_Property("saga-version"), "2.1.3") >= 0 ) // new version { _Add_History(AddRoot(pObject->Get_Name(), IMG_ROOT), pObject->Get_History()); } else { _Add_History_OLD(AddRoot(pObject->Get_Name(), IMG_ROOT), pObject->Get_History()); } Expand(GetRootItem()); Thaw(); return( true ); }
//--------------------------------------------------------- void CACTIVE_History::On_Clear(wxCommandEvent &event) { CSG_Data_Object *pObject = _Get_Object(); int Depth = 0; if( pObject && DLG_Get_Number(Depth, _TL("Delete History Entries"), _TL("Depth")) ) { pObject->Get_History().Del_Children(Depth, Depth > 0 ? SG_T("TOOL") : SG_T("")); pObject->Set_Modified(true); Set_Item(g_pACTIVE->Get_Active()); } }
//--------------------------------------------------------- void CACTIVE_History::On_SaveAs_Model(wxCommandEvent &event) { const wxString Filter = wxString::Format("%s|*.xml|%s|*.*", _TL("XML Files"), _TL("All Files") ); wxString File; CSG_Data_Object *pObject = _Get_Object(); if( pObject && pObject->Get_History().Get_Children_Count() > 0 && DLG_Save(File, _TL("Save History as Model"), Filter) && pObject->Save_History_to_Model(&File) ) { g_pTools->Open(File); } }