Beispiel #1
0
RTFEditor::Instance* RTFEditor::CreateInstance( const std::wstring& file )
{
	Instance* iv = new Instance;
	iv->AddRef();

	iv->initializeMoeChild(file);
	if ( !iv->load(file) )
	{
		iv->Release();
		return 0;
	}
	statusBar()->status(100);
	return iv;
}
Beispiel #2
0
Hex::Instance* Hex::CreateInstance(const std::wstring& file, bool readOnly)
{
	std::wstring p(file);
	if ( mol::Path::exists(p) && mol::Path::isDir(p) )
		return 0;

	Instance* e = new Instance;
	e->AddRef();

	statusBar()->status(30);

	if (!e->initialize(p,readOnly))
	{
		e->destroy();
		e->Release();
		return 0;
	}
	return e;
}
Beispiel #3
0
TailEditor::Instance* TailEditor::CreateInstance(const std::wstring& file)
{
	statusBar()->status(20);

	std::wstring p(file);
	if ( mol::Path::exists(p) && mol::Path::isDir(p) )
		return 0;

	Instance* e = new Instance;
	e->AddRef();

	statusBar()->status(75);
	if ( !e->initialize(file) )
	{
		e->destroy();
		return 0;
	}
	statusBar()->status(100);
	return e;
}