本文整理汇总了C++中PolycodeEditor::saveFile方法的典型用法代码示例。如果您正苦于以下问题:C++ PolycodeEditor::saveFile方法的具体用法?C++ PolycodeEditor::saveFile怎么用?C++ PolycodeEditor::saveFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolycodeEditor
的用法示例。
在下文中一共展示了PolycodeEditor::saveFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveAll
void PolycodeEditorManager::saveAll() {
for(int i=0; i < openEditors.size();i++) {
PolycodeEditor *editor = openEditors[i];
editor->saveFile();
}
}
示例2: 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") {
//.........这里部分代码省略.........
示例3: handleEvent
void PolycodeIDEApp::handleEvent(Event *event) {
if(event->getDispatcher() == frame->assetImporterWindow) {
refreshProject();
}
if(event->getDispatcher() == projectManager && event->getEventCode() == Event::CHANGE_EVENT) {
if(projectManager->getActiveProject()) {
if(frame->getCurrentProjectBrowser()) {
frame->getCurrentProjectBrowser()->removeAllHandlersForListener(this);
}
PolycodeProjectFrame *projectFame = frame->getProjectFrame(projectManager->getActiveProject());
if(projectFame) {
frame->switchToProjectFrame(projectFame);
} else {
frame->createProjectFrame(projectManager->getActiveProject());
}
frame->getCurrentProjectBrowser()->addEventListener(this, Event::CHANGE_EVENT);
frame->getCurrentProjectBrowser()->addEventListener(this, PolycodeProjectBrowserEvent::HANDLE_MENU_COMMAND);
}
}
if(event->getDispatcher() == frame) {
if(event->getEventCode() == Event::CHANGE_EVENT) {
if(frame->getCurrentProjectBrowser()) {
frame->getCurrentProjectBrowser()->removeAllHandlersForListener(this);
}
frame->getCurrentProjectBrowser()->addEventListener(this, Event::CHANGE_EVENT);
frame->getCurrentProjectBrowser()->addEventListener(this, PolycodeProjectBrowserEvent::HANDLE_MENU_COMMAND);
}
if(event->getEventCode() == UIEvent::CLOSE_EVENT) {
closeFile();
}
}
if(event->getDispatcher() == frame->fileDialog) {
if(event->getEventCode() == UIEvent::OK_EVENT && event->getEventType() == "UIEvent") {
String path = frame->fileDialog->getSelection();
if(path != "") {
if(frame->fileDialog->action == "openProject") {
PolycodeProject *project = projectManager->openProject(path);
if(project) {
projectManager->setActiveProject(project);
}
} else if(frame->fileDialog->action == "addFiles") {
OSFileEntry entry = OSFileEntry(path, OSFileEntry::TYPE_FILE);
core->copyDiskItem(path, projectManager->activeFolder + "/" + entry.name);
refreshProject();
} else if(frame->fileDialog->action == "openImportAssets") {
frame->assetImporterWindow->setSourceFileAndTargetFolder(path, projectManager->activeFolder, projectManager->activeFolder.replace(projectManager->getActiveProject()->getRootFolder(), ""));
frame->showModal(frame->assetImporterWindow);
frame->assetImporterWindow->addEventListener(this, UIEvent::OK_EVENT);
}
}
}
}
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 == "close_file") {
closeFile();
} 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();
} else if(action == "toggle_console") {
toggleConsole();
} else if(action == "settings") {
showSettings();
} else if(action == "find") {
findText();
}
//.........这里部分代码省略.........