Esempio n. 1
0
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);
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
bool HierarchyTreeController::SaveAll(const QString& projectPath)
{
	bool res = hierarchyTree.SaveAll(projectPath);
	if (res)
		emit ProjectSaved();
	return res;
}
Esempio n. 4
0
bool HierarchyTreeController::SaveOnlyChangedScreens(const QString& projectPath)
{
	bool res = hierarchyTree.SaveOnlyChangedScreens(projectPath);
	if (res)
		emit ProjectSaved();
	return res;
}
Esempio n. 5
0
void FormEdit::NewFile()
{
	Clear();
	Title(t_("Form Editor") + String(" - ") + String(t_("New file")));
	ProjectSaved(false);
	_View.New();
	_Container.Set(_View, _View.GetPageRect().GetSize());
	Refresh();
}
Esempio n. 6
0
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);
}
Esempio n. 7
0
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);
}
Esempio n. 8
0
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);
	}
}