本文整理汇总了C++中PolycodeEditor::setHasChanges方法的典型用法代码示例。如果您正苦于以下问题:C++ PolycodeEditor::setHasChanges方法的具体用法?C++ PolycodeEditor::setHasChanges怎么用?C++ PolycodeEditor::setHasChanges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolycodeEditor
的用法示例。
在下文中一共展示了PolycodeEditor::setHasChanges方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doRemoveFile
void PolycodeIDEApp::doRemoveFile() {
if(!frame->getActiveProjectFrame()) {
return;
}
if(projectManager->selectedFile != "") {
core->removeDiskItem(projectManager->selectedFile);
if(projectManager->getActiveProject()) {
refreshProject();
}
PolycodeEditor *editor = 0;
for (int i=0; i < editorManager->openEditors.size(); i++) {
if (editorManager->openEditors[i]->getFilePath() == projectManager->selectedFile) {
editor = editorManager->openEditors[i];
break;
}
}
// have to set changes to false to avoid problems with saving and modal dialogs in removeEditor()
// besides, we're removing the file, so saving is not necessary
if (editor) {
editor->setHasChanges(false);
removeEditor(editor);
}
}
}
示例2: handleEvent
//.........这里部分代码省略.........
}
}
}
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->yesNoCancelPopup) {
if(frame->yesNoCancelPopup->action == "closeFile") {
switch(event->getEventCode()) {
case UIEvent::YES_EVENT:
{
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor) {
editor->saveFile();
closeFile();
}
frame->hideModal();
}
break;
case UIEvent::NO_EVENT:
{
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor) {
editor->setHasChanges(false);
closeFile();
}
frame->hideModal();
}
break;
case UIEvent::CANCEL_EVENT:
break;
}
}
} else if(event->getDispatcher() == frame->yesNoPopup) {
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CANCEL_EVENT) {
if(frame->yesNoPopup->action == "saveAndRun") {
runNextFrame = true;
}
frame->hideModal();
frame->yesNoPopup->action = "";
}
if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::OK_EVENT) {
if(frame->yesNoPopup->action == "removeFile") {
doRemoveFile();
}
if(frame->yesNoPopup->action == "saveAndRun") {
editorManager->saveAll();
runNextFrame = true;
}
frame->hideModal();
frame->yesNoPopup->action = "";
}
示例3: handleEvent
//.........这里部分代码省略.........
}
}
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->yesNoCancelPopup) {
if(frame->yesNoCancelPopup->action == "closeFile") {
switch(event->getEventCode()) {
case UIEvent::YES_EVENT:
{
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor) {
editor->saveFile();
closeFile();
}
frame->yesNoCancelPopup->action = "";
frame->hideModal();
}
break;
case UIEvent::NO_EVENT:
{
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor) {
editor->setHasChanges(false);
closeFile();
}
frame->yesNoCancelPopup->action = "";
frame->hideModal();
}
break;
case UIEvent::CANCEL_EVENT:
break;
}
} else if(frame->yesNoCancelPopup->action == "closeQuitFile") {
switch(event->getEventCode()) {
case UIEvent::YES_EVENT:
{
PolycodeEditor *editor = editorManager->getCurrentEditor();
if(editor) {
editor->saveFile();
closeFile();
if(editorManager->openEditors.size() > 0) {
editorManager->setCurrentEditor(editorManager->openEditors[0]);
} else{
editorManager->setCurrentEditor(NULL);
}
}
frame->yesNoCancelPopup->action = "";
frame->hideModal();
if(quitApp()) {
core->Shutdown();
}
}
break;
case UIEvent::NO_EVENT:
{