codloc = CodeLocation::ParseCodeLocation(location);
if(codloc)
{
- CodeEditor editor = (CodeEditor)ide.OpenFile(codloc.absoluteFile, normal, true, null, no, normal, false);
+ CodeEditor editor = (CodeEditor)ide.OpenFile(codloc.absoluteFile, false, true, null, no, normal, false);
if(editor)
{
EditBox editBox = editor.editBox;
ide.callStackView.Show();
if(frame.absoluteFile)
- editor = (CodeEditor)ide.OpenFile(frame.absoluteFile, normal, true, null, no, normal, false);
+ editor = (CodeEditor)ide.OpenFile(frame.absoluteFile, false, true, null, no, normal, false);
if(!editor && frame.file)
frame.absoluteFile = ide.workspace.GetAbsolutePathFromRelative(frame.file);
if(!frame.absoluteFile && askForLocation && frame.file)
}
}
if(!editor && frame.absoluteFile)
- editor = (CodeEditor)ide.OpenFile(frame.absoluteFile, normal, true, null, no, normal, false);
+ editor = (CodeEditor)ide.OpenFile(frame.absoluteFile, false, true, null, no, normal, false);
if(editor)
ide.RepositionWindows(false);
ide.Update(null);
if(!codeEditor && goodFrame)
{
- codeEditor = (CodeEditor)ide.OpenFile(activeFrame.absoluteFile, normal, false, null, no, normal, false);
+ codeEditor = (CodeEditor)ide.OpenFile(activeFrame.absoluteFile, false, false, null, no, normal, false);
if(codeEditor)
{
codeEditor.inUseDebug = true;
};
BreakpointsView breakpointsView { parent = this };
- ToolBox toolBox { parent = this };
- Sheet sheet { parent = this };
+ ToolBox toolBox { parent = this, visible = false };
+ Sheet sheet { parent = this, visible = false };
char * tmpPrjDir;
property char * tmpPrjDir { set { delete tmpPrjDir; if(value) tmpPrjDir = CopyString(value); } get { return tmpPrjDir; } };
bitmap = { ":actions/docNew.png" };
bool NotifySelect(MenuItem selection, Modifiers mods)
{
- Window document = (Window)NewCodeEditor(this, normal, false);
+ Window currentDoc = activeClient;
+ bool maximizeDoc = ((currentDoc && currentDoc.state == maximized) || (!currentDoc && !projectView));
+ Window document = (Window)NewCodeEditor(this, maximizeDoc ? maximized : normal, false);
+ RepositionWindows(false);
document.NotifySaved = DocumentSaved;
return true;
}
for(c = 0; c < numSelections; c++)
{
- if(OpenFile(multiFilePaths[c], normal, true, fileTypes[ideFileDialog.fileType].typeExtension, no, normal, mods.ctrl && mods.shift))
+ if(OpenFile(multiFilePaths[c], false, true, fileTypes[ideFileDialog.fileType].typeExtension, no, normal, mods.ctrl && mods.shift))
gotWhatWeWant = true;
}
if(gotWhatWeWant ||
}
else
{
- OpenFile(file, normal, true, isProjectFile ? "txt" : null, no, normal, mods.ctrl && mods.shift);
+ OpenFile(file, false, true, isProjectFile ? "txt" : null, no, normal, mods.ctrl && mods.shift);
ide.RepositionWindows(false);
}
break;
delete command;
}
else
- OpenFile(file, normal, true, null, no, normal, mods.ctrl && mods.shift);
+ OpenFile(file, false, true, null, no, normal, mods.ctrl && mods.shift);
break;
}
id++;
ideProjectFileDialog.text = openProjectFileDialogTitle;
if(ideProjectFileDialog.Modal() == ok)
{
- OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, normal, mods.ctrl && mods.shift);
+ OpenFile(ideProjectFileDialog.filePath, false, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, normal, mods.ctrl && mods.shift);
//ChangeProjectFileDialogDirectory(ideProjectFileDialog.currentDirectory);
}
return true;
{
if(ideProjectFileDialog.Modal() == ok)
{
- if(OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, add, mods.ctrl && mods.shift))
+ if(OpenFile(ideProjectFileDialog.filePath, false, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, add, mods.ctrl && mods.shift))
break;
if(MessageBox { type = yesNo, master = this, text = $"Error opening project file",
contents = $"Add a different project?" }.Modal() == no)
findInFilesDialog.SearchStop();
findInFilesDialog.currentDirectory = workingDir;
}
+ sheet.visible = false;
+ toolBox.visible = false;
+ outputView.visible = false;
ideMainFrame.text = titleECEREIDE;
ide.AdjustMenus();
return true;
anchor.bottom = bottomDistance;
if(child._class == class(CodeEditor) || child._class == class(Designer))
{
- anchor.left = 300;
+ anchor.left = (sheet.visible || (projectView && projectView.visible)) ? 300 : 0;
anchor.right = toolBoxVisible ? 150 : 0;
}
child.anchor = anchor;
this.modifiedDocument = false;
this.Destroy(0);
- this = ide.OpenFile(fileName, normal, true, null, no, normal, noParsing);
+ this = ide.OpenFile(fileName, false, true, null, no, normal, noParsing);
if(this)
{
this.anchor = anchor;
return false;
}
- Window OpenFile(char * origFilePath, WindowState state, bool visible, char * type, OpenCreateIfFails createIfFails, OpenMethod openMethod, bool noParsing)
+ Window OpenFile(char * origFilePath, bool dontMaximize, bool visible, char * type, OpenCreateIfFails createIfFails, OpenMethod openMethod, bool noParsing)
{
char extension[MAX_EXTENSION] = "";
Window document = null;
bool needFileModified = true;
char winFilePath[MAX_LOCATION];
char * filePath = strstr(origFilePath, "http://") == origFilePath ? strcpy(winFilePath, origFilePath) : GetSystemPathBuffer(winFilePath, origFilePath);
-
+ Window currentDoc = activeClient;
+ bool maximizeDoc = !dontMaximize && ((currentDoc && currentDoc.state == maximized) || (!currentDoc && !projectView));
if(!type)
{
GetExtension(filePath, extension);
CreateProjectView(workspace, filePath);
document = projectView;
+ toolBox.visible = true;
+ sheet.visible = true;
+ projectView.MakeActive();
+
workspace.ParseLoadedBreakpoints();
workspace.DropInvalidBreakpoints(null);
workspace.Save();
{
if(ofi.state != closed)
{
- Window file = OpenFile(ofi.path, normal, true, null, no, normal, noParsing);
+ Window file = OpenFile(ofi.path, false, true, null, no, normal, noParsing);
if(file)
{
char fileName[MAX_LOCATION];
createIfFails = yes;
if(createIfFails == yes || createIfFails == whatever)
{
- document = (Window)NewCodeEditor(this, state, true);
+ document = (Window)NewCodeEditor(this, maximizeDoc ? maximized : normal, true);
if(document)
document.fileName = filePath;
}
if(needFileModified)
document.OnFileModified = OnFileModified;
document.NotifySaved = DocumentSaved;
+ if(maximizeDoc && document.hasMaximize)
+ document.state = maximized;
if(isProject)
ideSettings.AddRecentProject(document.fileName);
}
else
{
- CodeEditor codeEditor = (CodeEditor)OpenFile(path, normal, true, ext, no, normal, false);
+ CodeEditor codeEditor = (CodeEditor)OpenFile(path, false, true, ext, no, normal, false);
if(codeEditor && line)
{
EditBox editBox = codeEditor.editBox;
}
else
{
+ if(!client && !projectView && sheet.visible)
+ {
+ if(sheet)
+ sheet.visible = false;
+ toolBox.visible = false;
+ }
if(sheet)
sheet.codeEditor = null;
toolBox.codeEditor = null;
break;
}
else
- ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, openAsText ? "txt" : null, yes, normal, false);
+ ide.OpenFile(fullPath, app.argc > 2, true, openAsText ? "txt" : null, yes, normal, false);
}
else if(strstr(fullPath, "http://") == fullPath)
- ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, openAsText ? "txt" : null, yes, normal, false);
+ ide.OpenFile(fullPath, app.argc > 2, true, openAsText ? "txt" : null, yes, normal, false);
}
}
if(passThrough && projectView && projectView.project && workspace)
char fullPath[MAX_LOCATION];
GetWorkingDir(fullPath, MAX_LOCATION);
PathCat(fullPath, app.argv[c]);
- ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, null, yes, normal, false);
+ ide.OpenFile(fullPath, app.argc > 2, true, null, yes, normal, false);
}
*/
if(!LoadIncludeFile())
PrintLn("error: unable to load :crossplatform.mk file inside ide binary.");
+ ideMainFrame.Create();
+ if(app.argc > 2)
+ ide.MenuWindowTileVert(null, 0);
return true;
}
PathCatSlash(filePath, moduleName);
}
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
if(!codeEditor && !strcmp(ext, "c"))
{
char ecName[MAX_LOCATION];
ChangeExtension(filePath, "ec", ecName);
- codeEditor = (CodeEditor)ide.OpenFile(ecName, normal, true, null, no, normal, noParsing);
+ codeEditor = (CodeEditor)ide.OpenFile(ecName, false, true, null, no, normal, noParsing);
}
if(!codeEditor)
{
strcpy(filePath, prj.topNode.path);
PathCatSlash(filePath, node.path);
PathCatSlash(filePath, node.name);
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
if(codeEditor)
break;
}
strcpy(filePath, prj.topNode.path);
PathCatSlash(filePath, node.path);
PathCatSlash(filePath, node.name);
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
if(codeEditor)
break;
}
strcpy(filePath, prj.topNode.path);
PathCatSlash(filePath, node.path);
PathCatSlash(filePath, node.name);
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
if(codeEditor)
break;
}
{
char filePath[MAX_LOCATION];
node.GetFullFilePath(filePath);
- return ide.OpenFile(filePath, normal, true/*false Why was it opening hidden?*/, null, something, normal, noParsing) ? true : false;
+ return ide.OpenFile(filePath, false, true/*false Why was it opening hidden?*/, null, something, normal, noParsing) ? true : false;
}
void AddNode(ProjectNode node, DataRow addTo)
subclass(ClassDesignerBase) designerClass = eClass_GetDesigner(baseClass);
if(designerClass)
{
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal, false);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, false, false, null, whatever, normal, false);
strcpy(name, projectNode.name);
sprintf(name, "%s%d", upper, c);
if(className)
}
else // TODO: fix no symbols generated when ommiting {} for following else
{
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal, false);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, false, false, null, whatever, normal, false);
}
ide.sheet.visible = true;
ide.sheet.Activate();