예제 #1
0
void CVST2KSPIGUI::OnManual()
{
	std::string sPathName = GetResourceFolder();
	sPathName += "Essential Compressor manual.pdf";

	::OpenDocument(sPathName.c_str());
}
bool HierarchyTreePlatformNode::Load(YamlNode* platform)
{
	YamlNode* width = platform->Get(WIDTH_NODE);
	YamlNode* height = platform->Get(HEIGHT_NODE);
	if (!width || !height)
		return false;
	
	bool result = true;
	SetSize(width->AsInt(), height->AsInt());
	ActivatePlatform();
	
	YamlNode* screens = platform->Get(SCREENS_NODE);
	if (screens)
	{
		for (int i = 0; i < screens->GetCount(); i++)
		{
			YamlNode* screen = screens->Get(i);
			if (!screen)
				continue;
			String screenName = screen->AsString();
			
			QString screenPath = QString(SCREEN_PATH).arg(GetResourceFolder()).arg(QString::fromStdString(screenName));
			HierarchyTreeScreenNode* screenNode = new HierarchyTreeScreenNode(this, QString::fromStdString(screenName));
			result &= screenNode->Load(screenPath);
			AddTreeNode(screenNode);
		}
	}
	return result;
}
예제 #3
0
OP_STATUS MacOpDesktopResources::SerializeFileName(const uni_char* in, uni_char* out, INT32 out_max_len)
{
	OpString resource_dir, largepref_dir, smallpref_dir;
	
	RETURN_IF_ERROR(GetResourceFolder(resource_dir));
	RETURN_IF_ERROR(GetLargePrefFolder(largepref_dir));
	RETURN_IF_ERROR(GetSmallPrefFolder(smallpref_dir));

	return OpFileUtils::SerializeFileName(in, out, out_max_len, resource_dir, largepref_dir, smallpref_dir);
}
bool HierarchyTreePlatformNode::Save(YamlNode* node)
{
	YamlNode* platform = new YamlNode(YamlNode::TYPE_MAP);
	platform->Set(WIDTH_NODE, GetWidth());
	platform->Set(HEIGHT_NODE, GetHeight());

	Map<String, YamlNode*> &platformsMap = node->AsMap();
	platformsMap[GetName().toStdString()] = platform;
	ActivatePlatform();
	
	Map<String, YamlNode*> &platformMap = platform->AsMap();
	YamlNode* screens = new YamlNode(YamlNode::TYPE_ARRAY);
	platformMap[SCREENS_NODE] = screens;

    // Add the Localization info - specific for each Platform.
    SaveLocalization(platform);

	QString projectFolder = GetResourceFolder();
	projectFolder += "UI";
	QDir dir;
	dir.mkpath(projectFolder);
	
	bool result = true;
	for (HIERARCHYTREENODESCONSTITER iter = GetChildNodes().begin();
		 iter != GetChildNodes().end();
		 ++iter)
	{
		HierarchyTreeScreenNode* screenNode = dynamic_cast<HierarchyTreeScreenNode*>(*iter);
		if (!screenNode)
			continue;
		
		QString screenPath = QString(SCREEN_PATH).arg(GetResourceFolder()).arg(screenNode->GetName());
		result &= screenNode->Save(screenPath);
		
		screens->AddValueToArray(screenNode->GetName().toStdString());
	}
	return result;
}
QString ResourcesManageHelper::GetFontSpritesDatasourceDirectory()
{
	return GetResourceFolder(PROJECT_DATASOURCE_GRAPHICS_FONTS);
}
QString ResourcesManageHelper::GetSpritesDatasourceDirectory()
{
	return GetResourceFolder(PROJECT_DATASOURCE_GFX);
}
void TextEditorWindow::InitializeCommand()
{
	WString resourceFolder=GetResourceFolder();
	{
		commandFileNew=new GuiToolstripCommand;;
		commandFileNew->SetText(L"New");
		SetImage(commandFileNew, resourceFolder+L"_New.png");
		commandFileNew->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'N'));
		this->AddComponent(commandFileNew);
	}
	{
		commandFileOpen=new GuiToolstripCommand;;
		commandFileOpen->SetText(L"Open...");
		SetImage(commandFileOpen, resourceFolder+L"_Open.png");
		commandFileOpen->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'O'));
		this->AddComponent(commandFileOpen);
	}
	{
		commandFileSave=new GuiToolstripCommand;;
		commandFileSave->SetText(L"Save");
		SetImage(commandFileSave, resourceFolder+L"_Save.png");
		commandFileSave->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'S'));
		this->AddComponent(commandFileSave);
	}
	{
		commandFileSaveAs=new GuiToolstripCommand;;
		commandFileSaveAs->SetText(L"Save As...");
		SetImage(commandFileSaveAs, resourceFolder+L"_SaveAs.png");
		this->AddComponent(commandFileSaveAs);
	}
	{
		commandFileExit=new GuiToolstripCommand;;
		commandFileExit->SetText(L"Exit");
		this->AddComponent(commandFileExit);
	}
	{
		commandEditUndo=new GuiToolstripCommand;;
		commandEditUndo->SetText(L"Undo");
		SetImage(commandEditUndo, resourceFolder+L"_Undo.png");
		commandEditUndo->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'Z'));
		this->AddComponent(commandEditUndo);
	}
	{
		commandEditRedo=new GuiToolstripCommand;;
		commandEditRedo->SetText(L"Redo");
		SetImage(commandEditRedo, resourceFolder+L"_Redo.png");
		commandEditRedo->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'Y'));
		this->AddComponent(commandEditRedo);
	}
	{
		commandEditCut=new GuiToolstripCommand;;
		commandEditCut->SetText(L"Cut");
		SetImage(commandEditCut, resourceFolder+L"_Cut.png");
		commandEditCut->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'X'));
		this->AddComponent(commandEditCut);
	}
	{
		commandEditCopy=new GuiToolstripCommand;;
		commandEditCopy->SetText(L"Copy");
		SetImage(commandEditCopy, resourceFolder+L"_Copy.png");
		commandEditCopy->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'C'));
		this->AddComponent(commandEditCopy);
	}
	{
		commandEditPaste=new GuiToolstripCommand;;
		commandEditPaste->SetText(L"Paste");
		SetImage(commandEditPaste, resourceFolder+L"_Paste.png");
		commandEditPaste->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'V'));
		this->AddComponent(commandEditPaste);
	}
	{
		commandEditDelete=new GuiToolstripCommand;;
		commandEditDelete->SetText(L"Delete");
		SetImage(commandEditDelete, resourceFolder+L"_Delete.png");
		this->AddComponent(commandEditDelete);
	}
	{
		commandEditSelect=new GuiToolstripCommand;;
		commandEditSelect->SetText(L"Select All");
		this->AddComponent(commandEditSelect);
		commandEditDelete->SetShortcut(shortcutKeyManager->CreateShortcut(true, false, false, L'A'));
	}
	{
		commandFormatFont=new GuiToolstripCommand;;
		commandFormatFont->SetText(L"Font...");
		this->AddComponent(commandFormatFont);
	}
}
void HierarchyTreePlatformNode::ActivatePlatform()
{
	FileSystem::Instance()->ReplaceBundleName(GetResourceFolder().toStdString());
}