2 import "WorkspaceSettings"
3 import "ProjectTabSettings"
5 // import "SelectorBar"
7 static ProjectConfig config;
8 static Platform platform;
9 static ProjectNode currentNode;
10 static Project project;
12 static String MakeString(char * s, int len)
14 String string = new char[len+1];
15 memcpy(string, s, len);
20 class StringListBox : EditBox
22 textHorzScroll = true;
24 property Array<String> strings
34 bool quoted = strchr(item, ' ') != null;
48 Array<String> array { };
50 char * contents = property::contents;
54 for(c = 0; (ch = contents[c]); c++)
56 if(ch == ' ' && !quoted)
59 array.Add(MakeString(contents + start, c - start));
67 array.Add(MakeString(contents + start, c - start));
79 array.Add(MakeString(contents + start, c - start));
85 define dialogTitle = $"Project Settings";
86 static Color unfocusedSelectorColor { 70, 96, 166 };
87 class ProjectSettings : Window
90 background = formColor;
91 borderStyle = sizable;
92 minClientSize = { 650, 490 };
97 property Project project
102 projectTab.project = value;
105 buildTab.SelectNode(project.topNode, false);
107 if(project && project.topNode && project.topNode.name && project.topNode.name[0])
110 get { return ::project; }
113 property ProjectNode projectNode
115 set { buildTab.SelectNode(value, false); }
116 get { return currentNode; }
119 void UpdateDialogTitle()
121 //char * s = PrintString("Project Settings - ", project.topNode.fileName);
123 char * projectName = new char[strlen(project.topNode.name) + 1];
124 char * nodeName = currentNode && currentNode != project.topNode ? currentNode.name : "";
125 char * config = buildTab.selectedConfigName;
126 char * platform = buildTab.selectedPlatformName;
127 char * label = new char[strlen(dialogTitle) + 3 + strlen(project.topNode.name) + 3 +
128 strlen(nodeName) + 2 + strlen(config) + 1 + strlen(platform) + 1 + 1];
129 strcpy(label, dialogTitle);
130 strcat(label, " - ");
131 strcpy(projectName, project.topNode.name);
132 StripExtension(projectName);
133 strcat(label, projectName);
134 if(currentNode && currentNode.type != project)
136 strcat(label, " - ");
137 strcat(label, nodeName);
139 if(strlen(config) || strlen(platform))
143 strcat(label, config);
144 if(strlen(config) && strlen(platform))
147 strcat(label, platform);
160 TabControl prjTabControl
162 this, background = formColor, anchor = { left = 8, top = 4, right = 8, bottom = 38 };
164 ProjectTab projectTab { this, tabControl = prjTabControl };
165 BuildTab buildTab { this, tabControl = prjTabControl };
166 WorkspaceTab workspaceTab { this, tabControl = prjTabControl };
170 this, size = { 80, 22 };
171 anchor = { right = 8, bottom = 8 };
172 text = $"Cancel", hotKey = escape, id = DialogResult::cancel;
174 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
176 if(prjTabControl.curTab.modifiedDocument)
178 DialogResult diagRes = MessageBox
180 type = okCancel, master = ide,
181 text = $"Lose Changes?",
182 contents = $"Are you sure you wish to discard changes made to the build options?"
186 if(prjTabControl.curTab == buildTab)
188 buildTab.RevertChanges();
189 buildTab.modifiedDocument = false;
191 if(prjTabControl.curTab == workspaceTab)
193 workspaceTab.modifiedDocument = false;
195 if(prjTabControl.curTab == projectTab)
197 projectTab.modifiedDocument = false;
199 Destroy(DialogResult::cancel);
203 Destroy(DialogResult::cancel);
209 this, size = { 80, 22 };
210 anchor = { right = 96, bottom = 8 };
211 text = $"OK", isDefault = true;
213 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
215 if(prjTabControl.curTab == buildTab && buildTab.modifiedDocument)
217 buildTab.modifiedDocument = false;
219 project.topNode.modified = true;
220 project.MarkChanges(buildTab.backupNode);
221 ide.projectView.modifiedDocument = true;
222 ide.projectView.Update(null);
224 if(prjTabControl.curTab == workspaceTab && workspaceTab.modifiedDocument)
226 workspaceTab.SaveChanges();
227 workspaceTab.modifiedDocument = false;
229 if(prjTabControl.curTab == projectTab && projectTab.modifiedDocument)
231 projectTab.SaveChanges();
232 projectTab.modifiedDocument = false;
234 Destroy(DialogResult::ok);
242 prjTabControl.curTab = buildTab;
247 #define OPTION(x) ((uint)(&((ProjectOptions)0).x))
249 // TOFIX: USING T INSTEAD OF Z HERE CAUSED US SOME CONFLICTS WITH T IN Array TEMPLATES
251 class OptionBox<class Z> : CommonControl
253 bool mergeValues, configReplaces;
262 property Window editor
268 editor.OnRightButtonDown = OptionBox_OnRightButtonDown;
269 chainKeyDown = (void *)editor.OnKeyDown;
270 editor.OnKeyDown = OptionBox_OnKeyDown;
274 property bool visible { set { editor.visible = value; } get { return editor.visible; } }
275 property Window parent { set { editor.parent = value; Window::parent = value; master = value; editor.id = (int)this; } }
276 property Point position { set { editor.position = value; } }
277 property Size size { set { editor.size = value; } }
278 property Anchor anchor { set { editor.anchor = value; } }
279 property Key hotKey { set { editor.hotKey = value; } }
280 property char * text { set { editor.text = value; Window::text = value; } }
290 bool NotifySelect(MenuItem selection, Modifiers mods)
292 OptionBox ob = (OptionBox)id;
298 bool Window::OptionBox_OnRightButtonDown(int x, int y, Modifiers mods)
300 OptionBox ob = (OptionBox)id;
301 GuiApplication app = ((GuiApplication)__thisModule.application);
303 PopupMenu { null, this, menu = ob.clearMenu,
304 position = { absPosition.x + clientStart.x + x - app.desktop.position.x, absPosition.y + clientStart.y + y - app.desktop.position.y } }.Create();
308 bool Window::OptionBox_OnKeyDown(Key key, unichar ch)
310 OptionBox ob = (OptionBox)id;
311 if(key == Key { del, ctrl = true } || key == Key { keyPadDelete, ctrl = true })
316 return (((bool(*)(Window, Key, unichar)) ob.chainKeyDown)(this, key, ch);
319 // code: 0 = not set anywhere, 1 = overridden here, 2 = inherited
320 void SetAttribs(int code)
325 for(c = Window::parent.firstChild; c; c = c.next)
327 if(eClass_IsDerived(c._class, class(Label)))
330 if(label.labeledWindow == this)
338 for(c = editor.firstChild; c; c = c.next)
340 if(eClass_IsDerived(c._class, class(Label)))
347 // control.foreground = foreground;
349 if(code == 0 || code == 1)
351 editor.font = { editor.font.faceName, editor.font.size, bold = (code == 1) };
352 editor.background = white;
356 Color foreground = 0x0F3F66;
357 int r = foreground.r, g = foreground.g, b = foreground.b;
361 editor.font = { editor.font.faceName, editor.font.size };
363 r = (int)(alpha * r + src.r * (1 - alpha));
364 g = (int)(alpha * g + src.g * (1 - alpha));
365 b = (int)(alpha * b + src.b * (1 - alpha));
367 r = Max(0,Min(255,r));
368 g = Max(0,Min(255,g));
369 b = Max(0,Min(255,b));
371 editor.background = Color { (byte) r, (byte) g, (byte) b };
376 label.font = { editor.font.faceName, editor.font.size, bold = (code == 1) };
377 //label.foreground = foreground;
381 virtual void FinalizeLoading();
383 virtual void LoadOption(ProjectOptions options);
384 virtual void RetrieveOption(ProjectOptions options, bool isCfgOrPlt);
385 virtual void UnsetOption(ProjectOptions options)
388 *(Z*)((byte *)options + option) = value;
391 virtual bool OptionSet(ProjectOptions options)
393 // TOFIX: If you get a crash here, it might be because JSON.ec must be after ProjectConfig.ec in the project files
394 // JSON.ec must also be before ProjectSettings.ec in the project files
395 if(*(Z*)((byte *)options + option))
399 // BUG: OptionCheck = OptionSet; // Overrides derived classes OptionCheck ?
401 virtual bool OptionCheck(ProjectOptions options)
403 return OptionSet(options);
406 void MarkBuildTabModified()
408 BuildTab buildTab = (BuildTab)master;
409 while(buildTab && buildTab._class != class(BuildTab))
410 buildTab = (BuildTab)buildTab.master;
411 if(buildTab) buildTab.modifiedDocument = true;
416 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
417 MarkBuildTabModified();
421 ProjectConfig c = null;
422 if(currentNode.configurations)
424 for(i : currentNode.configurations; !strcmpi(i.name, config.name)) { c = i; break; }
429 PlatformOptions p = null;
432 for(i : c.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
435 if(p.options && OptionSet(p.options))
436 UnsetOption(p.options);
437 if(p.options && p.options.isEmpty)
441 Iterator<PlatformOptions> it { c.platforms };
449 if(!c.platforms.count)
455 if(c.options && OptionSet(c.options))
456 UnsetOption(c.options);
457 if(c.options && c.options.isEmpty)
460 // DON'T DELETE PROJECT CONFIGS HERE!
461 if(!c.options && currentNode != project.topNode)
463 Iterator<ProjectConfig> it { currentNode.configurations };
471 if(!currentNode.configurations.count)
472 currentNode.configurations = null;
479 PlatformOptions p = null;
480 if(currentNode.platforms)
482 for(i : currentNode.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
485 if(p.options && OptionSet(p.options))
486 UnsetOption(p.options);
487 if(p.options && p.options.isEmpty)
491 Iterator<PlatformOptions> it { currentNode.platforms };
499 if(!currentNode.platforms.count)
500 currentNode.platforms = null;
506 if(currentNode.options && OptionSet(currentNode.options))
507 UnsetOption(currentNode.options);
508 if(currentNode.options && currentNode.options.isEmpty)
510 // delete currentNode.options;
511 // Property will free:
512 currentNode.options = null;
518 void FigureOutInherited()
521 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
522 bool skipped = false;
523 for(node = currentNode; node; node = node.parent)
525 bool configXplatformSet = false;
526 if(config && node.configurations)
528 for(c : node.configurations; !strcmpi(c.name, config.name))
530 if(platform && c.platforms)
532 for(p : c.platforms; !strcmpi(p.name, platformName))
534 if(p.options && OptionSet(p.options))
537 LoadOption(p.options);
539 configXplatformSet = true;
545 if(skipped && c.options && OptionSet(c.options))
547 LoadOption(c.options);
548 if(configReplaces) return;
554 if((!configXplatformSet || !configReplaces) && platform && node.platforms)
556 for(p : node.platforms; !strcmpi(p.name, platformName))
558 if(skipped && p.options && OptionSet(p.options))
559 LoadOption(p.options);
564 if(skipped && node.options && OptionSet(node.options))
565 LoadOption(node.options);
566 else if(skipped && !node.parent)
574 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
575 MarkBuildTabModified();
578 ProjectConfig c = null;
579 if(!currentNode.configurations) currentNode.configurations = { };
580 for(i : currentNode.configurations; !strcmpi(i.name, config.name)) { c = i; break; }
582 currentNode.configurations.Add(c = ProjectConfig { name = CopyString(config.name) });
585 PlatformOptions p = null;
586 if(!c.platforms) c.platforms = { };
588 for(i : c.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
590 c.platforms.Add(p = PlatformOptions { CopyString(platformName) });
592 if(!p.options) p.options = { };
593 RetrieveOption(p.options, true);
594 if(!mergeValues) SetAttribs(1);
597 if(!c.options) c.options = { };
598 RetrieveOption(c.options, true);
599 if(!mergeValues) SetAttribs(1);
604 PlatformOptions p = null;
605 if(!currentNode.platforms) currentNode.platforms = { };
606 for(i : currentNode.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
608 currentNode.platforms.Add(p = PlatformOptions { CopyString(platformName) });
610 if(!p.options) p.options = { };
611 RetrieveOption(p.options, true);
612 if(!mergeValues) SetAttribs(1);
616 if(!currentNode.options) currentNode.options = { };
617 RetrieveOption(currentNode.options, false);
618 if(!mergeValues) SetAttribs((currentNode.parent || OptionCheck(currentNode.options)) ? 1 : 0);
624 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
625 bool setAttribs = false;
626 for(node = currentNode; node; node = node.parent)
628 bool configXplatformSet = false;
629 ProjectConfig nodeConfig = null;
630 if(config && node.configurations)
632 for(c : node.configurations; !strcmpi(c.name, config.name))
634 if(platform && c.platforms)
636 for(p : c.platforms; !strcmpi(p.name, platformName))
638 if(p.options && (mergeValues ? OptionCheck(p.options) : OptionSet(p.options)))
640 LoadOption(p.options);
641 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode) ? 1 : 2); }
642 if(!mergeValues) { FinalizeLoading(); return; }
643 configXplatformSet = true;
653 if(platform && node.platforms && (!configXplatformSet || !configReplaces))
655 for(p : node.platforms; !strcmpi(p.name, platformName))
657 if(p.options && (mergeValues ? OptionCheck(p.options) : OptionSet(p.options)))
659 LoadOption(p.options);
660 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !config) ? 1 : 2); }
661 if(!mergeValues) { FinalizeLoading(); return; }
667 if(nodeConfig && nodeConfig.options && ((mergeValues && !configReplaces) ? OptionCheck(nodeConfig.options) : OptionSet(nodeConfig.options)))
669 LoadOption(nodeConfig.options);
670 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !platform) ? 1 : 2); }
671 if(!mergeValues || configReplaces) { FinalizeLoading(); return; }
674 if(node.options && (mergeValues ? OptionCheck(node.options) : OptionSet(node.options)))
676 LoadOption(node.options);
677 if(!node.parent && !OptionCheck(node.options))
679 if(!setAttribs) { setAttribs = true; SetAttribs(0); }
683 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !config && !platform) ? 1 : 2); }
685 if(!mergeValues) { FinalizeLoading(); return; }
687 else if(!node.parent)
690 if(!setAttribs) { setAttribs = true; SetAttribs(0); }
691 if(!mergeValues) { FinalizeLoading(); return; }
698 class StringOptionBox : OptionBox<String>
702 bool NotifyModified(EditBox editBox)
704 ((OptionBox)editBox.id).Retrieve();
708 textHorzScroll = true;
711 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
713 String * string = (String*)((byte *)options + option);
714 if(*string) delete *string;
715 *string = CopyString(((EditBox)editor).contents);
718 void LoadOption(ProjectOptions options)
720 ((EditBox)editor).contents = options ? *(String*)((byte *)options + option) : "";
721 ((EditBox)editor).Deselect();
724 bool OptionCheck(ProjectOptions options)
726 String string = *(String*)((byte *)options + option);
727 return string && string[0];
730 void UnsetOption(ProjectOptions options)
732 delete *(String*)((byte *)options + option);
736 class PathOptionBox : OptionBox<String>
738 bool Window::EditBoxORB(int x, int y, Modifiers mods)
740 Window parent = this.parent;
741 x += clientStart.x + position.x;
742 y += clientStart.y + position.y;
743 return ((OptionBox)this).OptionBox_OnRightButtonDown(parent, x, y, mods);
748 typeExpected = directory, browseDialog = { };
749 editBox.OnRightButtonDown = (void *)EditBoxORB;
751 bool NotifyModified(PathBox pathBox)
753 ((OptionBox)pathBox.id).Retrieve();
758 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
760 String * string = (String*)((byte *)options + option);
761 String slashPath = ((PathBox)editor).slashPath;
762 if(*string) delete *string;
763 *string = CopyString(slashPath);//(slashPath && slashPath[0]) ? CopyString(slashPath) : null;
766 void LoadOption(ProjectOptions options)
768 ((PathBox)editor).path = options ? *(String*)((byte *)options + option) : "";
769 ((PathBox)editor).Deselect();
772 bool OptionCheck(ProjectOptions options)
774 String string = *(String*)((byte *)options + option);
775 return string && string[0];
778 void UnsetOption(ProjectOptions options)
780 delete *(String*)((byte *)options + option);
784 class MultiStringOptionBox : OptionBox<Array<String>>
789 caseSensitive = true;
791 virtual Array<String> GetStrings();
792 virtual void SetStrings(Array<String> value);
794 Array<String> tempStrings;
796 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
798 Array<String> newStrings = GetStrings();
799 Array<String> * strings = (Array<String>*)((byte *)options + option);
800 if(*strings) { strings->Free(); delete *strings; }
804 Iterator<String> it { newStrings };
806 FigureOutInherited();
810 Array<String> ts = tempStrings;
815 for(i : tempStrings; !(caseSensitive ? strcmp : strcmpi)(i, s)) { found = true; break; }
816 if(found && (!configReplaces || platform)) // ADDED || platform here...
826 if(!mergeValues || (configReplaces && isCfgOrPlt && !platform))
827 *strings = newStrings;
830 *strings = (newStrings && newStrings.count) ? newStrings : null;
831 if(newStrings && !newStrings.count) delete newStrings;
837 void LoadOption(ProjectOptions options)
841 Array<String> strings = options ? *((Array<String>*)((byte *)options + option) : null;
849 for(i : tempStrings; !(caseSensitive ? strcmp : strcmpi)(i, s)) { found = true; break; }
850 if(!found) tempStrings.Add(s);
856 SetStrings(options ? *(Array<String>*)((byte *)options + option) : null);
860 void FinalizeLoading()
864 SetStrings(tempStrings);
869 bool OptionSet(ProjectOptions options)
871 Array<String> strings = *(Array<String>*)((byte *)options + option);
872 if(mergeValues && !configReplaces)
874 return strings && strings.count;
877 return strings != null;
880 bool OptionCheck(ProjectOptions options)
882 Array<String> strings = *(Array<String>*)((byte *)options + option);
883 return strings && strings.count;
886 void UnsetOption(ProjectOptions options)
888 Array<String> * strings = (Array<String>*)((byte *)options + option);
889 if(*strings) { strings->Free(); delete *strings; }
893 class StringArrayOptionBox : MultiStringOptionBox
895 editor = StringListBox
897 bool NotifyModified(EditBox editBox)
899 ((OptionBox)editBox.id).Retrieve();
904 // NO VIRTUAL PROPERTIES YET...
905 Array<String> GetStrings() { return ((StringListBox)editor).strings; }
906 void SetStrings(Array<String> value) { ((StringListBox)editor).strings = value; }
909 class StringsArrayOptionBox : MultiStringOptionBox
919 bool NotifyModified(StringsBox stringsBox)
921 ((OptionBox)stringsBox.id).Retrieve();
926 Array<String> GetStrings() { return ((StringsBox)editor).strings; }
927 void SetStrings(Array<String> value) { ((StringsBox)editor).strings = value; }
930 class DirsArrayOptionBox : MultiStringOptionBox
932 editor = DirectoriesBox
934 bool NotifyModified(DirectoriesBox dirsBox)
936 ((OptionBox)dirsBox.id).Retrieve();
940 bool OnChangedDir(char * * directory)
942 char fixedDirectory[MAX_LOCATION] = "";
943 if(PathCat(fixedDirectory, *directory))
945 char cwdBackup[MAX_LOCATION];
948 GetWorkingDir(cwdBackup, sizeof(cwdBackup));
949 ChangeWorkingDir(project.topNode.path);
951 FileFixCase(fixedDirectory);
953 ChangeWorkingDir(cwdBackup);
955 *directory = CopyString(fixedDirectory);
961 bool OnPrepareBrowseDir(char * * directory)
963 char dir[MAX_LOCATION];
966 GetSystemPathBuffer(dir, project.topNode.path);
968 PathCat(dir, *directory);
971 strcpy(dir, *directory);
976 *directory = CopyString(dir);
978 // GCC 4.4 bug: ----- path becomes *directory
979 //strcpy(dir, path ? path : "");
983 bool OnBrowsedDir(char * * directory)
987 char path[MAX_LOCATION];
988 MakePathRelative(*directory, project.topNode.path, path);
990 *directory = CopyString(path);
996 Array<String> GetStrings() { return ((DirectoriesBox)editor).strings; }
997 void SetStrings(Array<String> value) { ((DirectoriesBox)editor).strings = value; }
1000 class BoolOptionBox : OptionBox<SetBool>
1006 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
1008 ((OptionBox)button.id).Retrieve();
1013 bool OptionCheck(ProjectOptions options)
1015 return *(SetBool*)((byte *)options + option) == true;
1018 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
1020 bool checked = ((Button)editor).checked;
1021 *(SetBool*)((byte *)options + option) = checked ? true :
1022 ((currentNode.parent || isCfgOrPlt) ? false : unset);
1025 void LoadOption(ProjectOptions options)
1027 ((Button)editor).checked = options && (*(SetBool*)((byte *)options + option) == true);
1031 class DropOptionBox : OptionBox
1035 bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
1037 ((OptionBox)dropBox.id).Retrieve();
1042 void LoadOption(ProjectOptions options)
1044 DropBox dropBox = (DropBox)editor;
1045 Z value = options ? *(Z*)((byte *)options + option) : (Z)0;
1046 dropBox.currentRow = value ? dropBox.FindRow((int)value) : dropBox.firstRow;
1049 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
1051 DropBox dropBox = (DropBox)editor;
1052 DataRow row = dropBox.currentRow;
1053 Z value = (Z)(row ? row.tag : 0);
1054 *(Z*)((byte *)options + option) = value;
1058 class TargetTypeDB : DropOptionBox<TargetTypes>
1064 row = ((DropBox)editor).AddRow();
1065 row.tag = TargetTypes::executable;
1066 row.SetData(null, $"Executable");
1068 row = ((DropBox)editor).AddRow();
1069 row.tag = TargetTypes::sharedLibrary;
1070 row.SetData(null, $"Shared Library");
1072 row = ((DropBox)editor).AddRow();
1073 row.tag = TargetTypes::staticLibrary;
1074 row.SetData(null, $"Static Library");
1077 bool OptionCheck(ProjectOptions options)
1079 TargetTypes value = *(TargetTypes*)((byte *)options + option);
1080 return value && value != executable;
1084 class OptimizationDB : DropOptionBox<OptimizationStrategy>
1089 row = ((DropBox)editor).AddRow();
1090 row.tag = OptimizationStrategy::none;
1091 row.SetData(null, $"None");
1093 row = ((DropBox)editor).AddRow();
1094 row.tag = OptimizationStrategy::speed;
1095 row.SetData(null, $"For Speed (-O2)");
1097 row = ((DropBox)editor).AddRow();
1098 row.tag = OptimizationStrategy::size;
1099 row.SetData(null, $"For Size (-Os)");
1102 bool OptionCheck(ProjectOptions options)
1104 OptimizationStrategy value = *(OptimizationStrategy*)((byte *)options + option);
1105 return value && value != none;
1109 class WarningsDB : DropOptionBox<WarningsOption>
1114 row = ((DropBox)editor).AddRow();
1115 row.tag = WarningsOption::normal;
1116 row.SetData(null, $"Normal");
1118 row = ((DropBox)editor).AddRow();
1119 row.tag = WarningsOption::none;
1120 row.SetData(null, $"None");
1122 row = ((DropBox)editor).AddRow();
1123 row.tag = WarningsOption::all;
1124 row.SetData(null, $"All");
1127 bool OptionCheck(ProjectOptions options)
1129 WarningsOption value = *(WarningsOption*)((byte *)options + option);
1130 return value && value != none;
1134 void DrawStipple(Surface surface, Size clientSize)
1138 int x2 = clientSize.w - 1;
1139 int y2 = clientSize.h - 1;
1140 if((x2 - x1) & 1) x2--;
1141 if((y2 - y1) & 1) y2--;
1143 surface.LineStipple(0x5555);
1144 surface.Rectangle(x1, y1, x2, y2);
1145 surface.LineStipple(0);
1148 class BuildTab : Tab
1151 background = formColor;
1154 ProjectNode backupNode;
1155 String activeConfigName;
1157 ProjectNode lastSelectedNode;
1159 property char * selectedConfigName
1165 SelectorButton button = (SelectorButton)configSelector.selectedButton;
1166 if(button && button.id)
1168 ProjectConfig config = (ProjectConfig)button.id;
1176 property char * selectedPlatformName
1182 SelectorButton button = (SelectorButton)platformSelector.selectedButton;
1183 if(button && button.id)
1185 Platform platform = (Platform)button.id;
1186 char * platformName = platform ? platform.OnGetString(0,0,0) : null; // all these platformName are leaking, no?
1187 return platformName;
1194 Label labelConfigurations
1196 this, anchor = { left = 8, top = 14 }, labeledWindow = configSelector;
1198 void OnRedraw(Surface surface)
1200 Label::OnRedraw(surface);
1201 if(labeledWindow.active) DrawStipple(surface, clientSize);
1204 SelectorBar configSelector
1206 this, text = $"Configurations: ", anchor = { left = 98, top = 8, right = 54 }; size = { 0, 26 };
1208 direction = horizontal, scrollable = true;
1210 bool OnKeyDown(Key key, unichar ch)
1214 ((BuildTab)parent).createConfig.NotifyClicked(parent, ((BuildTab)parent).createConfig, 0, 0, 0);
1219 ((BuildTab)parent).deleteConfig.NotifyClicked(parent, ((BuildTab)parent).deleteConfig, 0, 0, 0);
1222 return SelectorBar::OnKeyDown(key, ch);
1225 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
1227 ((BuildTab)master).labelConfigurations.Update(null);
1234 parent = this, bevelOver = true, inactive = true;
1236 anchor = { top = 10, right = 31 };
1237 hotKey = altC, bitmap = BitmapResource { fileName = ":actions/docNew.png", alphaBlend = true };
1239 bool NotifyClicked(Button b, int x, int y, Modifiers mods)
1241 char tmp[MAX_F_STRING];
1242 ProjectConfig config;
1243 EditableSelectorButton button;
1245 FindUniqueConfigName("NewConfig", false, tmp);
1249 makingModified = true;
1250 compilingModified = true;
1251 linkingModified = true;
1252 name = CopyString(tmp);
1255 // objectsDirectory = /*CopyString(*/defaultObjDirExpression/*)*/;
1258 if(!project.topNode.configurations) project.topNode.configurations = { };
1259 project.topNode.configurations.Add(config);
1261 targetType = project.config.options.targetType;
1263 config.options.targetFileName = project.moduleName;
1264 config.options.targetDir.dir = "";
1265 config.options.objectsDirectory = defaultObjDirExpression);
1266 config.options.debug = true;
1267 config.options.optimization = none;
1268 config.options.warnings = all;
1273 configSelector, renameable = true, master = this, text = config.name, id = (int)config;
1274 NotifyClicked = ConfigClicked, OnRename = ConfigOnRename;
1277 configSelector.Select(button);
1278 modifiedDocument = true;
1282 /*Button duplicateConfig
1284 parent = this, bevelOver = true, inactive = true;
1286 anchor = { top = 10, right = 31 };
1287 hotKey = altU, bitmap = BitmapResource { fileName = ":actions/editCopy.png", alphaBlend = true };
1291 parent = this, bevelOver = true, inactive = true;
1293 anchor = { top = 10, right = 8 };
1294 hotKey = altD, bitmap = BitmapResource { fileName = ":actions/delete2.png", alphaBlend = true };
1296 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
1300 String title = PrintString($"Delete ", config.name, $" Configuration");
1301 String msg = PrintString($"Are you sure you wish to delete the ", config.name, $" configuration?");
1302 if(MessageBox { type = okCancel, text = title, contents = msg }.Modal() == ok)
1304 Iterator<Window> it { configSelector.controls };
1305 ProjectConfig configToDelete = config;
1309 SelectorButton button = (SelectorButton)it.data;
1310 if((ProjectConfig)button.id == config)
1312 button.visible = false;
1317 button = (SelectorButton)it.data;
1318 config = (ProjectConfig)button.id;
1319 configSelector.Select(button);
1325 SelectorButton button = configSelector.FindButtonByID((int)configToDelete);
1327 configSelector.RemoveButton(button);
1329 project.topNode.DeleteConfig(configToDelete);
1331 modifiedDocument = true;
1340 Label labelPlatforms
1342 this, anchor = { left = 8, top = 44 }, labeledWindow = platformSelector;
1344 void OnRedraw(Surface surface)
1346 Label::OnRedraw(surface);
1347 if(labeledWindow.active) DrawStipple(surface, clientSize);
1350 SelectorBar platformSelector
1352 this, text = $"Platforms: ", anchor = { left = 64, top = 38, right = 54 }; size = { 0, 26 };
1354 direction = horizontal, scrollable = true;
1356 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
1358 ((BuildTab)master).labelPlatforms.Update(null);
1363 TabControl buildTabControl
1365 this, background = formColor, anchor = { left = 8, top = 64, right = 8, bottom = 8 };
1366 curTab = compilerTab;
1368 CompilerTab compilerTab { this, tabControl = buildTabControl };
1369 LinkerTab linkerTab { this, tabControl = buildTabControl };
1370 BuilderTab builderTab { this, tabControl = buildTabControl };
1373 this, font = { font.faceName, font.size, italic = true }, stayOnTop = true,
1374 text = $"(Right click or press Ctrl-Del to revert an option to inherited value)", anchor = { top = 72, right = 16 }
1377 void FindUniqueConfigName(char * baseName, bool startWithNumber, char * output)
1380 char tmp[MAX_F_STRING];
1382 sprintf(tmp, "%s%d", baseName, num);
1384 strcpy(tmp, baseName);
1387 ProjectConfig config = null;
1388 for(c : project.topNode.configurations)
1389 { // TOFIX: Error when omitting these brackets, c not found
1390 if(c.name && !strcmp(c.name, tmp))
1399 sprintf(tmp, "%s%d", baseName, num);
1404 strcpy(output, tmp);
1407 bool PlatformClicked(Button clickedButton, int x, int y, Modifiers mods)
1409 if(!eClass_IsDerived(clickedButton._class, class(EditableSelectorButton)) || !((EditableSelectorButton)clickedButton).editBox)
1411 platform = (Platform)clickedButton.id;
1413 // Load Settings Into Dialog
1414 compilerTab.LoadSettings();
1415 linkerTab.LoadSettings();
1416 builderTab.LoadSettings();
1419 buildTabControl.Activate();
1421 if(compilerTab.rightPaneHeader.visible)
1422 compilerTab.rightPaneHeader.Update(null);
1423 ((ProjectSettings)master).UpdateDialogTitle();
1430 platformSelector.DestroyChildren();
1431 configSelector.DestroyChildren();
1433 delete activeConfigName;
1436 bool ConfigOnRename(EditableSelectorButton button, char * * oldName, char * * newName)
1441 for(c = 0; (ch = (*newName)[c]); c++)
1443 if(ch == '_' || isalpha(ch) || (isdigit(ch) && d))
1444 (*newName)[d++] = ch;
1450 for(c : project.topNode.configurations; c != config)
1452 if(!strcmpi(c.name, *newName))
1458 if(found || !(*newName)[0])
1460 char tmp[MAX_F_STRING];
1461 char * tmpName = config.name;
1463 FindUniqueConfigName("NewConfig", false, tmp);
1464 config.name = tmpName;
1466 *newName = CopyString(tmp);
1470 if(activeConfigName && !strcmp(activeConfigName, *oldName))
1472 delete activeConfigName;
1473 activeConfigName = CopyString(*newName);
1476 project.topNode.RenameConfig(config.name, *newName);
1478 modifiedDocument = true;
1482 bool ConfigClicked(Button clickedButton, int x, int y, Modifiers mods)
1484 if(!eClass_IsDerived(clickedButton._class, class(EditableSelectorButton)) || !((EditableSelectorButton)clickedButton).editBox)
1486 config = (ProjectConfig)clickedButton.id;
1488 // Load Settings Into Dialog
1489 compilerTab.LoadSettings();
1490 linkerTab.LoadSettings();
1491 builderTab.LoadSettings();
1493 deleteConfig.disabled = (clickedButton._class == class(SelectorButton));
1496 buildTabControl.Activate();
1498 if(compilerTab.rightPaneHeader.visible)
1499 compilerTab.rightPaneHeader.Update(null);
1500 ((ProjectSettings)master).UpdateDialogTitle();
1505 void SelectNode(ProjectNode node, bool ignoreAsLastSelection)
1507 if(node != currentNode)
1509 Window ac = compilerTab.rightPane.activeChild;
1510 bool prevNodeRes = currentNode ? currentNode.isInResources : false;
1513 if(!node) node = project.topNode;
1515 newNodeRes = node.isInResources;
1518 if(!ignoreAsLastSelection)
1519 lastSelectedNode = node;
1521 ((ProjectSettings)master).UpdateDialogTitle();
1522 if(node.type == project)
1524 compilerTab.rightPaneHeader.visible = false;
1528 compilerTab.rightPaneHeader.id = (int)node;
1529 compilerTab.rightPaneHeader.Update(null);
1530 compilerTab.rightPaneHeader.visible = true;
1534 DataRow row = compilerTab.fileList.FindSubRow((int)currentNode);
1537 compilerTab.fileList.currentRow = row;
1538 while((row = row.parent))
1539 row.collapsed = false;
1543 if(prevNodeRes != newNodeRes)
1545 compilerTab.labelObjDir.visible = !newNodeRes;
1546 compilerTab.objDir.visible = !newNodeRes;
1547 compilerTab.excludeFromBuild.visible = !newNodeRes;
1548 compilerTab.labelPreprocessorDefs.visible = !newNodeRes;
1549 compilerTab.preprocessorDefs.visible = !newNodeRes;
1550 compilerTab.labelDefaultNameSpace.visible = !newNodeRes;
1551 compilerTab.defaultNameSpace.visible = !newNodeRes;
1552 compilerTab.strictNameSpaces.visible = !newNodeRes;
1553 compilerTab.memoryGuard.visible = !newNodeRes;
1554 compilerTab.noLineNumbers.visible = !newNodeRes;
1555 compilerTab.debug.visible = !newNodeRes;
1556 compilerTab.labelWarnings.visible = !newNodeRes;
1557 compilerTab.warnings.visible = !newNodeRes;
1558 compilerTab.profiling.visible = !newNodeRes;
1559 compilerTab.labelOptimization.visible = !newNodeRes;
1560 compilerTab.optimization.visible = !newNodeRes;
1561 compilerTab.labelIncludeDirs.visible = !newNodeRes;
1562 compilerTab.includeDirs.visible = !newNodeRes;
1565 if(node == project.topNode)
1567 compilerTab.objDir.visible = true;
1568 compilerTab.labelObjDir.visible = true;
1570 compilerTab.excludeFromBuild.visible = false;
1574 compilerTab.objDir.visible = false;
1575 compilerTab.labelObjDir.visible = false;
1577 compilerTab.excludeFromBuild.visible = (node != project.resNode);
1580 // Load Settings Into Dialog
1581 compilerTab.LoadSettings();
1582 linkerTab.LoadSettings();
1583 builderTab.LoadSettings();
1589 if(ac == compilerTab.excludeFromBuild.editor)
1590 ac = compilerTab.objDir.editor;
1591 else if(compilerTab.excludeFromBuild.editor.visible)
1592 ac = compilerTab.excludeFromBuild.editor;
1599 void CreateConfigButtons()
1601 SelectorButton commonButton;
1603 // Create Config Buttons
1604 commonButton = SelectorButton
1606 configSelector, master = this, text = $"Common", id = (int)null; font = { font.faceName, font.size, true };
1608 NotifyClicked = ConfigClicked;
1613 if(project.topNode.configurations)
1615 for(c : project.topNode.configurations)
1617 EditableSelectorButton button
1619 configSelector, master = this, renameable = true, text = c.name, id = (int)c;
1620 NotifyClicked = ConfigClicked, OnRename = ConfigOnRename;
1629 SelectorButton button;
1631 activeConfigName = project.config ? CopyString(project.config.name) : null;
1633 compilerTab.AddNode(project.topNode, null);
1635 CreateConfigButtons();
1637 platformButton = button =
1639 platformSelector, master = this, text = $"Common", id = 0; font = { font.faceName, font.size, true };
1640 NotifyClicked = PlatformClicked; checked = true;
1645 for(p = (Platform)1; p < Platform::enumSize; p++)
1647 SelectorButton button
1649 platformSelector, master = this, text = p.OnGetString(0,0,0), id = (int)p;
1650 NotifyClicked = PlatformClicked;
1654 SelectorButton platformButton;
1658 // Backup Current Settings
1659 backupNode = project.topNode.Backup();
1661 buildTabControl.Activate();
1664 Iterator<Window> it { configSelector.controls };
1667 SelectorButton configButton = (SelectorButton)it.data;
1668 ProjectConfig buttonConfig = (ProjectConfig)configButton.id;
1669 if(buttonConfig == project.config)
1671 configButton.Activate();
1672 configButton.checked = true;
1673 ConfigClicked(configButton, 0, 0, (Modifiers)null);
1680 platformButton.MakeActive();
1681 platformButton = null;
1690 lastSelectedNode = null;
1692 project.config = null;
1694 /* // THIS IS NOW AUTOMATED WITH A project CHECK IN ProjectNode
1695 project.configurations = project.topNode.configurations;
1696 project.platforms = project.topNode.platforms;
1697 project.options = project.topNode.options;
1700 if(project.topNode.configurations)
1702 for(c : project.topNode.configurations)
1704 if(!strcmpi(c.name, activeConfigName))
1713 void RevertChanges()
1715 String configName = config ? CopyString(config.name) : null;
1717 // Revert to saved project options
1718 project.topNode.Revert(backupNode);
1720 configSelector.DestroyChildren();
1721 CreateConfigButtons();
1723 // Reselect Configuration
1726 Iterator<Window> it { configSelector.controls };
1729 Button button = (Button)it.data;
1730 ProjectConfig c = (ProjectConfig)button.id;
1731 if(c && !strcmp(c.name, configName))
1735 button.checked = true;
1736 ConfigClicked(button, 0,0, 0);
1742 SelectNode(project.topNode, false);
1747 bool OnClose(bool parentClosing)
1749 if(modifiedDocument)
1751 DialogResult diagRes = MessageBox
1753 type = yesNoCancel, master = ide,
1754 text = $"Save changes to project settings?",
1755 contents = $"Would you like to save changes made to the build options?"
1759 if(diagRes == cancel)
1763 project.MarkChanges(backupNode);
1764 project.topNode.modified = true;
1765 ide.projectView.modifiedDocument = true;
1766 ide.projectView.Update(null);
1768 modifiedDocument = false;
1774 class CompilerTab : Tab
1776 background = formColor;
1779 Window leftPane { this, size = { 180 }, anchor = { left = 0, top = 0, bottom = 0 }, background = formColor };
1781 Label labelFileList { leftPane, this, position = { 8, 8 }, labeledWindow = fileList };
1784 leftPane, this, borderStyle = deep, hasVertScroll = true, hasHorzScroll = true;
1785 // THIS WOULD BE EVEN MORE FUN: multiSelect = true,
1786 fullRowSelect = false, collapseControl = true, treeBranches = true;
1787 alwaysHighLight = true;
1788 selectionColor = unfocusedSelectorColor;
1790 anchor = Anchor { left = 8, top = 24, right = 4, bottom = 8 };
1793 bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
1795 BuildTab buildTab = (BuildTab)master;
1796 ProjectNode node = (ProjectNode)row.tag;
1797 buildTab.SelectNode(node, false);
1801 void OnRedraw(Surface surface)
1803 ide.projectView.drawingInProjectSettingsDialog = true;
1804 ListBox::OnRedraw(surface);
1805 ide.projectView.drawingInProjectSettingsDialog = false;
1808 bool NotifyActivate(Window window, bool active, Window previous)
1812 //subclass(Skin) skinClass = (subclass(Skin))eSystem_FindClass(app, app.skin);
1813 fileList.selectionColor = Color { 10, 36, 106 }; //skinClass.selectionColor; // darkBlue;
1815 else if(fileList.currentRow)
1817 DataRow currentRow = fileList.currentRow;
1818 //int headerSize = ((fileList.style.header) ? fileList.rowHeight : 0);
1819 int height = fileList.clientSize.h + 1;// - fileList.headerSize;
1820 fileList.selectionColor = unfocusedSelectorColor;
1821 if(currentRow && currentRow.index * fileList.rowHeight > fileList.scroll.y + height - fileList.rowHeight)
1822 fileList.SetScrollPosition(fileList.scroll.x, currentRow.index * fileList.rowHeight - height + fileList.rowHeight);
1823 else if(!currentRow || currentRow.index * fileList.rowHeight < fileList.scroll.y)
1824 fileList.SetScrollPosition(fileList.scroll.x, currentRow ? currentRow.index * fileList.rowHeight : 0);
1834 this, anchor = { left = 196, top = 0, right = 0, bottom = 0 }, background = formColor, tabCycle = true;
1837 Window rightPaneHeader
1839 rightPane, this, size = { h = 21 }, anchor = { left = 0, top = 0, right = 0 }, background = Color { 70, 96, 166 };//0x0F3F66;
1840 foreground = white; visible = false;
1842 void OnRedraw(Surface surface)
1846 ide.projectView.drawingInProjectSettingsDialogHeader = true;
1847 class(ProjectNode)._vTbl[__ecereVMethodID_class_OnDisplay](class(ProjectNode),
1848 id, surface, 8, 2, clientSize.w, ide.projectView, Alignment::left, DataDisplayFlags { selected = true });
1849 ide.projectView.drawingInProjectSettingsDialogHeader = false;
1854 PaneSplitter splitter
1856 this, leftPane = leftPane, rightPane = rightPane, split = 188
1859 Label labelObjDir { rightPane, this, position = { 8, 8 }, labeledWindow = objDir };
1860 PathOptionBox objDir
1862 rightPane, this, size = { 250, 22 }, anchor = { left = 8, top = 24, right = 8 };
1863 text = $"Intermediate Objects Directory", hotKey = altJ, option = OPTION(objectsDirectory);
1866 BoolOptionBox excludeFromBuild
1868 rightPane, this, position = { 8, 28 },
1869 text = $"Exclude from Build", visible = false, option = OPTION(excludeFromBuild);
1872 Label labelPreprocessorDefs { rightPane, this, position = { 8, 50 }, labeledWindow = preprocessorDefs };
1873 StringArrayOptionBox preprocessorDefs
1875 rightPane, this, size = { 290, 22 }, anchor = { left = 8, top = 66, right = 8 };
1876 text = $"Preprocessor Definitions", hotKey = altD, option = OPTION(preprocessorDefinitions);
1879 Label labelDefaultNameSpace { rightPane, this, position = { 8, 92 }, labeledWindow = defaultNameSpace };
1880 StringOptionBox defaultNameSpace
1882 rightPane, this, size = { 160, 22 }, position = { 8, 108 };
1883 text = $"Default Name Space", option = OPTION(defaultNameSpace);
1885 BoolOptionBox strictNameSpaces
1887 rightPane, this, position = { 172, 112 },
1888 text = $"Strict Name Spaces", option = OPTION(strictNameSpaces);
1891 BoolOptionBox memoryGuard
1893 rightPane, this, position = { 8, 154 };
1894 text = $"MemoryGuard", hotKey = altM, option = OPTION(memoryGuard);
1897 Label labelWarnings { rightPane, position = { 116, 138 }, labeledWindow = warnings };
1900 rightPane, this, position = { 116, 154 };
1901 text = $"Warnings", hotKey = altW, option = OPTION(warnings);
1904 Label labelOptimization { rightPane, position = { 244, 138 }, labeledWindow = optimization };
1905 OptimizationDB optimization
1907 rightPane, this, position = { 244, 154 }, size = { 120, 22 };
1908 text = $"Optimization", hotKey = altO, option = OPTION(optimization);
1913 rightPane, this, position = { 8, 188 };
1914 text = $"Debuggable", hotKey = altG, option = OPTION(debug);
1917 BoolOptionBox profiling
1919 rightPane, this, position = { 116, 188 };
1920 text = $"Profiling Data", hotKey = altP, option = OPTION(profile);
1923 BoolOptionBox noLineNumbers
1925 rightPane, this, position = { 244, 188 };
1926 text = $"No Line Numbers", hotKey = altN, option = OPTION(noLineNumbers);
1929 Label labelIncludeDirs { includeDirs.editor, labeledWindow = includeDirs, position = { 0, 6 }; };
1930 DirsArrayOptionBox includeDirs
1932 rightPane, this, size = { 290, 22 }, anchor = { left = 8, top = 208, right = 8, bottom = 8 };
1933 text = $"Additional Include Directories", hotKey = altI, option = OPTION(includeDirs);
1938 fileList.AddField(DataField { dataType = class(ProjectNode), freeData = false,
1939 userData = null /* Now set in the ProjectNode directly to know we're in ProjectSettings Dialog -- ide.projectView*/ });
1944 BuildTab buildTab = (BuildTab)master;
1945 buildTab.SelectNode(buildTab.lastSelectedNode, true);
1949 void AddNode(ProjectNode node, DataRow addTo)
1951 DataRow row = addTo ? addTo.AddRow() : fileList.AddRow();
1953 row.tag = (int)node;
1955 row.SetData(null, node);
1957 if(node.files && node.files.first && node.parent &&
1958 !(!node.parent.parent &&
1959 (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") ||
1960 !strcmpi(node.name, "src") || !strcmpi(node.name, "tools"))))
1961 row.collapsed = true;
1962 else if(node.type == folder)
1963 node.icon = openFolder;
1967 for(child : node.files)
1968 AddNode(child, row);
1975 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
1976 if(eClass_IsDerived(ob._class, class(OptionBox)))
1979 if(activeChild && activeChild.active)
1981 Window control = activeChild;
1982 control.Deactivate();
1989 objDir.editor.Activate();
1994 class LinkerTab : Tab
1996 background = formColor;
1999 Label labelTargetName { this, position = { 8, 8 }, labeledWindow = targetName };
2000 StringOptionBox targetName
2002 this, position = { 8, 24 }, size = { 200, 22 };
2003 text = $"Target Name", hotKey = altN, option = OPTION(targetFileName);
2006 Label labelTargetType { this, position = { 216, 8 }, labeledWindow = targetType };
2007 TargetTypeDB targetType
2009 this, position = { 216, 24 }, size = { 120, 22 };
2010 text = $"Target Type", hotKey = altT, option = OPTION(targetType);
2013 Label labelTargetDirectory { this, position = { 344, 8 }, labeledWindow = targetDirectory };
2014 PathOptionBox targetDirectory
2016 this, size = { 270, 22 }, anchor = { left = 344, top = 24, right = 8 };
2017 hotKey = altR, text = $"Target Directory", option = OPTION(targetDirectory);
2020 Label labelLibraries { this, position = { 8, 50 }, labeledWindow = libraries };
2021 StringArrayOptionBox libraries
2023 this, size = { 290, 22 }, anchor = { left = 8, top = 66, right = 8 };
2024 text = $"Additional Libraries", hotKey = altL, option = OPTION(libraries);
2025 configReplaces = true;
2028 Label labelLinkerOptions { this, position = { 8, 92 }, labeledWindow = linkerOptions };
2029 StringArrayOptionBox linkerOptions
2031 this, size = { 290, 22 }, anchor = { left = 8, top = 108, right = 8 };
2032 text = $"Linker Options", hotKey = altO, option = OPTION(linkerOptions);
2033 configReplaces = true;
2036 BoolOptionBox console
2038 this, position = { 8, 138 };
2039 text = $"Console Application", hotKey = altC, option = OPTION(console);
2042 BoolOptionBox compress
2044 this, position = { 8, 162 };
2045 text = $"Compress", hotKey = altW, option = OPTION(compress);
2048 Label labelLibraryDirs { libraryDirs.editor, labeledWindow = libraryDirs, position = { 0, 6 }; };
2049 DirsArrayOptionBox libraryDirs
2051 this, size = { 290, 22 }, anchor = { left = 8, top = 182, right = 8, bottom = 8 };
2052 text = $"Additional Library Directories", hotKey = altY, option = OPTION(libraryDirs);
2057 ((BuildTab)master).SelectNode(project.topNode, true);
2064 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
2065 if(eClass_IsDerived(ob._class, class(OptionBox)))
2067 compress.disabled = (config && config.options && config.options.debug == true) || project.topNode.options.debug == true;
2069 if(activeChild && activeChild.active)
2071 Window control = activeChild;
2072 control.Deactivate();
2078 class BuilderTab : Tab
2080 background = formColor;
2083 Label labelPrebuildCommands { prebuildCommands.editor, labeledWindow = prebuildCommands, position = { 0, 6 }; };
2084 StringsArrayOptionBox prebuildCommands
2086 this, size = { 290, 100 }, anchor = { left = 8, top = 8, right = 8, bottom = 0.5 };
2087 text = $"Pre-build Commands", hotKey = altE, option = OPTION(prebuildCommands);
2090 Label labelPostbuildCommands { postbuildCommands.editor, labeledWindow = postbuildCommands, position = { 0, 6 }; };
2091 StringsArrayOptionBox postbuildCommands
2093 this, size = { 290 }, anchor = { left = 8, top = 0.5, right = 8, bottom = 8 };
2094 text = $"Post-build Commands", hotKey = altT, option = OPTION(postbuildCommands);
2099 bool disabled = strlen(((BuildTab)master).selectedPlatformName) > 0;
2101 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
2102 if(eClass_IsDerived(ob._class, class(OptionBox)))
2105 if(activeChild && activeChild.active)
2107 Window control = activeChild;
2108 control.Deactivate();