../extras/gui/layout.ec \
../extras/gui/controls/StringsBox.ec \
../extras/types/DynamicString.ec \
- src/dialogs/ActiveCompilerDialog.ec \
src/dialogs/CompilersDetectionDialog.ec \
src/dialogs/FindInFilesDialog.ec \
src/dialogs/GlobalSettingsDialog.ec \
src/dialogs/NewProjectDialog.ec \
src/dialogs/NodeProperties.ec \
- src/dialogs/ProjectActiveConfig.ec \
src/dialogs/WorkspaceSettings.ec \
src/dialogs/ProjectTabSettings.ec \
src/project/Project.ec \
$(OBJ)DynamicString.sym: ../extras/types/DynamicString.ec
$(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c ../extras/types/DynamicString.ec -o $(OBJ)DynamicString.sym
-$(OBJ)ActiveCompilerDialog.sym: src/dialogs/ActiveCompilerDialog.ec
- $(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c src/dialogs/ActiveCompilerDialog.ec -o $(OBJ)ActiveCompilerDialog.sym
-
$(OBJ)CompilersDetectionDialog.sym: src/dialogs/CompilersDetectionDialog.ec
$(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c src/dialogs/CompilersDetectionDialog.ec -o $(OBJ)CompilersDetectionDialog.sym
$(OBJ)NodeProperties.sym: src/dialogs/NodeProperties.ec
$(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c src/dialogs/NodeProperties.ec -o $(OBJ)NodeProperties.sym
-$(OBJ)ProjectActiveConfig.sym: src/dialogs/ProjectActiveConfig.ec
- $(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c src/dialogs/ProjectActiveConfig.ec -o $(OBJ)ProjectActiveConfig.sym
-
$(OBJ)WorkspaceSettings.sym: src/dialogs/WorkspaceSettings.ec
$(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) -c src/dialogs/WorkspaceSettings.ec -o $(OBJ)WorkspaceSettings.sym
$(OBJ)DynamicString.c: ../extras/types/DynamicString.ec $(OBJ)DynamicString.sym | $(SYMBOLS)
$(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c ../extras/types/DynamicString.ec -o $(OBJ)DynamicString.c -symbols $(OBJ)
-$(OBJ)ActiveCompilerDialog.c: src/dialogs/ActiveCompilerDialog.ec $(OBJ)ActiveCompilerDialog.sym | $(SYMBOLS)
- $(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c src/dialogs/ActiveCompilerDialog.ec -o $(OBJ)ActiveCompilerDialog.c -symbols $(OBJ)
-
$(OBJ)CompilersDetectionDialog.c: src/dialogs/CompilersDetectionDialog.ec $(OBJ)CompilersDetectionDialog.sym | $(SYMBOLS)
$(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c src/dialogs/CompilersDetectionDialog.ec -o $(OBJ)CompilersDetectionDialog.c -symbols $(OBJ)
$(OBJ)NodeProperties.c: src/dialogs/NodeProperties.ec $(OBJ)NodeProperties.sym | $(SYMBOLS)
$(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c src/dialogs/NodeProperties.ec -o $(OBJ)NodeProperties.c -symbols $(OBJ)
-$(OBJ)ProjectActiveConfig.c: src/dialogs/ProjectActiveConfig.ec $(OBJ)ProjectActiveConfig.sym | $(SYMBOLS)
- $(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c src/dialogs/ProjectActiveConfig.ec -o $(OBJ)ProjectActiveConfig.c -symbols $(OBJ)
-
$(OBJ)WorkspaceSettings.c: src/dialogs/WorkspaceSettings.ec $(OBJ)WorkspaceSettings.sym | $(SYMBOLS)
$(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c src/dialogs/WorkspaceSettings.ec -o $(OBJ)WorkspaceSettings.c -symbols $(OBJ)
$(OBJ)DynamicString.o: $(OBJ)DynamicString.c
$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)DynamicString.c -o $(OBJ)DynamicString.o
-$(OBJ)ActiveCompilerDialog.o: $(OBJ)ActiveCompilerDialog.c
- $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)ActiveCompilerDialog.c -o $(OBJ)ActiveCompilerDialog.o
-
$(OBJ)CompilersDetectionDialog.o: $(OBJ)CompilersDetectionDialog.c
$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)CompilersDetectionDialog.c -o $(OBJ)CompilersDetectionDialog.o
$(OBJ)NodeProperties.o: $(OBJ)NodeProperties.c
$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)NodeProperties.c -o $(OBJ)NodeProperties.o
-$(OBJ)ProjectActiveConfig.o: $(OBJ)ProjectActiveConfig.c
- $(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)ProjectActiveConfig.c -o $(OBJ)ProjectActiveConfig.o
-
$(OBJ)WorkspaceSettings.o: $(OBJ)WorkspaceSettings.c
$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)WorkspaceSettings.c -o $(OBJ)WorkspaceSettings.o
{
"Folder" : "dialogs",
"Files" : [
- "ActiveCompilerDialog.ec",
"CompilersDetectionDialog.ec",
"FindInFilesDialog.ec",
"GlobalSettingsDialog.ec",
"NewProjectDialog.ec",
"NodeProperties.ec",
- "ProjectActiveConfig.ec",
"WorkspaceSettings.ec",
"ProjectTabSettings.ec"
]
project.topNode.modified = true;
project.MarkChanges(buildTab.backupNode);
ide.projectView.modifiedDocument = true;
+ ide.UpdateToolBarActiveConfigs(false);
ide.projectView.Update(null);
}
if(prjTabControl.curTab == workspaceTab && workspaceTab.modifiedDocument)
project.MarkChanges(backupNode);
project.topNode.modified = true;
ide.projectView.modifiedDocument = true;
+ ide.UpdateToolBarActiveConfigs(false);
ide.projectView.Update(null);
}
modifiedDocument = false;
String lastSelectionProject;
String lastSelectionProjectNode;
bool replaceMode;
+ SelectorButton starDir;
FindInFilesDialog()
{
import "GlobalSettingsDialog"
import "NewProjectDialog"
import "FindInFilesDialog"
-import "ActiveCompilerDialog"
#ifdef GDB_DEBUG_GUI
import "GDBDialog"
#endif
import "Project"
-import "ProjectActiveConfig"
import "ProjectConfig"
import "ProjectNode"
import "NodeProperties"
ToolButton buttonDebugStepOut { this, toolTip = $"Step Out", menuItemPtr = IDEItem(debugStepOutItem), disabled = true; };
// Shift+F10
ToolButton buttonDebugSkipStepOver { this, toolTip = $"Step Over Skipping Breakpoints", menuItemPtr = IDEItem(debugSkipStepOverItem), disabled = true; };
+
+ ToolSeparator separator5 { this };
+
+ Window spacer5 { this, size = { 4 } };
+
+ DropBox activeConfig
+ {
+ this, toolTip = $"Active Configuration(s)", size = { 160 };
+ 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);
+ }
+ return true;
+ }
+ };
+
+ Window spacer6 { this, size = { 4 } };
+
+ DropBox activeCompiler
+ {
+ this, toolTip = $"Active Compiler", size = { 160 };
+ bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
+ {
+ if(row && strcmp(row.string, ide.workspace.compiler))
+ {
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(row.string);
+ ide.workspace.compiler = row.string;
+ ide.projectView.ShowOutputBuildLog(true);
+ ide.projectView.DisplayCompiler(compiler, false);
+ for(prj : ide.workspace.projects)
+ ide.projectView.ProjectPrepareCompiler(prj, compiler);
+ delete compiler;
+ ide.workspace.Save();
+ }
+ return true;
+ }
+ };
+
+ Window spacer7 { this, size = { 4 } };
+
}
class IDEMainFrame : Window
}
}
MenuDivider { projectMenu };
- MenuItem activeCompilerItem
- {
- projectMenu, $"Active Compiler...", g, /*altF5, */disabled = true;
- bool NotifySelect(MenuItem selection, Modifiers mods)
- {
- projectView.MenuCompiler(null, mods);
- return true;
- }
- }
- MenuItem projectActiveConfigItem
- {
- projectMenu, $"Active Configuration...", g, altF5, disabled = true;
- bool NotifySelect(MenuItem selection, Modifiers mods)
- {
- projectView.MenuConfig(projectView.active ? selection : null, mods);
- return true;
- }
- }
MenuItem projectSettingsItem
{
projectMenu, $"Settings...", s, altF7, disabled = true;
void UpdateCompilerConfigs()
{
+ UpdateToolBarActiveCompilers();
if(workspace)
{
CompilerConfig compiler = ideSettings.GetCompilerConfig(workspace.compiler);
}
}
+ void UpdateToolBarActiveCompilers()
+ {
+ toolBar.activeCompiler.Clear();
+ for(compiler : ideSettings.compilerConfigs)
+ {
+ DataRow row = toolBar.activeCompiler.AddString(compiler.name);
+ if(workspace && workspace.compiler && !strcmp(compiler.name, workspace.compiler))
+ toolBar.activeCompiler.currentRow = row;
+ }
+ if(!toolBar.activeCompiler.currentRow)
+ toolBar.activeCompiler.currentRow = toolBar.activeCompiler.firstRow;
+ toolBar.activeCompiler.disabled = workspace == null;
+ }
+
+ void UpdateToolBarActiveConfigs(bool selectionOnly)
+ {
+ bool commonSelected = false;
+ DataRow row = toolBar.activeConfig.currentRow;
+ if(selectionOnly)
+ row = toolBar.activeConfig.FindRow(1);
+ else
+ {
+ toolBar.activeConfig.Clear();
+ row = toolBar.activeConfig.AddString("(Mixed)");
+ row.tag = 1;
+ }
+ if(workspace)
+ {
+ char * configName = null;
+ if(!selectionOnly)
+ {
+ Map<String, int> configs { }; // TOIMP: just need sort but using map until containers have sort
+ for(prj : workspace.projects)
+ {
+ for(cfg : prj.configurations)
+ {
+ if(cfg.name)
+ configs[cfg.name] = 1;
+ }
+ }
+ for(name : configs)
+ {
+ toolBar.activeConfig.AddString(&name);
+ }
+ delete configs;
+ }
+ if(projectView && projectView.project)
+ {
+ for(prj : workspace.projects)
+ {
+ if(prj.config && prj.config.name)
+ {
+ configName = prj.config.name;
+ break;
+ }
+ }
+ if(configName)
+ {
+ commonSelected = true;
+ for(prj : workspace.projects)
+ {
+ if(prj.config && (!prj.config.name || strcmp(prj.config.name, configName)))
+ {
+ commonSelected = false;
+ break;
+ }
+ }
+ }
+ }
+ if(commonSelected)
+ {
+ commonSelected = false;
+ for(row = toolBar.activeConfig.firstRow; row; row = row.next)
+ {
+ if(!strcmp(row.string, configName))
+ {
+ toolBar.activeConfig.currentRow = row;
+ commonSelected = true;
+ break;
+ }
+ }
+ }
+ }
+ if(!selectionOnly)
+ toolBar.activeConfig.Sort(null, 0);
+ if(!commonSelected)
+ toolBar.activeConfig.currentRow = row;
+ toolBar.activeConfig.disabled = workspace == null;
+ }
+
void AdjustMenus()
{
bool unavailable = !project;
projectAddItem.disabled = unavailable;
toolBar.buttonAddProject.disabled = unavailable;
- activeCompilerItem.disabled = unavailable;
- projectActiveConfigItem.disabled = unavailable;
projectSettingsItem.disabled = unavailable;
projectBrowseFolderItem.disabled = unavailable;
delete passArgs;
if(debugStart)
;//MenuDebugStart(debugStartResumeItem, 0); // <-- how TODO this without getting into the app.Wait lock
+
+ UpdateToolBarActiveConfigs(false);
+ UpdateToolBarActiveCompilers();
return true;
}
}
property::config = cfg.data;
+ ide.UpdateToolBarActiveConfigs(true);
ide.workspace.modified = true;
ide.projectView.Update(null);
}
MenuItem { popupContent, $"Remove project from workspace", r, NotifySelect = ProjectRemove }.disabled = buildMenuUnavailable;
MenuDivider { popupContent };
}
- MenuItem { popupContent, $"Active Configuration...", s, Key { f5, alt = true } , NotifySelect = MenuConfig };
MenuItem { popupContent, $"Settings...", s, Key { f7, alt = true } , NotifySelect = MenuSettings };
MenuDivider { popupContent };
MenuItem { popupContent, $"Browse Folder", w, NotifySelect = MenuBrowseFolder };
{
CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ ide.UpdateToolBarActiveConfigs(false);
for(config : project.configurations)
ProjectPrepareMakefile(project, forceExists, compiler, config);
return true;
}
- bool MenuConfig(MenuItem selection, Modifiers mods)
- {
- if(ProjectActiveConfig { master = parent, project = project }.Modal() == ok)
- ide.AdjustMenus();
- return true;
- }
-
- bool MenuCompiler(MenuItem selection, Modifiers mods)
- {
- ActiveCompilerDialog compilerDialog
- {
- master = parent;
- ideSettings = ideSettings, workspaceActiveCompiler = ide.workspace.compiler;
- };
- incref compilerDialog;
- if(compilerDialog.Modal() == ok && strcmp(compilerDialog.workspaceActiveCompiler, ide.workspace.compiler))
- {
- CompilerConfig compiler = ideSettings.GetCompilerConfig(compilerDialog.workspaceActiveCompiler);
- ide.workspace.compiler = compilerDialog.workspaceActiveCompiler;
- ide.projectView.ShowOutputBuildLog(true);
- ide.projectView.DisplayCompiler(compiler, false);
-
- for(prj : ide.workspace.projects)
- ide.projectView.ProjectPrepareCompiler(prj, compiler);
- delete compiler;
- }
- delete compilerDialog;
- return true;
- }
-
bool MenuSettings(MenuItem selection, Modifiers mods)
{
ProjectNode node = GetSelectedNode(true);