本文整理汇总了C++中PolycodeEditor::getFilePath方法的典型用法代码示例。如果您正苦于以下问题:C++ PolycodeEditor::getFilePath方法的具体用法?C++ PolycodeEditor::getFilePath怎么用?C++ PolycodeEditor::getFilePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolycodeEditor
的用法示例。
在下文中一共展示了PolycodeEditor::getFilePath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: quitApp
bool PolycodeIDEApp::quitApp() {
quittingApp = true;
while(editorManager->getCurrentEditor()) {
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor->hasChanges()) {
OSFileEntry entry(editor->getFilePath(), OSFileEntry::TYPE_FILE);
frame->yesNoCancelPopup->setCaption("The file \""+entry.name+"\" has unsaved changes. Save before quitting?");
frame->yesNoCancelPopup->action = "closeQuitFile";
frame->showModal(frame->yesNoCancelPopup);
return false;
} else {
if(editor->getEditorHolder()) {
editor->getEditorHolder()->setEditor(NULL);
}
editorManager->destroyEditor(editor);
if(editorManager->openEditors.size() > 0) {
editorManager->setCurrentEditor(editorManager->openEditors[0]);
frame->getActiveProjectFrame()->getActiveTab()->showEditor(editorManager->openEditors[0]);
} else{
editorManager->setCurrentEditor(NULL);
}
}
}
return true;
}
示例2:
PolycodeEditor *PolycodeEditorManager::getEditorForPath(String path) {
for(int i=0; i < openEditors.size();i++) {
PolycodeEditor *editor = openEditors[i];
if(editor->getFilePath() == path)
return editor;
}
return NULL;
}
示例3: closeFile
void PolycodeIDEApp::closeFile() {
// this will save the file if it has changes and/or close it (in closeFiles())
PolycodeEditor *editor = editorManager->getCurrentEditor();
if (editor) {
std::vector<PolycodeEditor*> editorToSave;
editorToSave.push_back(editor);
OSFileEntry entry(editor->getFilePath(), OSFileEntry::TYPE_FILE);
closeFiles(editorToSave, "'"+entry.name+"' has unsaved changes. Save?");
}
}