void FormEdit::SaveAsFile() { if (!_View.IsLayout()) return; UpdateChildZ(); FileSelector fs; fs.Type(t_("Form files (*.form)"), "*.form"); fs.Type(t_("Form archives (*.fz)"), "*.fz"); fs.AllFilesType(); if (!fs.ExecuteSaveAs(t_("Save form..."))) return; _File = ~fs; if (Upp::GetFileName(_File).Find('.') < 0) _File += ".form"; bool compression = false; if (Upp::GetFileName(_File).Find(".fz") >= 0) compression = true; _View.SaveAll(_File, compression); Title((t_("Form Editor")) + String(" - ") + ::GetFileName(_File)); ProjectSaved(true); }
void FormEdit::OpenFile() { UpdateChildZ(); FileSelector fs; fs.Type(t_("Form files"), "*.form"); fs.Type(t_("Form archives"), "*.fz"); fs.AllFilesType(); if (!fs.ExecuteOpen(t_("Open form..."))) return; Clear(); _File = ~fs; bool compression = false; if (Upp::GetFileName(_File).Find(".fz") >= 0) compression = true; _View.LoadAll(_File, compression); UpdateLayoutList(); UpdateChildZ(); Title((t_("Form Editor")) + String(" - ") + ::GetFileName(_File)); _Container.Set(_View, _View.GetPageRect().GetSize()); UpdateTools(); ProjectSaved(true); }
bool HierarchyTreeController::SaveAll(const QString& projectPath) { bool res = hierarchyTree.SaveAll(projectPath); if (res) emit ProjectSaved(); return res; }
bool HierarchyTreeController::SaveOnlyChangedScreens(const QString& projectPath) { bool res = hierarchyTree.SaveOnlyChangedScreens(projectPath); if (res) emit ProjectSaved(); return res; }
void FormEdit::NewFile() { Clear(); Title(t_("Form Editor") + String(" - ") + String(t_("New file"))); ProjectSaved(false); _View.New(); _Container.Set(_View, _View.GetPageRect().GetSize()); Refresh(); }
void FormEdit::UpdateChildAllPos() { if (!_View.IsLayout()) return; if (_ViewMode == VIEW_MODE_WIREFRAME) return; if (_View.GetObjectCount() != _Ctrls.GetCount()) return UpdateChildZ(); for (int i = 0; i < _View.GetObjectCount(); ++i) _Ctrls[i].SetRect( _View.Zoom(_View.Offseted((*_View.GetObjects())[i].GetRect()).Offseted(1, 1)) ); ProjectSaved(false); }
void FormEdit::UpdateChildPos(Vector<int> indexes) { if (!_View.IsLayout()) return; if (_ViewMode == VIEW_MODE_WIREFRAME) return; for (int i = 0; i < indexes.GetCount(); ++i) { _Ctrls[ indexes[i] ].SetRect( _View.Zoom(_View.Offseted((*_View.GetObjects())[indexes[i]].GetRect()).Offseted(1, 1)) ); } ProjectSaved(false); }
void FormEdit::SaveFile() { if (!_View.IsLayout()) return; UpdateChildZ(); if (_File.IsEmpty()) SaveAsFile(); else { bool compression = false; if (Upp::GetFileName(_File).Find(".fz") >= 0) compression = true; _View.SaveAll(_File, compression); ProjectSaved(true); } }