/* Edit options */
// Cut
- // Copy
+ // Copy
// Paste
// Undo
// Redo
BitmapResource bmpTopFrameError { ":codeMarks/topFrameError.png", window = this };
BitmapResource bmpTopFrameHalf { ":codeMarks/topFrameHalf.png", window = this };
BitmapResource bmpTopFrameHalfError { ":codeMarks/topFrameHalfError.png", window = this };
-
+
Debugger debugger { };
ProjectView projectView;
{
switch(key)
{
- case escape:
+ case escape:
if(activeBox != findBox || !ide.findInFilesDialog || !ide.findInFilesDialog.SearchAbort())
- ide.ShowCodeEditor();
+ ide.ShowCodeEditor();
break;
default:
{
if(debugger.activeFrame && debugger.activeFrame.absoluteFile)
{
int line = debugger.activeFrame.line;
- char name[MAX_LOCATION];
- Project prj = null;
- // TOFIX: Improve on this, don't use only filename, make a function
- GetLastDirectory(debugger.activeFrame.absoluteFile, name);
- if(ide && ide.workspace)
- {
- for(p : ide.workspace.projects)
- {
- if(p.topNode.Find(name, false))
- {
- prj = p;
- break;
- }
- }
- if(!prj)
- {
- for(p : ide.workspace.projects)
- {
- if(IsPathInsideOf(debugger.activeFrame.absoluteFile, p.topNode.path))
- {
- prj = p;
- break;
- }
- }
- }
- }
- debugger.ToggleBreakpoint(debugger.activeFrame.absoluteFile, line, prj);
+ debugger.ToggleBreakpoint(debugger.activeFrame.absoluteFile, line);
Update(null);
{
CodeEditor codeEditor = (CodeEditor)ide.FindWindow(debugger.activeFrame.absoluteFile);
}
}
};
-
+
WatchesView watchesView { parent = this };
ThreadsView threadsView
{
gotWhatWeWant = true;
}
if(gotWhatWeWant ||
- MessageBox { type = yesNo, master = this, text = $"Error opening file",
+ MessageBox { type = yesNo, master = this, text = $"Error opening file",
contents = $"Open a different file?" }.Modal() == no)
{
if(!projectView && gotWhatWeWant)
}
MenuPlacement editMenu { menu, $"Edit", e };
-
+
Menu projectMenu { menu, $"Menu"."Project", p, hasMargin = true };
MenuItem projectNewItem
{
{
if(OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, add, mods.ctrl && mods.shift))
break;
- if(MessageBox { type = yesNo, master = this, text = $"Error opening project file",
+ if(MessageBox { type = yesNo, master = this, text = $"Error opening project file",
contents = $"Add a different project?" }.Modal() == no)
{
break;
MenuItem debugSkipStepOverItem
{
debugMenu, $"Step Over Skipping Breakpoints", e, shiftF10, disabled = true;
+ bitmap = { ":actions/stepOverSkipBreak.png" };
bool NotifySelect(MenuItem selection, Modifiers mods)
{
if(projectView) projectView.DebugStepOver(true);
}
};
#endif
-
+
bool NotifySelectDisplayDriver(MenuItem selection, Modifiers mods)
{
//app.driver = app.drivers[selection.id];
{
this;
fileName = fileName;
-
+
void NotifyDestroyed(Window window, DialogResult result)
{
projectView = null;
text = titleECEREIDE;
-
+
AdjustMenus();
}
};
bool outputVisible = expand ? false : outputView.visible;
int topDistance = (callStackVisible || threadsVisible) ? 200 : 0;
int bottomDistance = (outputVisible || watchesVisible || breakpointsVisible) ? 240 : 0;
-
+
for(child = firstChild; child; child = child.next)
{
- if(child._class == class(CodeEditor) || child._class == class(Designer) ||
+ if(child._class == class(CodeEditor) || child._class == class(Designer) ||
child._class == class(Sheet) || child._class == class(ProjectView))
{
Anchor anchor = child.anchor;
}
else if(expand)
{
- if(child._class == class(OutputView) || child._class == class(CallStackView) || child._class == class(ThreadsView) || child._class == class(WatchesView) ||
+ if(child._class == class(OutputView) || child._class == class(CallStackView) || child._class == class(ThreadsView) || child._class == class(WatchesView) ||
child._class == class(BreakpointsView))
child.visible = false;
}
if(activeClient)
activeClient.Activate();
else if(projectView)
- {
+ {
projectView.visible = true;
projectView.Activate();
}
{
if(debugger.isActive)
{
- if(MessageBox { type = yesNo, master = ide,
- contents = $"Do you want to terminate the debugging session in progress?",
+ if(MessageBox { type = yesNo, master = ide,
+ contents = $"Do you want to terminate the debugging session in progress?",
text = title }.Modal() == no)
return true;
/*
- MessageBox msg { type = yesNo, master = ide,
- contents = "Do you want to terminate the debugging session in progress?",
+ MessageBox msg { type = yesNo, master = ide,
+ contents = "Do you want to terminate the debugging session in progress?",
text = title };
if(msg.Modal() == no)
{
{
Project project;
Workspace workspace = null;
-
+
if(FileExists(filePath))
{
if(!strcmp(extension, ProjectExtension))
CreateProjectView(workspace, filePath);
document = projectView;
- workspace.DropInvalidBreakpoints();
+ workspace.ParseLoadedBreakpoints();
+ workspace.DropInvalidBreakpoints(null);
workspace.Save();
ide.projectView.ShowOutputBuildLog(true);
findInFilesDialog.mode = FindInFilesMode::project;
findInFilesDialog.currentDirectory = ide.project.topNode.path;
-
+
{
char location[MAX_LOCATION];
StripLastDirectory(ide.project.topNode.path, location);
ChangeProjectFileDialogDirectory(location);
}
-
- /*
- if(projectView.debugger)
- projectView.debugger.EvaluateWatches();
- */
-
+
break;
}
- else
+ else
{
if(MessageBox { type = yesNo, master = this, text = $"Error opening project", contents = $"Open a different project?" }.Modal() == yes)
{
}
if(prj)
{
- MessageBox { type = ok, parent = parent, master = this, text = $"Same Project",
+ MessageBox { type = ok, parent = parent, master = this, text = $"Same Project",
contents = $"This project is already present in workspace." }.Modal();
}
else
!strcmp(extension, "jpeg") || !strcmp(extension, "png"))
{
if(FileExists(filePath))
- document = PictureEdit { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable,
- hasVertScroll = true, hasHorzScroll = true, parent = this, state = state,
+ document = PictureEdit { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable,
+ hasVertScroll = true, hasHorzScroll = true, parent = this, state = state,
visible = visible, bitmapFile = filePath, OnClose = PictureEditOnClose/*why?--GenericDocumentOnClose*/;
};
if(!document)
else if(!strcmp(extension, "3ds"))
{
if(FileExists(filePath))
- document = ModelView { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable,
- hasVertScroll = true, hasHorzScroll = true, parent = this, state = state,
+ document = ModelView { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable,
+ hasVertScroll = true, hasHorzScroll = true, parent = this, state = state,
visible = visible, modelFile = filePath, OnClose = ModelViewOnClose/*why?--GenericDocumentOnClose*/
};
workspace.UpdateOpenedFileInfo(filePath, opened);
}
}
-
+
if(!document && createIfFails != no)
{
- if(createIfFails != yes && !needFileModified &&
+ if(createIfFails != yes && !needFileModified &&
MessageBox { type = yesNo, master = this, text = filePath, contents = $"File doesn't exist. Create?" }.Modal() == yes)
createIfFails = yes;
if(createIfFails == yes || createIfFails == whatever)
editor.editBox.scroll = scroll;
editor.openedFileInfo.holdTracking = false;
}
-
+
if(needFileModified)
document.OnFileModified = OnFileModified;
document.NotifySaved = DocumentSaved;
-
+
if(isProject)
ideSettings.AddRecentProject(document.fileName);
else
ide.UpdateRecentMenus();
ide.AdjustFileMenus();
settingsContainer.Save();
-
+
return document;
}
else
SetCurrentContext(codeEditor.globalContext);
SetTopContext(codeEditor.globalContext);
SetGlobalContext(codeEditor.globalContext);
-
+
SetDefines(&codeEditor.defines);
SetImports(&codeEditor.imports);
SetActiveDesigner(codeEditor.designer);
-
+
sheet.codeEditor = codeEditor;
toolBox.codeEditor = codeEditor;
if(projectView && projectView.project)
{
bool isCObject = false;
- ProjectNode node = projectView.GetNodeFromWindow(client, null, false, false);
- if(!node && (node = projectView.GetNodeFromWindow(client, null, false, true)))
+ ProjectNode node = projectView.GetNodeFromWindow(client, null, true, false, null);
+ if(!node && (node = projectView.GetNodeFromWindow(client, null, true, true, null)))
isCObject = true;
if(node)
{
if(isCObject)
ChangeExtension(node.name, "c", nodeName);
sprintf(name, $"Compile %s", isCObject ? nodeName : node.name);
- projectCompileItem =
+ projectCompileItem =
{
copyText = true, text = name, c, ctrlF7, disabled = projectView.buildInProgress;
{
if(projectView)
{
- bool result = false;
bool isCObject = false;
- ProjectNode node = null;
- for(p : ide.workspace.projects)
- {
- node = projectView.GetNodeFromWindow(activeClient, p, true, false);
- if(node) break;
- }
- if(!node && (node = projectView.GetNodeFromWindow(activeClient, null, true, true)))
- isCObject = true;
+ bool isExcluded = false;
+ ProjectNode node = projectView.GetNodeForCompilationFromWindow(activeClient, true, &isExcluded, &isCObject);
if(node)
{
- List<ProjectNode> nodes { };
- nodes.Add(node);
- projectView.Compile(node.project, nodes, mods.ctrl && mods.shift, isCObject ? cObject : normal);
- delete nodes;
- result = true;
+ if(isExcluded)
+ ide.outputView.buildBox.Logf($"%s %s is excluded from current build configuration.\n", isCObject ? "Object file" : "File", node.name);
+ else
+ {
+ List<ProjectNode> nodes { };
+ nodes.Add(node);
+ projectView.Compile(node.project, nodes, mods.ctrl && mods.shift, isCObject ? cObject : normal);
+ delete nodes;
+ }
}
- if(!result && node)
- ide.outputView.buildBox.Logf($"File %s is excluded from current build configuration.\n", node.name);
}
return true;
}
{
driverItems[c] = MenuItem { driversMenu, app.drivers[c], NotifySelect = NotifySelectDisplayDriver };
driverItems[c].id = c;
- driverItems[c].isRadio = true;
+ driverItems[c].isRadio = true;
}
*/
driverItems = new MenuItem[2];
#if defined(__unix__)
driverItems[0] = MenuItem { driversMenu, "X", NotifySelect = NotifySelectDisplayDriver };
driverItems[0].id = 0;
- driverItems[0].isRadio = true;
+ driverItems[0].isRadio = true;
#else
driverItems[0] = MenuItem { driversMenu, "GDI", NotifySelect = NotifySelectDisplayDriver };
driverItems[0].id = 0;
- driverItems[0].isRadio = true;
+ driverItems[0].isRadio = true;
#endif
driverItems[1] = MenuItem { driversMenu, "OpenGL", NotifySelect = NotifySelectDisplayDriver };
driverItems[1].id = 1;
- driverItems[1].isRadio = true;
+ driverItems[1].isRadio = true;
/* skinItems = new MenuItem[app.numSkins];
for(c = 0; c < app.numSkins; c++)
{
skinItems[c] = MenuItem {skinsMenu, app.skins[c], NotifySelect = NotifySelectDisplaySkin };
skinItems[c].id = c;
- skinItems[c].isRadio = true;
+ skinItems[c].isRadio = true;
}
*/
ideFileDialog.master = this;