parent = this, isDefault = true, disabled = true, position = { 170, 130 }, size = { 60 }, text = $"OK";
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
- char * prjName = projectName.contents;
+ const char * prjName = projectName.contents;
char filePath[MAX_LOCATION];
char extension[MAX_EXTENSION];
ProjectConfig debug, release;
char workspaceFile[MAX_LOCATION];
strcpy(workspaceFile, prj.filePath);
ChangeExtension(workspaceFile, WorkspaceExtension, workspaceFile);
- workspace = Workspace { compiler = ideSettings.defaultCompiler, workspaceFile = workspaceFile };
+ workspace = Workspace { activeCompiler = ideSettings.defaultCompiler, workspaceFile = workspaceFile };
+ workspace.Init();
}
- workspace.projects.Add(prj);
+ workspace.AddProject(prj, null);
ide.findInFilesDialog.AddProjectItem(prj);
ide.findInFilesDialog.mode = FindInFilesMode::project;
ide.findInFilesDialog.currentDirectory = prj.topNode.path;
StripLastDirectory(newWorkingDir, newWorkingDir);
ide.ChangeProjectFileDialogDirectory(newWorkingDir);
}
+ ide.toolBox.visible = true;
if(createFormOption)
{
if(prj && projectWindow)
{
- CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.activeCompiler);
ProjectConfig config = prj.config;
projectWindow.ShowOutputBuildLog(true);
projectWindow.DisplayCompiler(compiler, false);
parent = this, text = $"Create Form", hotKey = altF, position = { 200, 30 };
isCheckbox = true, checked = true;
};
-
+
EditBox projectName
{
parent = this, textHorzScroll = true, position = { 10, 30 }, size = { 160 };
char name[MAX_FILENAME];
char tmp[MAX_FILENAME];
char lastPart[MAX_LOCATION];
- char * text = editBox.contents;
+ const char * text = editBox.contents;
// drop leading path stuff that has no business here
GetLastDirectory(text, tmp);
//replacing this: NotifyUpdate = EditBoxUpdate;
okBtn.disabled = !(text[0] && projectName.contents[0]);
- GetWorkingDir(location, sizeof(location) - 1);
+ strcpy(location, ideSettings.ideProjectFileDialogLocation);
PathCatSlash(location, text);
GetLastDirectory(path, lastPart);
{
char location[MAX_LOCATION];
- if(ideSettings.ideProjectFileDialogLocation)
- strcpy(location, ideSettings.ideProjectFileDialogLocation);
- else
- GetWorkingDir(location, sizeof(location) - 1);
+ strcpy(location, ideSettings.ideProjectFileDialogLocation);
locationEditBox.path = location;
strcpy(path, location);
MessageBox { type = ok, master = this, text = tempDir, contents = $"Temporary directory does not exist." }.Modal();
return true;
}
-
+
ide.tmpPrjDir = tempDir;
strcpy(filePath, tempDir);
debug = ProjectConfig
{
name = CopyString("Debug");
- options =
+ options =
{
optimization = none;
fastMath = false;
char workspaceFile[MAX_LOCATION];
strcpy(workspaceFile, filePath);
ChangeExtension(workspaceFile, WorkspaceExtension, workspaceFile);
- workspace = Workspace { compiler = ideSettings.defaultCompiler, workspaceFile = workspaceFile };
- }
+ workspace = Workspace { activeCompiler = ideSettings.defaultCompiler, workspaceFile = workspaceFile };
+ }
- workspace.projects.Add(project);
+ workspace.AddProject(project, null);
ide.findInFilesDialog.AddProjectItem(project);
ide.findInFilesDialog.mode = FindInFilesMode::project;
ide.findInFilesDialog.currentDirectory = project.topNode.path;
projectWindow = ide.CreateProjectView(workspace, filePath);
{
- char extension[MAX_EXTENSION];
Window document = null;
for(document = ide.firstChild; document; document = document.next)
{
if(document.created && document.isDocument && document._class == class(CodeEditor))
{
- char * fileName = document.fileName;
+ const char * fileName = document.fileName;
if(strstr(fileName, "http://") == fileName)
{
char name[MAX_LOCATION];
{
CodeEditor codeEditor = (CodeEditor)document;
ide.projectView.AddFile(project.topNode, fileName, false, false);
- codeEditor.AdjustDebugMenus(ide.areDebugMenusUnavailable, ide.isBreakpointTogglingUnavailable, ide.isDebuggerExecuting, ide.isDebuggerStopped);
+ codeEditor.AdjustDebugMenus();
}
}
}
}
+ ide.toolBox.visible = true;
+
if(project.topNode.modified)
{
project.Save(filePath);
if(project && projectWindow)
{
- CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.activeCompiler);
ProjectConfig config = project.config;
projectWindow.ShowOutputBuildLog(true);
projectWindow.DisplayCompiler(compiler, false);
return true;
}
};
-
+
Button
{
parent = this, position = { 240, 70 }, size = { 60 }, hotKey = escape, text = $"Cancel";
NotifyClicked = ButtonCloseDialog;
};
-
+
QuickProjectDialog()
{
DataRow row;
}
}
-void ValidProjectNameBufCopy(char *output, char *input)
+void ValidProjectNameBufCopy(char *output, const char *input)
{
strcpy(output, input);
TrimLSpaces(output, output);
TrimRSpaces(output, output);
{
// todo: support '&', '.' and ' ' in project name on windows so that it may be used by all platforms.
- char * chars = "*|:\",<>?\\/&. ";
+ const char * chars = "*|:\",<>?\\/&. ";
char ch, * s = output, * o = output;
while((ch = *s++)) { if(!strchr(chars, ch)) *o++ = ch; }
*o = '\0';