当前位置: 首页>>代码示例>>C++>>正文


C++ PolycodeEditor::hasChanges方法代码示例

本文整理汇总了C++中PolycodeEditor::hasChanges方法的典型用法代码示例。如果您正苦于以下问题:C++ PolycodeEditor::hasChanges方法的具体用法?C++ PolycodeEditor::hasChanges怎么用?C++ PolycodeEditor::hasChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PolycodeEditor的用法示例。


在下文中一共展示了PolycodeEditor::hasChanges方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:Mr-Nil,项目名称:Polycode,代码行数:30,代码来源:PolycodeIDEApp.cpp

示例2: hasUnsavedFiles

bool PolycodeEditorManager::hasUnsavedFiles() {
	for(int i=0; i < openEditors.size();i++) {
		PolycodeEditor *editor = openEditors[i];
		if(editor->hasChanges())
			return true;
	}
	return false;
}
开发者ID:carlosmarti,项目名称:Polycode,代码行数:8,代码来源:PolycodeEditorManager.cpp

示例3: hasUnsavedFilesForProject

bool PolycodeEditorManager::hasUnsavedFilesForProject(PolycodeProject *project) {
	for(int i=0; i < openEditors.size();i++) {
		PolycodeEditor *editor = openEditors[i];
		if(editor->hasChanges() && editor->parentProject == project)
			return true;
	}
	return false;
}
开发者ID:carlosmarti,项目名称:Polycode,代码行数:8,代码来源:PolycodeEditorManager.cpp

示例4: closeProject

void PolycodeIDEApp::closeProject() {
	if(projectManager->getActiveProject()) {
		std::vector<PolycodeEditor*> editors;
		PolycodeEditor *editor;
		bool hasChanges = false;
		for (int i=0; i < editorManager->openEditors.size(); i++) {
			editor = editorManager->openEditors[i];
			if (editor->hasChanges())
				hasChanges = true;
			if (editor->parentProject == projectManager->getActiveProject())
				editors.push_back(editor);
		}
		tempEditorStore = editors; // current project files
		if (hasChanges) {
			String name = projectManager->getActiveProject()->getProjectName();
			frame->yesNoCancelPopup->setCaption("Project '" + name + "' has unsaved changes. Save all?");
			frame->yesNoCancelPopup->action = "closeProject";
			frame->showModal(frame->yesNoCancelPopup);
		} else
			doCloseProject();
	} else
		PolycodeConsole::print("There are no active projects to close.\n");
}
开发者ID:Mr-Nil,项目名称:Polycode,代码行数:23,代码来源:PolycodeIDEApp.cpp


注:本文中的PolycodeEditor::hasChanges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。