本文整理汇总了C++中PolycodeProject::getProjectFile方法的典型用法代码示例。如果您正苦于以下问题:C++ PolycodeProject::getProjectFile方法的具体用法?C++ PolycodeProject::getProjectFile怎么用?C++ PolycodeProject::getProjectFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolycodeProject
的用法示例。
在下文中一共展示了PolycodeProject::getProjectFile方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadConfigFile
void PolycodeIDEApp::loadConfigFile() {
Object configFile;
// TODO: Make a crossplatform core method to get application data path
#if defined(__APPLE__) && defined(__MACH__)
configFile.loadFromXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");
#else
configFile.loadFromXML(core->getUserHomeDirectory()+"/.polycode/config.xml");
#endif
globalSyntaxTheme = new SyntaxHighlightTheme();
String themeName = "default";
ObjectEntry *syntaxTheme = configFile.root["syntax_theme"];
if(syntaxTheme) {
themeName = syntaxTheme->stringVal;
}
themeName = "monokai";
globalSyntaxTheme->loadFromFile(themeName);
if(configFile.root["open_projects"]) {
ObjectEntry *projects = configFile.root["open_projects"];
if(projects) {
for(int i=0; i < projects->length; i++) {
ObjectEntry *entry = (*(*projects)[i])["path"];
if(entry) {
PolycodeProject* project = projectManager->openProject(entry->stringVal);
if(project) {
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
projectManager->setActiveProject(project);
openFile(projectEntry);
}
}
}
}
}
}
示例2: saveConfigFile
void PolycodeIDEApp::saveConfigFile() {
Config *config = CoreServices::getInstance()->getConfig();
Object configFile;
configFile.root.name = "config";
configFile.root.addChild("open_projects");
configFile.root.addChild("syntax_theme", globalSyntaxTheme->name);
for(int i=0; i < projectManager->getProjectCount(); i++) {
PolycodeProject *project = projectManager->getProjectByIndex(i);
ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");
projectEntry->addChild("name", project->getProjectName());
projectEntry->addChild("path", project->getProjectFile());
}
configFile.root.addChild("settings");
ObjectEntry *textEditorEntry = configFile.root["settings"]->addChild("text_editor");
textEditorEntry->addChild("use_external", config->getStringValue("Polycode", "useExternalTextEditor"));
textEditorEntry->addChild("command", config->getStringValue("Polycode", "externalTextEditorCommand"));
#if defined(__APPLE__) && defined(__MACH__)
core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode");
configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");
#else
core->createFolder(core->getUserHomeDirectory()+"/.polycode");
configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml");
#endif
}
示例3: openProject
void PolycodeIDEApp::openProject() {
#ifdef USE_POLYCODEUI_FILE_DIALOGS
std::vector<String> exts;
exts.push_back("polyproject");
frame->showFileBrowser(CoreServices::getInstance()->getCore()->getUserHomeDirectory(), false, exts, false);
frame->fileDialog->addEventListener(this, UIEvent::OK_EVENT);
#else
vector<CoreFileExtension> extensions;
CoreFileExtension ext;
ext.extension = "polyproject";
ext.description = "Polycode Project File";
extensions.push_back(ext);
std::vector<String> paths = core->openFilePicker(extensions, false);
if(paths.size() == 0)
return;
if(paths[0] != "") {
PolycodeProject *project = projectManager->openProject(paths[0]);
if(project) {
projectManager->setActiveProject(project);
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
openFile(projectEntry);
}
}
#endif
}
示例4: loadConfigFile
void PolycodeIDEApp::loadConfigFile() {
Object configFile;
// TODO: Make a crossplatform core method to get application data path
#if defined(__APPLE__) && defined(__MACH__)
configFile.loadFromXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");
#else
configFile.loadFromXML(core->getUserHomeDirectory()+"/.polycode/config.xml");
#endif
globalSyntaxTheme = new SyntaxHighlightTheme();
String themeName = "monokai";
ObjectEntry *syntaxTheme = configFile.root["syntax_theme"];
if(syntaxTheme) {
themeName = syntaxTheme->stringVal;
}
globalSyntaxTheme->loadFromFile(themeName);
if(configFile.root["open_projects"]) {
ObjectEntry *projects = configFile.root["open_projects"];
if(projects) {
for(int i=0; i < projects->length; i++) {
ObjectEntry *entry = (*(*projects)[i])["path"];
if(entry) {
PolycodeProject* project = projectManager->openProject(entry->stringVal);
if(project) {
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
projectManager->setActiveProject(project);
openFile(projectEntry);
}
}
}
}
}
Config *config = CoreServices::getInstance()->getConfig();
if(configFile.root["settings"]) {
ObjectEntry *settings = configFile.root["settings"];
ObjectEntry *textEditor = (*settings)["text_editor"];
if(textEditor) {
if((*textEditor)["use_external"]) {
config->setStringValue("Polycode", "useExternalTextEditor", (*textEditor)["use_external"]->stringVal);
} else {
config->setStringValue("Polycode", "useExternalTextEditor", "false");
}
if((*textEditor)["command"]) {
config->setStringValue("Polycode", "externalTextEditorCommand", (*textEditor)["command"]->stringVal);
} else {
config->setStringValue("Polycode", "externalTextEditorCommand", "");
}
}
} else {
config->setStringValue("Polycode","useExternalTextEditor", "false");
config->setStringValue("Polycode", "externalTextEditorCommand", "");
}
frame->settingsWindow->updateUI();
}
示例5: saveConfigFile
void PolycodeIDEApp::saveConfigFile() {
Object configFile;
configFile.root.name = "config";
configFile.root.addChild("open_projects");
for(int i=0; i < projectManager->getProjectCount(); i++) {
PolycodeProject *project = projectManager->getProjectByIndex(i);
ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");
projectEntry->addChild("name", project->getProjectName());
projectEntry->addChild("path", project->getProjectFile());
}
core->createFolder("/Users/ivansafrin/Library/Application Support/Polycode");
configFile.saveToXML("/Users/ivansafrin/Library/Application Support/Polycode/config.xml");
}
示例6: openProject
void PolycodeIDEApp::openProject() {
vector<CoreFileExtension> extensions;
CoreFileExtension ext;
ext.extension = "polyproject";
ext.description = "Polycode Project File";
extensions.push_back(ext);
std::vector<String> paths = core->openFilePicker(extensions, false);
if(paths[0] != "") {
PolycodeProject *project = projectManager->openProject(paths[0]);
if(project) {
projectManager->setActiveProject(project);
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
openFile(projectEntry);
}
}
}
示例7: saveConfigFile
void PolycodeIDEApp::saveConfigFile() {
Config *config = CoreServices::getInstance()->getConfig();
Object configFile;
configFile.root.name = "config";
configFile.root.addChild("open_projects");
configFile.root.addChild("syntax_theme", globalSyntaxTheme->name);
configFile.root.addChild("ui_theme", config->getStringValue("Polycode", "uiTheme"));
configFile.root.addChild("texture_filtering_mode", config->getStringValue("Polycode", "textureFilteringMode"));
configFile.root.addChild("app_width", String::IntToString(core->getXRes()));
configFile.root.addChild("app_height", String::IntToString(core->getYRes()));
ObjectEntry *consoleEntry = configFile.root.addChild("console");
consoleEntry->addChild("size", frame->getConsoleSize());
consoleEntry->addChild("showing", frame->isShowingConsole());
for(int i=0; i < projectManager->getProjectCount(); i++) {
PolycodeProject *project = projectManager->getProjectByIndex(i);
ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");
projectEntry->addChild("is_active", (project == projectManager->getActiveProject()));
projectEntry->addChild("name", project->getProjectName());
projectEntry->addChild("path", project->getProjectFile());
ObjectEntry *projectFrameConfig = frame->getFrameConfigForProject(project);
if(projectFrameConfig) {
projectEntry->addChild(projectFrameConfig);
}
}
configFile.root.addChild("settings");
ObjectEntry *textEditorEntry = configFile.root["settings"]->addChild("text_editor");
textEditorEntry->addChild("use_external", config->getStringValue("Polycode", "useExternalTextEditor"));
textEditorEntry->addChild("command", config->getStringValue("Polycode", "externalTextEditorCommand"));
#if defined(__APPLE__) && defined(__MACH__)
core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode");
configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");
#else
core->createFolder(core->getUserHomeDirectory()+"/.polycode");
configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml");
#endif
}
示例8: loadConfigFile
void PolycodeIDEApp::loadConfigFile() {
Object configFile;
configFile.loadFromXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");
if(configFile.root["open_projects"]) {
ObjectEntry *projects = configFile.root["open_projects"];
if(projects) {
for(int i=0; i < projects->length; i++) {
ObjectEntry *entry = (*(*projects)[i])["path"];
if(entry) {
PolycodeProject* project = projectManager->openProject(entry->stringVal);
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
projectManager->setActiveProject(project);
openFile(projectEntry);
}
}
}
}
}
示例9: saveConfigFile
void PolycodeIDEApp::saveConfigFile() {
Object configFile;
configFile.root.name = "config";
configFile.root.addChild("open_projects");
configFile.root.addChild("syntax_theme", globalSyntaxTheme->name);
for(int i=0; i < projectManager->getProjectCount(); i++) {
PolycodeProject *project = projectManager->getProjectByIndex(i);
ObjectEntry *projectEntry = configFile.root["open_projects"]->addChild("project");
projectEntry->addChild("name", project->getProjectName());
projectEntry->addChild("path", project->getProjectFile());
}
#if defined(__APPLE__) && defined(__MACH__)
core->createFolder(core->getUserHomeDirectory()+"/Library/Application Support/Polycode");
configFile.saveToXML(core->getUserHomeDirectory()+"/Library/Application Support/Polycode/config.xml");
#else
core->createFolder(core->getUserHomeDirectory()+"/.polycode");
configFile.saveToXML(core->getUserHomeDirectory()+"/.polycode/config.xml");
#endif
}
示例10: handleEvent
void PolycodeIDEApp::handleEvent(Event *event) {
if(event->getDispatcher() == frame->fileDialog) {
if(event->getEventCode() == UIEvent::OK_EVENT && event->getEventType() == "UIEvent") {
String path = frame->fileDialog->getSelection();
if(path != "") {
PolycodeProject *project = projectManager->openProject(path);
if(project) {
projectManager->setActiveProject(project);
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
openFile(projectEntry);
}
}
}
}
if(event->getDispatcher() == menuBar) {
String action = menuBar->getSelectedItem();
if(action == "new_file") {
newFile();
} else if(action == "new_project") {
newProject();
} else if(action == "new_folder") {
newGroup();
} else if(action == "open_project") {
openProject();
} else if(action == "close_project") {
closeProject();
} else if(action == "remove_file") {
removeFile();
} else if(action == "refresh_project") {
refreshProject();
} else if(action == "save_file") {
saveFile();
} else if(action == "browse_examples") {
browseExamples();
} else if(action == "quit") {
core->Shutdown();
} else if(action == "run_project") {
runProject();
} else if(action == "export_project") {
exportProject();
} else if(action == "show_api") {
openDocs();
} else if(action == "show_about") {
showAbout();
}
}
if(event->getDispatcher() == frame->console->backtraceWindow) {
if(event->getEventType() == "BackTraceEvent" && event->getEventCode() == BackTraceEvent::EVENT_BACKTRACE_SELECTED) {
BackTraceEvent *btEvent = (BackTraceEvent*) event;
openFileInProject(btEvent->project, btEvent->fileName);
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor) {
if(editor->getEditorType() == "PolycodeTextEditor") {
PolycodeTextEditor *textEditor = (PolycodeTextEditor*) editor;
textEditor->highlightLine(btEvent->lineNumber);
}
}
}
}
if(event->getDispatcher() == core) {
switch(event->getEventCode()) {
case Core::EVENT_LOST_FOCUS:
core->setFramerate(3);
break;
case Core::EVENT_GAINED_FOCUS:
core->setFramerate(30);
break;
case Core::EVENT_CORE_RESIZE:
if(menuBar) {
frame->Resize(core->getXRes(), core->getYRes()-25);
menuBar->Resize(core->getXRes(), 25);
} else {
frame->Resize(core->getXRes(), core->getYRes());
}
break;
}
}
if(event->getDispatcher() == frame->getProjectBrowser()) {
if(event->getEventType() == "PolycodeProjectBrowserEvent") {
switch(event->getEventCode()) {
case PolycodeProjectBrowserEvent::HANDLE_MENU_COMMAND:
PolycodeProjectBrowserEvent *bEvent = (PolycodeProjectBrowserEvent*) event;
if(bEvent->command == "add_new_file") {
newFile();
} else if(bEvent->command == "add_files") {
addFiles();
} else if(bEvent->command == "add_new_project") {
newProject();
} else if(bEvent->command == "add_new_folder") {
//.........这里部分代码省略.........
示例11: handleEvent
//.........这里部分代码省略.........
core->moveDiskItem(projectManager->selectedFileEntry.fullPath, projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue());
if(projectManager->getActiveProject()) {
refreshProject();
}
PolycodeEditor *editor = editorManager->getEditorForPath(projectManager->selectedFileEntry.fullPath);
if(editor) {
editor->setFilePath(projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue());
}
projectManager->selectedFileEntry.fullPath = projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue();
projectManager->selectedFileEntry.name = frame->textInputPopup->getValue();
}
frame->hideModal();
}
}
if(event->getDispatcher() == frame->settingsWindow) {
if(event->getEventType() == "UIEvent") {
Config *config = CoreServices::getInstance()->getConfig();
SettingsWindow *settingsWindow = frame->settingsWindow;
if(event->getEventCode() == UIEvent::OK_EVENT) {
config->setStringValue("Polycode", "useExternalTextEditor", settingsWindow->useExternalTextEditorBox->isChecked() ? "true" : "false");
config->setStringValue("Polycode", "externalTextEditorCommand", settingsWindow->externalTextEditorCommand->getText());
config->setStringValue("Polycode", "uiTheme", settingsWindow->uiThemeBox->getSelectedItem()->label);
if(settingsWindow->textureFilteringBox->getSelectedIndex() == 0) {
config->setStringValue("Polycode", "textureFilteringMode", "linear");
} else {
config->setStringValue("Polycode", "textureFilteringMode", "nearest");
}
frame->hideModal();
}
}
}
if(event->getDispatcher() == frame->exportProjectWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
projectManager->exportProject(projectManager->getActiveProject(), frame->exportProjectWindow->projectLocationInput->getText(), frame->exportProjectWindow->macCheckBox->isChecked(), frame->exportProjectWindow->winCheckBox->isChecked(), frame->exportProjectWindow->linCheckBox->isChecked(), frame->exportProjectWindow->compileCheckBox->isChecked());
frame->hideModal();
}
}
if(event->getDispatcher() == frame->newProjectWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
projectManager->createNewProject(frame->newProjectWindow->getTemplateFolder(), frame->newProjectWindow->getProjectName(), frame->newProjectWindow->getProjectLocation());
frame->hideModal();
}
}
if(event->getDispatcher() == frame->newFileWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
projectManager->createNewFile(frame->newFileWindow->getTemplatePath(), frame->newFileWindow->getFileName());
frame->hideModal();
if(projectManager->getActiveProject()) {
refreshProject();
}
}
}
if(event->getDispatcher() == frame->exampleBrowserWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
String fullPath = String(core->getDefaultWorkingDirectory()+"/"+frame->exampleBrowserWindow->getExamplePath());
PolycodeProject* project = projectManager->openProject(fullPath);
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
projectManager->setActiveProject(project);
frame->hideModal();
}
}
// close files and editors after the close file button is pressed
/*
if (event->getDispatcher() == frame->closeFileButton) {
if (event->getEventCode() == UIEvent::CLICK_EVENT) {
if (core->getInput()->getKeyState(KEY_RSHIFT) || core->getInput()->getKeyState(KEY_LSHIFT))
closeFiles(editorManager->openEditors);
else
closeFile();
}
}
*/
// open an editor/file if project browser has focus and user hits enter or right-arrow key
if (event->getDispatcher() == CoreServices::getInstance()->getCore()->getInput()) {
if(frame->getActiveProjectFrame()) {
if (event->getEventCode() == InputEvent::EVENT_KEYDOWN && frame->getCurrentProjectBrowser()->treeContainer->hasFocus) {
InputEvent *inEvent = (InputEvent*)event;
if (inEvent->keyCode() == KEY_RETURN || inEvent->keyCode() == KEY_RIGHT) {
BrowserUserData *selectedData = frame->getCurrentProjectBrowser()->getSelectedData();
if (selectedData)
openFile(selectedData->fileEntry);
}
}
}
}
}
示例12: applyFinalConfig
void PolycodeIDEApp::applyFinalConfig() {
ObjectEntry *appWidth = configFile.root["app_width"];
ObjectEntry *appHeight = configFile.root["app_height"];
bool setResFromConfig = false;
if(appWidth && appHeight) {
int newXRes = appWidth->intVal;
int newYRes = appHeight->intVal;
if(newXRes > 100 && newYRes > 100) {
setResFromConfig = true;
core->setVideoMode(newXRes, newYRes, false, true, 0, 0);
frame->Resize(newXRes, newYRes);
}
}
if(!setResFromConfig) {
core->setVideoMode(1100, 700, false, true, 0, 0);
frame->Resize(1100, 700);
}
ObjectEntry *consoleEntry = configFile.root["console"];
if(consoleEntry) {
if((*consoleEntry)["size"]) {
frame->getConsoleSizer()->setMainHeight((*consoleEntry)["size"]->NumberVal);
}
if((*consoleEntry)["showing"]) {
if((*consoleEntry)["showing"]->boolVal) {
frame->showConsole();
} else {
frame->hideConsole();
}
}
}
PolycodeProject *activeConfigProject = NULL;
for(int i=0; i < projectsToOpen.size(); i++) {
ObjectEntry *projectPathEntry = ((*projectsToOpen[i])["path"]);
if(projectPathEntry) {
String projectPath = projectPathEntry->stringVal;
PolycodeProject* project = projectManager->openProject(projectPath);
ObjectEntry *projectActiveEntry = ((*projectsToOpen[i])["is_active"]);
if(projectActiveEntry) {
if(projectActiveEntry->boolVal) {
activeConfigProject = project;
}
}
PolycodeProjectFrame *projectFrame = frame->getProjectFrame(project);
PolycodeProjectTab *activeTab = NULL;
if(project) {
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
ObjectEntry *frameEntry = ((*projectsToOpen[i])["frame"]);
if(frameEntry) {
ObjectEntry *tabs = (*frameEntry)["tabs"];
if(tabs) {
for(int i=0; i < tabs->length; i++) {
ObjectEntry *tab = (*tabs)[i];
if(tab) {
ObjectEntry *tabName = (*tab)["tab_name"];
ObjectEntry *tabActive = (*tab)["tab_active"];
if(i == 0) {
projectFrame->getTabAtIndex(0)->setTabName(tabName->stringVal);
projectFrame->restructTabs();
} else {
projectFrame->addNewTab(tabName->stringVal);
}
projectFrame->getTabAtIndex(i)->applyTabConfig(tab);
if(tabActive->boolVal) {
activeTab = projectFrame->getTabAtIndex(i);
}
}
}
if(activeTab) {
projectFrame->showTab(activeTab);
}
}
}
}
}
}
if(activeConfigProject) {
projectManager->setActiveProject(activeConfigProject);
frame->switchToProjectFrame(frame->getProjectFrame(activeConfigProject));
}
}
示例13: handleEvent
//.........这里部分代码省略.........
BrowserUserData *selectedData = frame->getProjectBrowser()->getSelectedData();
if(selectedData->type == 3) {
projectManager->activeFolder = selectedData->parentProject->getRootFolder();
projectManager->selectedFile = "";
} else if(selectedData->type == 0) {
projectManager->activeFolder = "";
projectManager->selectedFile = "";
} else {
projectManager->selectedFileEntry = selectedData->fileEntry;
projectManager->selectedFile = selectedData->fileEntry.fullPath;
if(selectedData->fileEntry.type == OSFileEntry::TYPE_FILE) {
projectManager->activeFolder = selectedData->fileEntry.basePath;
} else {
projectManager->activeFolder = selectedData->fileEntry.fullPath;
}
}
projectManager->setActiveProject(selectedData->parentProject);
if(selectedData->type == 0)
return;
if(selectedData) {
openFile(selectedData->fileEntry);
}
}
}
if(event->getDispatcher() == frame->playButton) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CLICK_EVENT) {
willRunProject = true;
}
}
if(event->getDispatcher() == frame->stopButton) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CLICK_EVENT) {
stopProject();
}
}
if(event->getDispatcher() == frame->textInputPopup) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
core->moveDiskItem(projectManager->selectedFileEntry.fullPath, projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue());
if(projectManager->getActiveProject()) {
frame->getProjectBrowser()->refreshProject(projectManager->getActiveProject());
}
PolycodeEditor *editor = editorManager->getEditorForPath(projectManager->selectedFileEntry.fullPath);
if(editor) {
editor->setFilePath(projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue());
}
projectManager->selectedFileEntry.fullPath = projectManager->selectedFileEntry.basePath + "/" + frame->textInputPopup->getValue();
projectManager->selectedFileEntry.name = frame->textInputPopup->getValue();
frame->hideModal();
}
}
if(event->getDispatcher() == frame->exportProjectWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
projectManager->exportProject(projectManager->getActiveProject(), frame->exportProjectWindow->projectLocationInput->getText(), frame->exportProjectWindow->macCheckBox->isChecked(), frame->exportProjectWindow->winCheckBox->isChecked(), frame->exportProjectWindow->linCheckBox->isChecked());
frame->hideModal();
}
}
if(event->getDispatcher() == frame->newProjectWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
projectManager->createNewProject(frame->newProjectWindow->getTemplateFolder(), frame->newProjectWindow->getProjectName(), frame->newProjectWindow->getProjectLocation());
frame->hideModal();
}
}
if(event->getDispatcher() == frame->newFileWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
projectManager->createNewFile(frame->newFileWindow->getTemplatePath(), frame->newFileWindow->getFileName());
frame->hideModal();
if(projectManager->getActiveProject()) {
frame->projectBrowser->refreshProject(projectManager->getActiveProject());
}
}
}
if(event->getDispatcher() == frame->exampleBrowserWindow) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
String fullPath = String(core->getDefaultWorkingDirectory()+"/"+frame->exampleBrowserWindow->getExamplePath());
PolycodeProject* project = projectManager->openProject(fullPath);
OSFileEntry projectEntry = OSFileEntry(project->getProjectFile(), OSFileEntry::TYPE_FILE);
projectManager->setActiveProject(project);
openFile(projectEntry);
frame->hideModal();
}
}
}