// Compile actual file
// Execute
ToolButton buttonRun { this, toolTip = $"Run", menuItemPtr = IDEItem(projectRunItem), disabled = true; };
+#ifdef IDE_SHOW_INSTALL_MENU_BUTTON
+ ToolButton buttonInstall { this, toolTip = $"Install", menuItemPtr = IDEItem(projectInstallItem), disabled = true; };
+#endif
ToolSeparator separator4 { this };
bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
{
if(row)
- {
- for(prj : ide.workspace.projects)
- {
- for(cfg : prj.configurations)
- {
- if(cfg.name && !strcmp(cfg.name, row.string))
- {
- prj.config = cfg;
- break;
- }
- }
- }
- ide.UpdateToolBarActiveConfigs(true);
- ide.projectView.Update(null);
- }
+ ide.workspace.SelectActiveConfig(row.string);
return true;
}
};
MenuItem * driverItems, * skinItems;
StatusField pos { width = 150 };
StatusField ovr, caps, num;
+ DualPipe documentor;
BitmapResource back { ":ecereBack.jpg", window = this };
BitmapResource bmpBp { ":codeMarks/breakpoint.png", window = this };
return true;
}
- bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
- {
- if(active)
- ide.RepositionWindows(false);
- return true;
- }
-
bool OnClose(bool parentClosing)
{
visible = false;
{
parent = this, font = { panelFont.faceName, panelFont.size };
- void OnGotoLine(char * line)
+ void OnSelectFrame(int frameIndex)
{
- int stackLvl;
- stackLvl = atoi(line);
- ide.debugger.GoToStackFrameLine(stackLvl, true);
- }
-
- void OnSelectFrame(int lineNumber)
- {
- ide.debugger.SelectFrame(lineNumber);
+ ide.debugger.GoToStackFrameLine(frameIndex, true);
+ if(frameIndex >= 0)
+ ide.debugger.SelectFrame(frameIndex);
}
void OnToggleBreakpoint()
return true;
}
- bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
- {
- if(active)
- ide.RepositionWindows(false);
- return true;
- }
-
bool OnClose(bool parentClosing)
{
visible = false;
return true;
}
- bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
- {
- if(active)
- ide.RepositionWindows(false);
- return true;
- }
-
bool OnClose(bool parentClosing)
{
visible = false;
{
if(!projectView && gotWhatWeWant)
ChangeFileDialogsDirectory(ideFileDialog.currentDirectory, true);
+ ide.RepositionWindows(false);
break;
}
}
delete command;
}
else
+ {
OpenFile(file, normal, true, isProjectFile ? "txt" : null, no, normal, mods.ctrl && mods.shift);
+ ide.RepositionWindows(false);
+ }
break;
}
id++;
{
DialogResult result;
NewProjectDialog newProjectDialog { master = this };
+ incref newProjectDialog;
result = newProjectDialog.Modal();
if(result == ok)
{
}
}
}
+ delete newProjectDialog;
}
return true;
}
return true;
}
}
+ MenuItem projectInstallItem
+ {
+#ifdef IDE_SHOW_INSTALL_MENU_BUTTON
+ projectMenu, $"Install", t, disabled = true;
+#endif
+ bitmap = { ":status/software-update-available.png" };
+ bool NotifySelect(MenuItem selection, Modifiers mods)
+ {
+ if(projectView)
+ projectView.ProjectInstall(projectView.active ? selection : null, mods);
+ return true;
+ }
+ }
MenuItem projectCompileItem;
Menu debugMenu { menu, $"Debug", d, hasMargin = true };
MenuItem debugStartResumeItem
return true;
}
}
+#ifndef __WIN32__
+ MenuDivider { debugMenu };
+ MenuItem debugUseValgrindItem
+ {
+ debugMenu, $"Use Valgrind", d, disabled = true, checkable = true;
+ bool NotifySelect(MenuItem selection, Modifiers mods)
+ {
+ if(ide.workspace)
+ {
+ ide.workspace.useValgrind = selection.checked;
+ ide.workspace.Save();
+ }
+ ide.AdjustValgrindMenus();
+ return true;
+ }
+ }
+ Menu debugValgrindLeakCheckItem { debugMenu, $"Valgrind Leak Check", h };
+ MenuItem debugValgrindNoLeakCheckItem { debugValgrindLeakCheckItem, $"No" , f, id = ValgrindLeakCheck::no , checkable = true, disabled = true; NotifySelect = ValgrindLCSelect; }
+ MenuItem debugValgrindSummaryLeakCheckItem { debugValgrindLeakCheckItem, $"Summary", f, id = ValgrindLeakCheck::summary, checkable = true, disabled = true; NotifySelect = ValgrindLCSelect, checked = true; }
+ MenuItem debugValgrindYesLeakCheckItem { debugValgrindLeakCheckItem, $"Yes" , f, id = ValgrindLeakCheck::yes , checkable = true, disabled = true; NotifySelect = ValgrindLCSelect; }
+ MenuItem debugValgrindFullLeakCheckItem { debugValgrindLeakCheckItem, $"Full" , f, id = ValgrindLeakCheck::full , checkable = true, disabled = true; NotifySelect = ValgrindLCSelect; }
+ bool ValgrindLCSelect(MenuItem selection, Modifiers mods)
+ {
+ if(ide.workspace)
+ {
+ if(selection.checked)
+ {
+ ValgrindLeakCheck vgLeakCheck = (ValgrindLeakCheck)selection.id;
+
+ debugValgrindNoLeakCheckItem.checked = debugValgrindNoLeakCheckItem.id == vgLeakCheck;
+ debugValgrindSummaryLeakCheckItem.checked = debugValgrindSummaryLeakCheckItem.id == vgLeakCheck;
+ debugValgrindYesLeakCheckItem.checked = debugValgrindYesLeakCheckItem.id == vgLeakCheck;
+ debugValgrindFullLeakCheckItem.checked = debugValgrindFullLeakCheckItem.id == vgLeakCheck;
+
+ ide.workspace.vgLeakCheck = vgLeakCheck;
+ ide.workspace.Save();
+ }
+ else
+ selection.checked = true;
+ }
+ return true;
+ }
+ Menu debugValgrindRedzoneSizeItem { debugMenu, $"Valgrind Redzone Size", z };
+ MenuItem debugValgrindRS0Item { debugValgrindRedzoneSizeItem, $"0" , f, id = 0, checkable = true, disabled = true; NotifySelect = ValgrindRSSelect, checked = true; }
+ MenuItem debugValgrindRS16Item { debugValgrindRedzoneSizeItem, $"16" , f, id = 16, checkable = true, disabled = true; NotifySelect = ValgrindRSSelect; }
+ MenuItem debugValgrindRS32Item { debugValgrindRedzoneSizeItem, $"32" , f, id = 32, checkable = true, disabled = true; NotifySelect = ValgrindRSSelect; }
+ MenuItem debugValgrindRS64Item { debugValgrindRedzoneSizeItem, $"64" , f, id = 64, checkable = true, disabled = true; NotifySelect = ValgrindRSSelect; }
+ MenuItem debugValgrindRS128Item { debugValgrindRedzoneSizeItem, $"128", f, id = 128, checkable = true, disabled = true; NotifySelect = ValgrindRSSelect; }
+ MenuItem debugValgrindRS256Item { debugValgrindRedzoneSizeItem, $"256", f, id = 256, checkable = true, disabled = true; NotifySelect = ValgrindRSSelect; }
+ MenuItem debugValgrindRS512Item { debugValgrindRedzoneSizeItem, $"512", f, id = 512, checkable = true, disabled = true; NotifySelect = ValgrindRSSelect; }
+ bool ValgrindRSSelect(MenuItem selection, Modifiers mods)
+ {
+ if(ide.workspace)
+ {
+ if(selection.checked)
+ {
+ int vgRedzoneSize = (int)selection.id;
+
+ debugValgrindRS0Item.checked = debugValgrindRS0Item.id == vgRedzoneSize;
+ debugValgrindRS16Item.checked = debugValgrindRS16Item.id == vgRedzoneSize;
+ debugValgrindRS32Item.checked = debugValgrindRS32Item.id == vgRedzoneSize;
+ debugValgrindRS64Item.checked = debugValgrindRS64Item.id == vgRedzoneSize;
+ debugValgrindRS128Item.checked = debugValgrindRS128Item.id == vgRedzoneSize;
+ debugValgrindRS256Item.checked = debugValgrindRS256Item.id == vgRedzoneSize;
+ debugValgrindRS512Item.checked = debugValgrindRS512Item.id == vgRedzoneSize;
+
+ ide.workspace.vgRedzoneSize = vgRedzoneSize;
+ ide.workspace.Save();
+ }
+ else
+ selection.checked = true;
+ }
+ return true;
+ }
+ MenuItem debugValgrindTrackOriginsItem
+ {
+ debugMenu, $"Valgrind Track Origins", k, checkable = true, disabled = true;
+ bool NotifySelect(MenuItem selection, Modifiers mods)
+ {
+ if(ide.workspace)
+ {
+ ide.workspace.vgTrackOrigins = selection.checked;
+ ide.workspace.Save();
+ }
+ return true;
+ }
+ };
+#endif
MenuDivider { debugMenu };
MenuItem debugStepIntoItem
{
}
}
MenuPlacement debugSkipRunToCursorItem { debugMenu, $"Run To Cursor Skipping Breakpoints", u };
- MenuPlacement debugSkipRunToCursorAtSameLevelItem { debugMenu, $"Run To Cursor At Same Level Skipping Breakpoints", s };
+ MenuPlacement debugSkipRunToCursorAtSameLevelItem { debugMenu, $"Run To Cursor At Same Level Skipping Breakpoints", l };
//MenuDivider { debugMenu };
//MenuPlacement debugToggleBreakpoint { debugMenu, "Toggle Breakpoint", t };
MenuPlacement imageMenu { menu, $"Image", i };
helpMenu, $"API Reference", r, f1;
bool NotifySelect(MenuItem selection, Modifiers mods)
{
- char * p = new char[MAX_LOCATION];
- p[0] = '\0';
- strncpy(p, settingsContainer.moduleLocation, MAX_LOCATION); p[MAX_LOCATION-1] = '\0';
- PathCat(p, "documentor");
-#if defined(__WIN32__)
- ChangeExtension(p, "exe", p);
-#endif
- if(FileExists(p).isFile)
- Execute(p);
+ if(!documentor)
+ {
+ char * p = new char[MAX_LOCATION];
+ p[0] = '\0';
+ strncpy(p, settingsContainer.moduleLocation, MAX_LOCATION); p[MAX_LOCATION-1] = '\0';
+ PathCat(p, "documentor");
+ #if defined(__WIN32__)
+ ChangeExtension(p, "exe", p);
+ #endif
+ if(!FileExists(p).isFile)
+ strcpy(p, "documentor");
+
+ documentor = DualPipeOpen({ input = true, output = true, showWindow = true }, p);
+ delete p;
+ }
else
- Execute("documentor");
- delete p;
+ {
+ Process_ShowWindows(documentor.GetProcessID());
+ // documentor.Puts("Activate\n");
+ }
return true;
}
}
GDBDialog gdbDialog
{
master = this, parent = this;
- anchor = { left = 100, top = 100, right = 100, bottom = 100 };
+ //anchor = { left = 100, top = 100, right = 100, bottom = 100 };
void OnCommand(char * string)
{
anchor.bottom = bottomDistance;
if(child._class == class(CodeEditor) || child._class == class(Designer))
{
+ anchor.left = 300;
anchor.right = toolBoxVisible ? 150 : 0;
}
child.anchor = anchor;
toolBar.activeCompiler.disabled = unavailable;
toolBar.activeBitDepth.disabled = unavailable;
+#ifndef __WIN32__
+ debugUseValgrindItem.disabled = unavailable;
+ AdjustValgrindMenus();
+#endif
+
AdjustFileMenus();
AdjustBuildMenus();
AdjustDebugMenus();
}
+#ifndef __WIN32__
+ void AdjustValgrindMenus()
+ {
+ bool unavailable = !project || !debugUseValgrindItem.checked;
+ debugValgrindNoLeakCheckItem.disabled = unavailable;
+ debugValgrindSummaryLeakCheckItem.disabled = unavailable;
+ debugValgrindYesLeakCheckItem.disabled = unavailable;
+ debugValgrindFullLeakCheckItem.disabled = unavailable;
+
+ debugValgrindTrackOriginsItem.disabled = unavailable;
+
+ debugValgrindRS0Item.disabled = unavailable;
+ debugValgrindRS16Item.disabled = unavailable;
+ debugValgrindRS32Item.disabled = unavailable;
+ debugValgrindRS64Item.disabled = unavailable;
+ debugValgrindRS128Item.disabled = unavailable;
+ debugValgrindRS256Item.disabled = unavailable;
+ debugValgrindRS512Item.disabled = unavailable;
+ }
+#endif
+
property bool hasOpenedCodeEditors
{
get
void AdjustBuildMenus()
{
bool unavailable = project && projectView.buildInProgress;
+ bool naForRun = unavailable || !project || project.GetTargetType(project.config) != executable;
projectNewItem.disabled = unavailable;
toolBar.buttonNewProject.disabled = unavailable;
projectCloseItem.disabled = unavailable;
// toolBar.buttonCloseProject.disabled = unavailable;
- projectRunItem.disabled = unavailable || project.GetTargetType(project.config) != executable;
- toolBar.buttonRun.disabled = unavailable || project.GetTargetType(project.config) != executable;
+ projectRunItem.disabled = naForRun;
+ toolBar.buttonRun.disabled = naForRun;
projectBuildItem.disabled = false;
projectBuildItem.text = unavailable ? $"Stop Build" : $"Build";
// toolBar.buttonRealClean.disabled = unavailable;
projectRegenerateItem.disabled = unavailable;
toolBar.buttonRegenerateMakefile.disabled = unavailable;
+#ifdef IDE_SHOW_INSTALL_MENU_BUTTON
+ projectInstallItem.disabled = unavailable;
+ toolBar.buttonInstall.disabled = unavailable;
+#endif
projectCompileItem.disabled = unavailable;
AdjustPopupBuildMenus();
menu = projectView.popupMenu.menu.FindItem(ProjectView::ProjectClean, 0); if(menu) menu.disabled = unavailable;
menu = projectView.popupMenu.menu.FindItem(ProjectView::ProjectRealClean, 0); if(menu) menu.disabled = unavailable;
menu = projectView.popupMenu.menu.FindItem(ProjectView::ProjectRegenerate, 0); if(menu) menu.disabled = unavailable;
+ menu = projectView.popupMenu.menu.FindItem(ProjectView::ProjectInstall, 0); if(menu) menu.disabled = unavailable;
menu = projectView.popupMenu.menu.FindItem(ProjectView::ProjectRemove, 0); if(menu) menu.disabled = unavailable;
menu = projectView.popupMenu.menu.FindItem(ProjectView::FileClean, 0); if(menu) menu.disabled = unavailable;
menu = projectView.popupMenu.menu.FindItem(ProjectView::FileCompile, 0); if(menu) menu.disabled = unavailable;
return null;
//project = LoadProject(filePath, null);
}
-
+
if(workspace)
{
char absolutePath[MAX_LOCATION];
}
}
}
+ ide.RepositionWindows(false);
workspace.holdTracking = false;
workspace.timer.Start();
char filePath[MAX_LOCATION] = "";
char completePath[MAX_LOCATION];
int line = 0, col = 0;
+ int len = strlen(text);
Project prj = null;
FileAttribs fileAttribs;
- if(colon && (colon[1] == '/' || colon[1] == '\\'))
+ // support for valgrind output
+ if((s = strstr(text, "==")) && (s = strstr(s+2, "==")) && (s = strstr(s+2, ":")) && (s = strstr(s+1, ":")))
{
- path = (colon - 1 > path) ? colon - 1 : path;
- colon = strstr(colon + 1, ":");
+ colon = s;
+ for(; s>text; s--)
+ {
+ if(*s == '(')
+ {
+ path = s+1;
+ break;
+ }
+ }
+ /*for(s=colon; *s; s++)
+ {
+ if(*s == ')')
+ {
+ *s = '\0';;
+ break;
+ }
+ }*/
+ //*colon = '\0';
+ //line = atoi(colon+1);
}
- if(*path == '*' && (s = strchr(path+1, '*')))
+ // support for "Found n match(es) in "file/path";
+ else if(path[len-1] == '\"' && strstr(path, $"Found %d match%s in \"%s\"%s\n\n"."Found") && strstr(path, $"match") && strstr(path, $"in") && (s = strstr(path, "\"")) && s != path+len-1)
+ {
path = s+1;
- while(isspace(*path)) path++;
+ }
+ else
+ {
+ if(colon && (colon[1] == '/' || colon[1] == '\\'))
+ {
+ path = (colon - 1 > path) ? colon - 1 : path;
+ colon = strstr(colon + 1, ":");
+ }
+ if(*path == '*' && (s = strchr(path+1, '*')))
+ path = s+1;
+ while(isspace(*path)) path++;
+ }
if(*path == '(')
{
char * close = strchr(path, ')');
if((fileAttribs = FileExists(completePath)))
CodeLocationGoTo(completePath, fileAttribs, line, col);
- else
+ else if(ide.workspace)
{
+ bool done = false;
for(p : ide.workspace.projects)
{
strcpy(completePath, p.topNode.path);
PathCat(completePath, filePath);
- if((fileAttribs = FileExists(completePath)))
+ if((fileAttribs = FileExists(completePath)).isFile)
{
CodeLocationGoTo(completePath, fileAttribs, line, col);
+ done = true;
break;
}
}
+ if(!done)
+ {
+ for(p : ide.workspace.projects)
+ {
+ ProjectNode node = p.topNode.Find(filePath, false);
+ if(node)
+ {
+ node.GetFullFilePath(completePath);
+ if((fileAttribs = FileExists(completePath)).isFile)
+ {
+ CodeLocationGoTo(completePath, fileAttribs, line, col);
+ break;
+ }
+ }
+ }
+ }
}
}
}
delete driverItems;
delete skinItems;
delete ideSettings;
+ if(documentor)
+ {
+ documentor.Puts("Quit\n");
+ documentor.Wait();
+ delete documentor;
+ }
}
}
bool Init()
{
+ char ext[MAX_EXTENSION];
SetLoggingMode(stdOut, null);
//SetLoggingMode(debug, null);
settingsContainer.Load();
+ if(argc > 1 && !strcmpi(GetExtension(argv[1], ext), "3ds"))
+ {
+ app.driver = "OpenGL";
+ ide.driverItems[1].checked = true;
+ }
+ else
+ {
#if defined(__unix__) || defined(__APPLE__)
- app.driver = (ideSettings.displayDriver && !strcmp(ideSettings.displayDriver, "OpenGL")) ? ideSettings.displayDriver : "X";
+ app.driver = (ideSettings.displayDriver && !strcmp(ideSettings.displayDriver, "OpenGL")) ? ideSettings.displayDriver : "X";
#else
- app.driver = (ideSettings.displayDriver && !strcmp(ideSettings.displayDriver, "OpenGL")) ? ideSettings.displayDriver : "GDI";
+ app.driver = (ideSettings.displayDriver && !strcmp(ideSettings.displayDriver, "OpenGL")) ? ideSettings.displayDriver : "GDI";
#endif
- ide.driverItems[ideSettings.displayDriver && !strcmp(ideSettings.displayDriver,"OpenGL")].checked = true;
+ ide.driverItems[ideSettings.displayDriver && !strcmp(ideSettings.displayDriver,"OpenGL")].checked = true;
+ }
SetInIDE(true);
return true;
}
+ bool Cycle(bool idle)
+ {
+ if(ide.documentor)
+ {
+ if(ide.documentor.Peek())
+ {
+ char line[1024];
+ ide.documentor.GetLine(line, sizeof(line));
+ if(!strcmpi(line, "Exited"))
+ {
+ ide.documentor.CloseInput();
+ ide.documentor.CloseOutput();
+ ide.documentor.Wait();
+ delete ide.documentor;
+ }
+ }
+ if(ide.documentor && ide.documentor.eof)
+ {
+ ide.documentor.CloseInput();
+ ide.documentor.CloseOutput();
+ ide.documentor.Wait();
+ delete ide.documentor;
+ }
+ }
+ return true;
+ }
+
bool LoadIncludeFile()
{
bool result = false;