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 // the BlendFileConfigPlatformProjectOptions function and the GenericOptionTools class
252 // contain code that is closely matched to the following code
253 // output changing modification should be mirrored in both implementations
254 class OptionBox<class Z> : CommonControl
256 bool mergeValues, configReplaces;
265 property Window editor
271 editor.OnRightButtonDown = OptionBox_OnRightButtonDown;
272 chainKeyDown = (void *)editor.OnKeyDown;
273 editor.OnKeyDown = OptionBox_OnKeyDown;
277 property bool visible { set { editor.visible = value; } get { return editor.visible; } }
278 property Window parent { set { editor.parent = value; Window::parent = value; master = value; editor.id = (int64)this; } }
279 property Point position { set { editor.position = value; } }
280 property Size size { set { editor.size = value; } }
281 property Anchor anchor { set { editor.anchor = value; } }
282 property Key hotKey { set { editor.hotKey = value; } }
283 property char * text { set { editor.text = value; Window::text = value; } }
293 bool NotifySelect(MenuItem selection, Modifiers mods)
295 OptionBox ob = (OptionBox)id;
296 if(eClass_IsDerived(ob._class, class(CheckBoxForEnumOptionBox)))
299 for(slave = ob.master.firstSlave; slave; slave = slave.nextSlave)
301 if(eClass_IsDerived(slave._class, class(CheckBoxForEnumOptionBox)) &&
302 ((OptionBox)slave).option == ob.option)
303 ((OptionBox)slave).Unset();
312 bool Window::OptionBox_OnRightButtonDown(int x, int y, Modifiers mods)
314 OptionBox ob = (OptionBox)id;
315 GuiApplication app = ((GuiApplication)__thisModule.application);
317 PopupMenu { null, this, menu = ob.clearMenu,
318 position = { absPosition.x + clientStart.x + x - app.desktop.position.x, absPosition.y + clientStart.y + y - app.desktop.position.y } }.Create();
322 bool Window::OptionBox_OnKeyDown(Key key, unichar ch)
324 OptionBox ob = (OptionBox)id;
325 if(key == Key { del, ctrl = true } || key == Key { keyPadDelete, ctrl = true })
330 return (((bool(*)(Window, Key, unichar)) ob.chainKeyDown)(this, key, ch);
333 // code: 0 = not set anywhere, 1 = overridden here, 2 = inherited
334 void SetAttribs(int code)
339 for(c = Window::parent.firstChild; c; c = c.next)
341 if(eClass_IsDerived(c._class, class(Label)))
344 if(label.labeledWindow == this)
352 for(c = editor.firstChild; c; c = c.next)
354 if(eClass_IsDerived(c._class, class(Label)))
361 // control.foreground = foreground;
363 if(code == 0 || code == 1)
365 editor.font = { editor.font.faceName, editor.font.size, bold = (code == 1) };
366 editor.background = white;
370 Color foreground = 0x0F3F66;
371 int r = foreground.r, g = foreground.g, b = foreground.b;
375 editor.font = { editor.font.faceName, editor.font.size };
377 r = (int)(alpha * r + src.r * (1 - alpha));
378 g = (int)(alpha * g + src.g * (1 - alpha));
379 b = (int)(alpha * b + src.b * (1 - alpha));
381 r = Max(0,Min(255,r));
382 g = Max(0,Min(255,g));
383 b = Max(0,Min(255,b));
385 editor.background = Color { (byte) r, (byte) g, (byte) b };
390 label.font = { editor.font.faceName, editor.font.size, bold = (code == 1) };
391 //label.foreground = foreground;
395 virtual void FinalizeLoading();
397 virtual void LoadOption(ProjectOptions options);
398 virtual void RetrieveOption(ProjectOptions options, bool isCfgOrPlt);
399 virtual void UnsetOption(ProjectOptions options)
402 *(Z*)((byte *)options + option) = value;
405 virtual bool OptionSet(ProjectOptions options)
407 // TOFIX: If you get a crash here, it might be because JSON.ec must be after ProjectConfig.ec in the project files
408 // JSON.ec must also be before ProjectSettings.ec in the project files
409 if(*(Z*)((byte *)options + option))
413 // BUG: OptionCheck = OptionSet; // Overrides derived classes OptionCheck ?
415 virtual bool OptionCheck(ProjectOptions options)
417 return OptionSet(options);
420 void MarkBuildTabModified()
422 BuildTab buildTab = (BuildTab)master;
423 while(buildTab && buildTab._class != class(BuildTab))
424 buildTab = (BuildTab)buildTab.master;
425 if(buildTab) buildTab.modifiedDocument = true;
430 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
431 MarkBuildTabModified();
435 ProjectConfig c = null;
436 if(currentNode.configurations)
438 for(i : currentNode.configurations; !strcmpi(i.name, config.name)) { c = i; break; }
443 PlatformOptions p = null;
446 for(i : c.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
449 if(p.options && OptionSet(p.options))
450 UnsetOption(p.options);
451 if(p.options && p.options.isEmpty)
455 Iterator<PlatformOptions> it { c.platforms };
463 if(!c.platforms.count)
469 if(c.options && OptionSet(c.options))
470 UnsetOption(c.options);
471 if(c.options && c.options.isEmpty)
474 // DON'T DELETE PROJECT CONFIGS HERE!
475 if(!c.options && currentNode != project.topNode)
477 Iterator<ProjectConfig> it { currentNode.configurations };
485 if(!currentNode.configurations.count)
486 currentNode.configurations = null;
493 PlatformOptions p = null;
494 if(currentNode.platforms)
496 for(i : currentNode.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
499 if(p.options && OptionSet(p.options))
500 UnsetOption(p.options);
501 if(p.options && p.options.isEmpty)
505 Iterator<PlatformOptions> it { currentNode.platforms };
513 if(!currentNode.platforms.count)
514 currentNode.platforms = null;
520 if(currentNode.options && OptionSet(currentNode.options))
521 UnsetOption(currentNode.options);
522 if(currentNode.options && currentNode.options.isEmpty)
524 // delete currentNode.options;
525 // Property will free:
526 currentNode.options = null;
532 void FigureOutInherited()
535 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
536 bool skipped = false;
537 for(node = currentNode; node; node = node.parent)
539 bool configXplatformSet = false;
540 if(config && node.configurations)
542 for(c : node.configurations; !strcmpi(c.name, config.name))
544 if(platform && c.platforms)
546 for(p : c.platforms; !strcmpi(p.name, platformName))
548 if(p.options && OptionSet(p.options))
551 LoadOption(p.options);
553 configXplatformSet = true;
559 if(skipped && c.options && OptionSet(c.options))
561 LoadOption(c.options);
562 if(configReplaces) return;
568 if((!configXplatformSet || !configReplaces) && platform && node.platforms)
570 for(p : node.platforms; !strcmpi(p.name, platformName))
572 if(skipped && p.options && OptionSet(p.options))
573 LoadOption(p.options);
578 if(skipped && node.options && OptionSet(node.options))
579 LoadOption(node.options);
580 else if(skipped && !node.parent)
588 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
589 MarkBuildTabModified();
592 ProjectConfig c = null;
593 if(!currentNode.configurations) currentNode.configurations = { };
594 for(i : currentNode.configurations; !strcmpi(i.name, config.name)) { c = i; break; }
596 currentNode.configurations.Add(c = ProjectConfig { name = CopyString(config.name) });
599 PlatformOptions p = null;
600 if(!c.platforms) c.platforms = { };
602 for(i : c.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
604 c.platforms.Add(p = PlatformOptions { CopyString(platformName) });
606 if(!p.options) p.options = { };
607 RetrieveOption(p.options, true);
608 if(!mergeValues) SetAttribs(1);
611 if(!c.options) c.options = { };
612 RetrieveOption(c.options, true);
613 if(!mergeValues) SetAttribs(1);
618 PlatformOptions p = null;
619 if(!currentNode.platforms) currentNode.platforms = { };
620 for(i : currentNode.platforms; !strcmpi(i.name, platformName)) { p = i; break; }
622 currentNode.platforms.Add(p = PlatformOptions { CopyString(platformName) });
624 if(!p.options) p.options = { };
625 RetrieveOption(p.options, true);
626 if(!mergeValues) SetAttribs(1);
630 if(!currentNode.options) currentNode.options = { };
631 RetrieveOption(currentNode.options, false);
632 if(!mergeValues) SetAttribs((currentNode.parent || OptionCheck(currentNode.options)) ? 1 : 0);
638 char * platformName = platform ? platform.OnGetString(0,0,0) : null;
639 bool setAttribs = false;
640 for(node = currentNode; node; node = node.parent)
642 bool configXplatformSet = false;
643 ProjectConfig nodeConfig = null;
644 if(config && node.configurations)
646 for(c : node.configurations; !strcmpi(c.name, config.name))
648 if(platform && c.platforms)
650 for(p : c.platforms; !strcmpi(p.name, platformName))
652 if(p.options && (mergeValues ? OptionCheck(p.options) : OptionSet(p.options)))
654 LoadOption(p.options);
655 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode) ? 1 : 2); }
656 if(!mergeValues) { FinalizeLoading(); return; }
657 configXplatformSet = true;
667 if(platform && node.platforms && (!configXplatformSet || !configReplaces))
669 for(p : node.platforms; !strcmpi(p.name, platformName))
671 if(p.options && (mergeValues ? OptionCheck(p.options) : OptionSet(p.options)))
673 LoadOption(p.options);
674 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !config) ? 1 : 2); }
675 if(!mergeValues) { FinalizeLoading(); return; }
681 if(nodeConfig && nodeConfig.options && ((mergeValues && !configReplaces) ? OptionCheck(nodeConfig.options) : OptionSet(nodeConfig.options)))
683 LoadOption(nodeConfig.options);
684 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !platform) ? 1 : 2); }
685 if(!mergeValues || configReplaces) { FinalizeLoading(); return; }
688 if(node.options && (mergeValues ? OptionCheck(node.options) : OptionSet(node.options)))
690 LoadOption(node.options);
691 if(!node.parent && !OptionCheck(node.options))
693 if(!setAttribs) { setAttribs = true; SetAttribs(0); }
697 if(!setAttribs) { setAttribs = true; SetAttribs((node == currentNode && !config && !platform) ? 1 : 2); }
699 if(!mergeValues) { FinalizeLoading(); return; }
701 else if(!node.parent)
704 if(!setAttribs) { setAttribs = true; SetAttribs(0); }
705 if(!mergeValues) { FinalizeLoading(); return; }
712 class StringOptionBox : OptionBox<String>
716 bool NotifyModified(EditBox editBox)
718 ((OptionBox)editBox.id).Retrieve();
722 textHorzScroll = true;
725 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
727 String * string = (String*)((byte *)options + option);
728 if(*string) delete *string;
729 *string = CopyString(((EditBox)editor).contents);
732 void LoadOption(ProjectOptions options)
734 ((EditBox)editor).contents = options ? *(String*)((byte *)options + option) : "";
735 ((EditBox)editor).Deselect();
738 bool OptionCheck(ProjectOptions options)
740 String string = *(String*)((byte *)options + option);
741 return string && string[0];
744 void UnsetOption(ProjectOptions options)
746 delete *(String*)((byte *)options + option);
750 class PathOptionBox : OptionBox<String>
752 bool Window::EditBoxORB(int x, int y, Modifiers mods)
754 Window parent = this.parent;
755 x += clientStart.x + position.x;
756 y += clientStart.y + position.y;
757 return ((OptionBox)this).OptionBox_OnRightButtonDown(parent, x, y, mods);
762 typeExpected = directory, browseDialog = { };
763 editBox.OnRightButtonDown = (void *)EditBoxORB;
765 bool NotifyModified(PathBox pathBox)
767 ((OptionBox)pathBox.id).Retrieve();
772 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
774 String * string = (String*)((byte *)options + option);
775 String slashPath = ((PathBox)editor).slashPath;
776 if(*string) delete *string;
777 *string = CopyString(slashPath);//(slashPath && slashPath[0]) ? CopyString(slashPath) : null;
780 void LoadOption(ProjectOptions options)
782 ((PathBox)editor).path = options ? *(String*)((byte *)options + option) : "";
783 ((PathBox)editor).Deselect();
786 bool OptionCheck(ProjectOptions options)
788 String string = *(String*)((byte *)options + option);
789 return string && string[0];
792 void UnsetOption(ProjectOptions options)
794 delete *(String*)((byte *)options + option);
798 class MultiStringOptionBox : OptionBox<Array<String>>
803 caseSensitive = true;
805 virtual Array<String> GetStrings();
806 virtual void SetStrings(Array<String> value);
808 Array<String> tempStrings;
810 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
812 Array<String> newStrings = GetStrings();
813 Array<String> * strings = (Array<String>*)((byte *)options + option);
814 if(*strings) { strings->Free(); delete *strings; }
818 Iterator<String> it { newStrings };
820 FigureOutInherited();
824 Array<String> ts = tempStrings;
829 for(i : tempStrings; !(caseSensitive ? strcmp : strcmpi)(i, s)) { found = true; break; }
830 if(found && (!configReplaces || platform)) // ADDED || platform here...
840 if(!mergeValues || (configReplaces && isCfgOrPlt && !platform))
841 *strings = newStrings;
844 *strings = (newStrings && newStrings.count) ? newStrings : null;
845 if(newStrings && !newStrings.count) delete newStrings;
851 void LoadOption(ProjectOptions options)
855 Array<String> strings = options ? *((Array<String>*)((byte *)options + option) : null;
863 for(i : tempStrings; !(caseSensitive ? strcmp : strcmpi)(i, s)) { found = true; break; }
864 if(!found) tempStrings.Add(s);
870 SetStrings(options ? *(Array<String>*)((byte *)options + option) : null);
874 void FinalizeLoading()
878 SetStrings(tempStrings);
883 bool OptionSet(ProjectOptions options)
885 Array<String> strings = *(Array<String>*)((byte *)options + option);
886 if(mergeValues && !configReplaces)
888 return strings && strings.count;
891 return strings != null;
894 bool OptionCheck(ProjectOptions options)
896 Array<String> strings = *(Array<String>*)((byte *)options + option);
897 return strings && strings.count;
900 void UnsetOption(ProjectOptions options)
902 Array<String> * strings = (Array<String>*)((byte *)options + option);
903 if(*strings) { strings->Free(); delete *strings; }
907 class StringArrayOptionBox : MultiStringOptionBox
909 editor = StringListBox
911 bool NotifyModified(EditBox editBox)
913 ((OptionBox)editBox.id).Retrieve();
918 // NO VIRTUAL PROPERTIES YET...
919 Array<String> GetStrings() { return ((StringListBox)editor).strings; }
920 void SetStrings(Array<String> value) { ((StringListBox)editor).strings = value; }
923 class StringsArrayOptionBox : MultiStringOptionBox
933 bool NotifyModified(StringsBox stringsBox)
935 ((OptionBox)stringsBox.id).Retrieve();
940 Array<String> GetStrings() { return ((StringsBox)editor).strings; }
941 void SetStrings(Array<String> value) { ((StringsBox)editor).strings = value; }
944 class DirsArrayOptionBox : MultiStringOptionBox
946 editor = DirectoriesBox
948 bool NotifyModified(DirectoriesBox dirsBox)
950 ((OptionBox)dirsBox.id).Retrieve();
954 bool OnChangedDir(char * * directory)
956 char fixedDirectory[MAX_LOCATION] = "";
957 if(PathCat(fixedDirectory, *directory))
959 char cwdBackup[MAX_LOCATION];
962 GetWorkingDir(cwdBackup, sizeof(cwdBackup));
963 ChangeWorkingDir(project.topNode.path);
965 FileFixCase(fixedDirectory);
967 ChangeWorkingDir(cwdBackup);
969 *directory = CopyString(fixedDirectory);
975 bool OnPrepareBrowseDir(char * * directory)
977 char dir[MAX_LOCATION];
980 GetSystemPathBuffer(dir, project.topNode.path);
982 PathCat(dir, *directory);
985 strcpy(dir, *directory);
990 *directory = CopyString(dir);
992 // GCC 4.4 bug: ----- path becomes *directory
993 //strcpy(dir, path ? path : "");
997 bool OnBrowsedDir(char * * directory)
1001 char path[MAX_LOCATION];
1002 MakePathRelative(*directory, project.topNode.path, path);
1004 *directory = CopyString(path);
1010 Array<String> GetStrings() { return ((DirectoriesBox)editor).strings; }
1011 void SetStrings(Array<String> value) { ((DirectoriesBox)editor).strings = value; }
1014 class BoolOptionBox : OptionBox<SetBool>
1020 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
1022 ((OptionBox)button.id).Retrieve();
1027 bool OptionCheck(ProjectOptions options)
1029 return *(SetBool*)((byte *)options + option) == true;
1032 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
1034 bool checked = ((Button)editor).checked;
1035 *(SetBool*)((byte *)options + option) = checked ? true :
1036 ((currentNode.parent || isCfgOrPlt) ? false : unset);
1039 void LoadOption(ProjectOptions options)
1041 ((Button)editor).checked = options && (*(SetBool*)((byte *)options + option) == true);
1045 class CheckBoxForEnumOptionBox : OptionBox
1051 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
1053 ((OptionBox)button.id).Retrieve();
1056 for(slave = master.firstSlave; slave; slave = slave.nextSlave)
1058 if(eClass_IsDerived(slave._class, class(CheckBoxForEnumOptionBox)) &&
1059 slave != (Window)button.id &&
1060 ((OptionBox)slave).option == ((OptionBox)button.id).option)
1061 ((OptionBox)slave).Load();
1069 void LoadOption(ProjectOptions options)
1071 Z value = options ? *(Z*)((byte *)options + option) : (Z)0;
1072 ((Button)editor).checked = value == enumValue;
1075 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
1077 Button checkBox = (Button)editor;
1078 if(checkBox.checked)
1079 *(Z*)((byte *)options + option) = enumValue;
1083 class BuildBitDepthOptionBox : CheckBoxForEnumOptionBox<BuildBitDepth> { }
1085 class DropOptionBox : OptionBox
1089 bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
1091 ((OptionBox)dropBox.id).Retrieve();
1096 void LoadOption(ProjectOptions options)
1098 DropBox dropBox = (DropBox)editor;
1099 Z value = options ? *(Z*)((byte *)options + option) : (Z)0;
1100 dropBox.currentRow = value ? dropBox.FindRow((int64)value) : dropBox.firstRow;
1103 void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
1105 DropBox dropBox = (DropBox)editor;
1106 DataRow row = dropBox.currentRow;
1107 Z value = (Z)(row ? row.tag : 0);
1108 *(Z*)((byte *)options + option) = value;
1112 class TargetTypeDB : DropOptionBox<TargetTypes>
1118 row = ((DropBox)editor).AddRow();
1119 row.tag = TargetTypes::executable;
1120 row.SetData(null, $"Executable");
1122 row = ((DropBox)editor).AddRow();
1123 row.tag = TargetTypes::sharedLibrary;
1124 row.SetData(null, $"Shared Library");
1126 row = ((DropBox)editor).AddRow();
1127 row.tag = TargetTypes::staticLibrary;
1128 row.SetData(null, $"Static Library");
1131 bool OptionCheck(ProjectOptions options)
1133 TargetTypes value = *(TargetTypes*)((byte *)options + option);
1134 return value && value != executable;
1138 class OptimizationDB : DropOptionBox<OptimizationStrategy>
1143 row = ((DropBox)editor).AddRow();
1144 row.tag = OptimizationStrategy::none;
1145 row.SetData(null, $"None");
1147 row = ((DropBox)editor).AddRow();
1148 row.tag = OptimizationStrategy::speed;
1149 row.SetData(null, $"For Speed (-O2)");
1151 row = ((DropBox)editor).AddRow();
1152 row.tag = OptimizationStrategy::size;
1153 row.SetData(null, $"For Size (-Os)");
1156 bool OptionCheck(ProjectOptions options)
1158 OptimizationStrategy value = *(OptimizationStrategy*)((byte *)options + option);
1159 return value && value != none;
1163 class WarningsDB : DropOptionBox<WarningsOption>
1168 row = ((DropBox)editor).AddRow();
1169 row.tag = WarningsOption::normal;
1170 row.SetData(null, $"Normal");
1172 row = ((DropBox)editor).AddRow();
1173 row.tag = WarningsOption::none;
1174 row.SetData(null, $"None");
1176 row = ((DropBox)editor).AddRow();
1177 row.tag = WarningsOption::all;
1178 row.SetData(null, $"All");
1181 bool OptionCheck(ProjectOptions options)
1183 WarningsOption value = *(WarningsOption*)((byte *)options + option);
1184 return value && value != none;
1188 void DrawStipple(Surface surface, Size clientSize)
1192 int x2 = clientSize.w - 1;
1193 int y2 = clientSize.h - 1;
1194 if((x2 - x1) & 1) x2--;
1195 if((y2 - y1) & 1) y2--;
1197 surface.LineStipple(0x5555);
1198 surface.Rectangle(x1, y1, x2, y2);
1199 surface.LineStipple(0);
1202 class BuildTab : Tab
1205 background = formColor;
1208 ProjectNode backupNode;
1209 String activeConfigName;
1211 ProjectNode lastSelectedNode;
1213 property char * selectedConfigName
1219 SelectorButton button = (SelectorButton)configSelector.selectedButton;
1220 if(button && button.id)
1222 ProjectConfig config = (ProjectConfig)button.id;
1230 property char * selectedPlatformName
1236 SelectorButton button = (SelectorButton)platformSelector.selectedButton;
1237 if(button && button.id)
1239 Platform platform = (Platform)button.id;
1240 char * platformName = platform ? platform.OnGetString(0,0,0) : null; // all these platformName are leaking, no?
1241 return platformName;
1248 Label labelConfigurations
1250 this, anchor = { left = 8, top = 14 }, labeledWindow = configSelector;
1252 void OnRedraw(Surface surface)
1254 Label::OnRedraw(surface);
1255 if(labeledWindow.active) DrawStipple(surface, clientSize);
1258 SelectorBar configSelector
1260 this, text = $"Configurations: ", anchor = { left = 98, top = 8, right = 54 }; size = { 0, 26 };
1262 direction = horizontal, scrollable = true;
1264 bool OnKeyDown(Key key, unichar ch)
1268 ((BuildTab)parent).createConfig.NotifyClicked(parent, ((BuildTab)parent).createConfig, 0, 0, 0);
1273 ((BuildTab)parent).deleteConfig.NotifyClicked(parent, ((BuildTab)parent).deleteConfig, 0, 0, 0);
1276 return SelectorBar::OnKeyDown(key, ch);
1279 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
1281 ((BuildTab)master).labelConfigurations.Update(null);
1288 parent = this, bevelOver = true, inactive = true;
1290 anchor = { top = 10, right = 31 };
1291 hotKey = altC, bitmap = BitmapResource { fileName = ":actions/docNew.png", alphaBlend = true };
1293 bool NotifyClicked(Button b, int x, int y, Modifiers mods)
1295 char tmp[MAX_F_STRING];
1296 ProjectConfig config;
1297 EditableSelectorButton button;
1299 FindUniqueConfigName("NewConfig", false, tmp);
1303 makingModified = true;
1304 compilingModified = true;
1305 linkingModified = true;
1306 name = CopyString(tmp);
1309 // objectsDirectory = /*CopyString(*/defaultObjDirExpression/*)*/;
1312 if(!project.topNode.configurations) project.topNode.configurations = { };
1313 project.topNode.configurations.Add(config);
1315 targetType = project.config.options.targetType;
1317 config.options.targetFileName = project.moduleName;
1318 config.options.targetDir.dir = "";
1319 config.options.objectsDirectory = defaultObjDirExpression);
1320 config.options.debug = true;
1321 config.options.optimization = none;
1322 config.options.warnings = all;
1327 configSelector, renameable = true, master = this, text = config.name, id = (int64)config;
1328 NotifyClicked = ConfigClicked, OnRename = ConfigOnRename;
1331 configSelector.Select(button);
1332 modifiedDocument = true;
1336 /*Button duplicateConfig
1338 parent = this, bevelOver = true, inactive = true;
1340 anchor = { top = 10, right = 31 };
1341 hotKey = altU, bitmap = BitmapResource { fileName = ":actions/editCopy.png", alphaBlend = true };
1345 parent = this, bevelOver = true, inactive = true;
1347 anchor = { top = 10, right = 8 };
1348 hotKey = altD, bitmap = BitmapResource { fileName = ":actions/delete2.png", alphaBlend = true };
1350 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
1354 String title = PrintString($"Delete ", config.name, $" Configuration");
1355 String msg = PrintString($"Are you sure you wish to delete the ", config.name, $" configuration?");
1356 if(MessageBox { type = okCancel, text = title, contents = msg }.Modal() == ok)
1358 Iterator<Window> it { configSelector.controls };
1359 ProjectConfig configToDelete = config;
1363 SelectorButton button = (SelectorButton)it.data;
1364 if((ProjectConfig)button.id == config)
1366 button.visible = false;
1371 button = (SelectorButton)it.data;
1372 config = (ProjectConfig)button.id;
1373 configSelector.Select(button);
1379 SelectorButton button = configSelector.FindButtonByID((int64)configToDelete);
1381 configSelector.RemoveButton(button);
1383 project.topNode.DeleteConfig(configToDelete);
1385 modifiedDocument = true;
1394 Label labelPlatforms
1396 this, anchor = { left = 8, top = 44 }, labeledWindow = platformSelector;
1398 void OnRedraw(Surface surface)
1400 Label::OnRedraw(surface);
1401 if(labeledWindow.active) DrawStipple(surface, clientSize);
1404 SelectorBar platformSelector
1406 this, text = $"Platforms: ", anchor = { left = 64, top = 38, right = 54 }; size = { 0, 26 };
1408 direction = horizontal, scrollable = true;
1410 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
1412 ((BuildTab)master).labelPlatforms.Update(null);
1417 TabControl buildTabControl
1419 this, background = formColor, anchor = { left = 8, top = 64, right = 8, bottom = 8 };
1420 curTab = compilerTab;
1422 CompilerTab compilerTab { this, tabControl = buildTabControl };
1423 LinkerTab linkerTab { this, tabControl = buildTabControl };
1424 BuilderTab builderTab { this, tabControl = buildTabControl };
1427 this, font = { font.faceName, font.size, italic = true }, stayOnTop = true,
1428 text = $"(Right click or press Ctrl-Del to revert an option to inherited value)", anchor = { top = 72, right = 16 }
1431 void FindUniqueConfigName(char * baseName, bool startWithNumber, char * output)
1434 char tmp[MAX_F_STRING];
1436 sprintf(tmp, "%s%d", baseName, num);
1438 strcpy(tmp, baseName);
1441 ProjectConfig config = null;
1442 for(c : project.topNode.configurations)
1443 { // TOFIX: Error when omitting these brackets, c not found
1444 if(c.name && !strcmp(c.name, tmp))
1453 sprintf(tmp, "%s%d", baseName, num);
1458 strcpy(output, tmp);
1461 bool PlatformClicked(Button clickedButton, int x, int y, Modifiers mods)
1463 if(!eClass_IsDerived(clickedButton._class, class(EditableSelectorButton)) || !((EditableSelectorButton)clickedButton).editBox)
1465 platform = (Platform)clickedButton.id;
1467 // Load Settings Into Dialog
1468 compilerTab.LoadSettings();
1469 linkerTab.LoadSettings();
1470 builderTab.LoadSettings();
1473 buildTabControl.Activate();
1475 if(compilerTab.rightPaneHeader.visible)
1476 compilerTab.rightPaneHeader.Update(null);
1477 ((ProjectSettings)master).UpdateDialogTitle();
1484 platformSelector.DestroyChildren();
1485 configSelector.DestroyChildren();
1487 delete activeConfigName;
1490 bool ConfigOnRename(EditableSelectorButton button, char * * oldName, char * * newName)
1495 for(c = 0; (ch = (*newName)[c]); c++)
1497 if(ch == '_' || isalpha(ch) || (isdigit(ch) && d))
1498 (*newName)[d++] = ch;
1504 for(c : project.topNode.configurations; c != config)
1506 if(!strcmpi(c.name, *newName))
1512 if(found || !(*newName)[0])
1514 char tmp[MAX_F_STRING];
1515 char * tmpName = config.name;
1517 FindUniqueConfigName("NewConfig", false, tmp);
1518 config.name = tmpName;
1520 *newName = CopyString(tmp);
1524 if(activeConfigName && !strcmp(activeConfigName, *oldName))
1526 delete activeConfigName;
1527 activeConfigName = CopyString(*newName);
1530 project.topNode.RenameConfig(config.name, *newName);
1532 modifiedDocument = true;
1536 bool ConfigClicked(Button clickedButton, int x, int y, Modifiers mods)
1538 if(!eClass_IsDerived(clickedButton._class, class(EditableSelectorButton)) || !((EditableSelectorButton)clickedButton).editBox)
1540 config = (ProjectConfig)clickedButton.id;
1542 // Load Settings Into Dialog
1543 compilerTab.LoadSettings();
1544 linkerTab.LoadSettings();
1545 builderTab.LoadSettings();
1547 deleteConfig.disabled = (clickedButton._class == class(SelectorButton));
1550 buildTabControl.Activate();
1552 compilerTab.fileList.Update(null);
1553 if(compilerTab.rightPaneHeader.visible)
1554 compilerTab.rightPaneHeader.Update(null);
1555 ((ProjectSettings)master).UpdateDialogTitle();
1560 void SelectNode(ProjectNode node, bool ignoreAsLastSelection)
1562 if(node != currentNode)
1564 Window ac = compilerTab.rightPane.activeChild;
1565 bool prevNodeRes = currentNode ? currentNode.isInResources : false;
1568 if(!node) node = project.topNode;
1570 newNodeRes = node.isInResources;
1573 if(!ignoreAsLastSelection)
1574 lastSelectedNode = node;
1576 ((ProjectSettings)master).UpdateDialogTitle();
1577 if(node.type == project)
1579 compilerTab.rightPaneHeader.visible = false;
1583 compilerTab.rightPaneHeader.id = (int64)node;
1584 compilerTab.rightPaneHeader.Update(null);
1585 compilerTab.rightPaneHeader.visible = true;
1589 DataRow row = compilerTab.fileList.FindSubRow((int64)currentNode);
1592 compilerTab.fileList.currentRow = row;
1593 while((row = row.parent))
1594 row.collapsed = false;
1598 if(prevNodeRes != newNodeRes)
1600 compilerTab.labelObjDir.visible = !newNodeRes;
1601 compilerTab.objDir.visible = !newNodeRes;
1602 compilerTab.excludeFromBuild.visible = !newNodeRes;
1603 compilerTab.labelPreprocessorDefs.visible = !newNodeRes;
1604 compilerTab.preprocessorDefs.visible = !newNodeRes;
1605 compilerTab.labelDefaultNameSpace.visible = !newNodeRes;
1606 compilerTab.defaultNameSpace.visible = !newNodeRes;
1607 compilerTab.strictNameSpaces.visible = !newNodeRes;
1608 compilerTab.memoryGuard.visible = !newNodeRes;
1609 compilerTab.noLineNumbers.visible = !newNodeRes;
1610 compilerTab.debug.visible = !newNodeRes;
1611 compilerTab.labelWarnings.visible = !newNodeRes;
1612 compilerTab.warnings.visible = !newNodeRes;
1613 compilerTab.profiling.visible = !newNodeRes;
1614 compilerTab.labelOptimization.visible = !newNodeRes;
1615 compilerTab.optimization.visible = !newNodeRes;
1616 compilerTab.fastMath.visible = !newNodeRes;
1617 compilerTab.labelIncludeDirs.visible = !newNodeRes;
1618 compilerTab.includeDirs.visible = !newNodeRes;
1621 if(node == project.topNode)
1623 compilerTab.objDir.visible = true;
1624 compilerTab.labelObjDir.visible = true;
1626 compilerTab.excludeFromBuild.visible = false;
1630 compilerTab.objDir.visible = false;
1631 compilerTab.labelObjDir.visible = false;
1633 compilerTab.excludeFromBuild.visible = (node != project.resNode);
1636 // Load Settings Into Dialog
1637 compilerTab.LoadSettings();
1638 linkerTab.LoadSettings();
1639 builderTab.LoadSettings();
1645 if(ac == compilerTab.excludeFromBuild.editor)
1646 ac = compilerTab.objDir.editor;
1647 else if(compilerTab.excludeFromBuild.editor.visible)
1648 ac = compilerTab.excludeFromBuild.editor;
1655 void CreateConfigButtons()
1657 SelectorButton commonButton;
1659 // Create Config Buttons
1660 commonButton = SelectorButton
1662 configSelector, master = this, text = $"Common", id = (int64)null; font = { font.faceName, font.size, true };
1664 NotifyClicked = ConfigClicked;
1669 if(project.topNode.configurations)
1671 for(c : project.topNode.configurations)
1673 EditableSelectorButton button
1675 configSelector, master = this, renameable = true, text = c.name, id = (int64)c;
1676 NotifyClicked = ConfigClicked, OnRename = ConfigOnRename;
1685 SelectorButton button;
1687 activeConfigName = project.config ? CopyString(project.config.name) : null;
1689 compilerTab.AddNode(project.topNode, null);
1691 CreateConfigButtons();
1693 platformButton = button =
1695 platformSelector, master = this, text = $"Common", id = 0; font = { font.faceName, font.size, true };
1696 NotifyClicked = PlatformClicked; checked = true;
1701 for(p = (Platform)1; p < Platform::enumSize; p++)
1703 SelectorButton button
1705 platformSelector, master = this, text = p.OnGetString(0,0,0), id = (int64)p;
1706 NotifyClicked = PlatformClicked;
1710 SelectorButton platformButton;
1714 // Backup Current Settings
1715 backupNode = project.topNode.Backup();
1717 buildTabControl.Activate();
1720 Iterator<Window> it { configSelector.controls };
1723 SelectorButton configButton = (SelectorButton)it.data;
1724 ProjectConfig buttonConfig = (ProjectConfig)configButton.id;
1725 if(buttonConfig == project.config)
1727 configButton.Activate();
1728 configButton.checked = true;
1729 ConfigClicked(configButton, 0, 0, (Modifiers)null);
1736 platformButton.MakeActive();
1737 platformButton = null;
1746 lastSelectedNode = null;
1748 project.config = null;
1750 /* // THIS IS NOW AUTOMATED WITH A project CHECK IN ProjectNode
1751 project.configurations = project.topNode.configurations;
1752 project.platforms = project.topNode.platforms;
1753 project.options = project.topNode.options;
1756 if(project.topNode.configurations)
1758 for(c : project.topNode.configurations)
1760 if(!strcmpi(c.name, activeConfigName))
1767 if(!project.config && project.topNode.configurations.count)
1768 project.config = project.topNode.configurations[0];
1770 ide.UpdateToolBarActiveConfigs(false);
1773 void RevertChanges()
1775 String configName = config ? CopyString(config.name) : null;
1777 // Revert to saved project options
1778 project.topNode.Revert(backupNode);
1780 configSelector.DestroyChildren();
1781 CreateConfigButtons();
1783 // Reselect Configuration
1786 Iterator<Window> it { configSelector.controls };
1789 Button button = (Button)it.data;
1790 ProjectConfig c = (ProjectConfig)button.id;
1791 if(c && !strcmp(c.name, configName))
1795 button.checked = true;
1796 ConfigClicked(button, 0,0, 0);
1802 SelectNode(project.topNode, false);
1807 bool OnClose(bool parentClosing)
1809 if(modifiedDocument)
1811 DialogResult diagRes = MessageBox
1813 type = yesNoCancel, master = ide,
1814 text = $"Save changes to project settings?",
1815 contents = $"Would you like to save changes made to the build options?"
1819 if(diagRes == cancel)
1823 project.MarkChanges(backupNode);
1824 project.topNode.modified = true;
1825 ide.projectView.modifiedDocument = true;
1826 ide.UpdateToolBarActiveConfigs(false);
1827 ide.projectView.Update(null);
1829 modifiedDocument = false;
1835 class CompilerTab : Tab
1837 background = formColor;
1840 Window leftPane { this, size = { 180 }, anchor = { left = 0, top = 0, bottom = 0 }, background = formColor };
1842 Label labelFileList { leftPane, this, position = { 8, 8 }, labeledWindow = fileList };
1845 leftPane, this, borderStyle = deep, hasVertScroll = true, hasHorzScroll = true;
1846 // THIS WOULD BE EVEN MORE FUN: multiSelect = true,
1847 fullRowSelect = false, collapseControl = true, treeBranches = true;
1848 alwaysHighLight = true;
1849 selectionColor = unfocusedSelectorColor;
1851 anchor = Anchor { left = 8, top = 24, right = 4, bottom = 8 };
1854 bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
1856 BuildTab buildTab = (BuildTab)master;
1857 ProjectNode node = (ProjectNode)row.tag;
1858 buildTab.SelectNode(node, false);
1862 void OnRedraw(Surface surface)
1864 ide.projectView.drawingInProjectSettingsDialog = true;
1865 ListBox::OnRedraw(surface);
1866 ide.projectView.drawingInProjectSettingsDialog = false;
1869 bool NotifyActivate(Window window, bool active, Window previous)
1873 //subclass(Skin) skinClass = (subclass(Skin))eSystem_FindClass(app, app.skin);
1874 fileList.selectionColor = Color { 10, 36, 106 }; //skinClass.selectionColor; // darkBlue;
1876 else if(fileList.currentRow)
1878 DataRow currentRow = fileList.currentRow;
1879 //int headerSize = ((fileList.style.header) ? fileList.rowHeight : 0);
1880 int height = fileList.clientSize.h + 1;// - fileList.headerSize;
1881 fileList.selectionColor = unfocusedSelectorColor;
1882 if(currentRow && currentRow.index * fileList.rowHeight > fileList.scroll.y + height - fileList.rowHeight)
1883 fileList.SetScrollPosition(fileList.scroll.x, currentRow.index * fileList.rowHeight - height + fileList.rowHeight);
1884 else if(!currentRow || currentRow.index * fileList.rowHeight < fileList.scroll.y)
1885 fileList.SetScrollPosition(fileList.scroll.x, currentRow ? currentRow.index * fileList.rowHeight : 0);
1895 this, anchor = { left = 196, top = 0, right = 0, bottom = 0 }, background = formColor, tabCycle = true;
1898 Window rightPaneHeader
1900 rightPane, this, size = { h = 21 }, anchor = { left = 0, top = 0, right = 0 }, background = Color { 70, 96, 166 };//0x0F3F66;
1901 foreground = white; visible = false;
1903 void OnRedraw(Surface surface)
1907 ide.projectView.drawingInProjectSettingsDialogHeader = true;
1908 ((void (*)(void *, void *, void *, int, int, int, void *, uint, uint))(void *)class(ProjectNode)._vTbl[__ecereVMethodID_class_OnDisplay])(class(ProjectNode),
1909 (void *)id, surface, 8, 2, clientSize.w, ide.projectView, Alignment::left, DataDisplayFlags { selected = true });
1910 ide.projectView.drawingInProjectSettingsDialogHeader = false;
1915 PaneSplitter splitter
1917 this, leftPane = leftPane, rightPane = rightPane, split = 188
1920 Label labelObjDir { rightPane, this, position = { 8, 8 }, labeledWindow = objDir };
1921 PathOptionBox objDir
1923 rightPane, this, size = { 250, 22 }, anchor = { left = 8, top = 24, right = 8 };
1924 text = $"Intermediate Objects Directory", hotKey = altJ, option = OPTION(objectsDirectory);
1927 BoolOptionBox excludeFromBuild
1929 rightPane, this, position = { 8, 28 },
1930 text = $"Exclude from Build", visible = false, option = OPTION(excludeFromBuild);
1933 Label labelPreprocessorDefs { rightPane, this, position = { 8, 50 }, labeledWindow = preprocessorDefs };
1934 StringArrayOptionBox preprocessorDefs
1936 rightPane, this, size = { 290, 22 }, anchor = { left = 8, top = 66, right = 8 };
1937 text = $"Preprocessor Definitions", hotKey = altD, option = OPTION(preprocessorDefinitions);
1940 Label labelDefaultNameSpace { rightPane, this, position = { 8, 92 }, labeledWindow = defaultNameSpace };
1941 StringOptionBox defaultNameSpace
1943 rightPane, this, size = { 160, 22 }, position = { 8, 108 };
1944 text = $"Default Name Space", option = OPTION(defaultNameSpace);
1946 BoolOptionBox strictNameSpaces
1948 rightPane, this, position = { 172, 112 },
1949 text = $"Strict Name Spaces", option = OPTION(strictNameSpaces);
1952 BoolOptionBox fastMath
1954 rightPane, this, position = { 316, 112 },
1955 text = $"Fast Math", option = OPTION(fastMath);
1958 BoolOptionBox memoryGuard
1960 rightPane, this, position = { 8, 154 };
1961 text = $"MemoryGuard", hotKey = altM, option = OPTION(memoryGuard);
1964 Label labelWarnings { rightPane, position = { 116, 138 }, labeledWindow = warnings };
1967 rightPane, this, position = { 116, 154 };
1968 text = $"Warnings", hotKey = altW, option = OPTION(warnings);
1971 Label labelOptimization { rightPane, position = { 220, 138 }, labeledWindow = optimization };
1972 OptimizationDB optimization
1974 rightPane, this, position = { 220, 154 }, size = { 120, 22 };
1975 text = $"Optimization", hotKey = altO, option = OPTION(optimization);
1980 rightPane, this, position = { 8, 188 };
1981 text = $"Debuggable", hotKey = altG, option = OPTION(debug);
1984 BoolOptionBox profiling
1986 rightPane, this, position = { 116, 188 };
1987 text = $"Profiling Data", hotKey = altP, option = OPTION(profile);
1990 BoolOptionBox noLineNumbers
1992 rightPane, this, position = { 220, 188 };
1993 text = $"No Line Numbers", hotKey = altN, option = OPTION(noLineNumbers);
1996 Label labelIncludeDirs { includeDirs.editor, labeledWindow = includeDirs, position = { 0, 6 }; };
1997 DirsArrayOptionBox includeDirs
1999 rightPane, this, size = { 290, 22 }, anchor = { left = 8, top = 208, right = 8, bottom = 8 };
2000 text = $"Additional Include Directories", hotKey = altI, option = OPTION(includeDirs);
2005 fileList.AddField(DataField { dataType = class(ProjectNode), freeData = false,
2006 userData = null /* Now set in the ProjectNode directly to know we're in ProjectSettings Dialog -- ide.projectView*/ });
2011 BuildTab buildTab = (BuildTab)master;
2012 buildTab.SelectNode(buildTab.lastSelectedNode, true);
2016 void AddNode(ProjectNode node, DataRow addTo)
2018 DataRow row = addTo ? addTo.AddRow() : fileList.AddRow();
2020 row.tag = (int64)node;
2022 row.SetData(null, node);
2024 if(node.files && node.files.first && node.parent &&
2025 !(!node.parent.parent &&
2026 (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") ||
2027 !strcmpi(node.name, "src") || !strcmpi(node.name, "tools"))))
2028 row.collapsed = true;
2029 else if(node.type == folder)
2030 node.icon = openFolder;
2034 for(child : node.files)
2035 AddNode(child, row);
2042 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
2043 if(eClass_IsDerived(ob._class, class(OptionBox)))
2046 if(activeChild && activeChild.active)
2048 Window control = activeChild;
2049 control.Deactivate();
2056 objDir.editor.Activate();
2061 class LinkerTab : Tab
2063 background = formColor;
2066 Label labelTargetName { this, position = { 8, 8 }, labeledWindow = targetName };
2067 StringOptionBox targetName
2069 this, position = { 8, 24 }, size = { 200, 22 };
2070 text = $"Target Name", hotKey = altN, option = OPTION(targetFileName);
2073 Label labelTargetType { this, position = { 216, 8 }, labeledWindow = targetType };
2074 TargetTypeDB targetType
2076 this, position = { 216, 24 }, size = { 120, 22 };
2077 text = $"Target Type", hotKey = altT, option = OPTION(targetType);
2080 Label labelTargetDirectory { this, position = { 344, 8 }, labeledWindow = targetDirectory };
2081 PathOptionBox targetDirectory
2083 this, size = { 270, 22 }, anchor = { left = 344, top = 24, right = 8 };
2084 hotKey = altR, text = $"Target Directory", option = OPTION(targetDirectory);
2087 Label labelLibraries { this, position = { 8, 50 }, labeledWindow = libraries };
2088 StringArrayOptionBox libraries
2090 this, size = { 290, 22 }, anchor = { left = 8, top = 66, right = 8 };
2091 text = $"Additional Libraries", hotKey = altL, option = OPTION(libraries);
2092 configReplaces = true;
2095 Label labelLinkerOptions { this, position = { 8, 92 }, labeledWindow = linkerOptions };
2096 StringArrayOptionBox linkerOptions
2098 this, size = { 290, 22 }, anchor = { left = 8, top = 108, right = 8 };
2099 text = $"Linker Options", hotKey = altO, option = OPTION(linkerOptions);
2100 configReplaces = true;
2103 BoolOptionBox console
2105 this, position = { 8, 138 };
2106 text = $"Console Application", hotKey = altC, option = OPTION(console);
2109 BoolOptionBox compress
2111 this, position = { 8, 162 };
2112 text = $"Compress", hotKey = altW, option = OPTION(compress);
2115 Label labelLibraryDirs { libraryDirs.editor, labeledWindow = libraryDirs, position = { 0, 6 }; };
2116 DirsArrayOptionBox libraryDirs
2118 this, size = { 290, 22 }, anchor = { left = 8, top = 182, right = 8, bottom = 8 };
2119 text = $"Additional Library Directories", hotKey = altY, option = OPTION(libraryDirs);
2124 ((BuildTab)master).SelectNode(project.topNode, true);
2131 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
2132 if(eClass_IsDerived(ob._class, class(OptionBox)))
2134 compress.disabled = (config && config.options && config.options.debug == true) || project.topNode.options.debug == true;
2136 if(activeChild && activeChild.active)
2138 Window control = activeChild;
2139 control.Deactivate();
2145 class BuilderTab : Tab
2147 background = formColor;
2150 Label labelPrebuildCommands { prebuildCommands.editor, labeledWindow = prebuildCommands, position = { 0, 6 }; };
2151 StringsArrayOptionBox prebuildCommands
2153 this, size = { 290, 100 }, anchor = { left = 8, top = 8, right = 8, bottom = 0.5 };
2154 text = $"Pre-build Commands", hotKey = altE, option = OPTION(prebuildCommands);
2157 Label labelPostbuildCommands { postbuildCommands.editor, labeledWindow = postbuildCommands, position = { 0, 6 }; };
2158 StringsArrayOptionBox postbuildCommands
2160 this, size = { 290 }, anchor = { left = 8, top = 0.5, right = 8, bottom = 8 };
2161 text = $"Post-build Commands", hotKey = altT, option = OPTION(postbuildCommands);
2166 bool disabled = strlen(((BuildTab)master).selectedPlatformName) > 0;
2168 for(ob = (OptionBox)firstSlave; ob; ob = (OptionBox)ob.nextSlave)
2169 if(eClass_IsDerived(ob._class, class(OptionBox)))
2172 if(activeChild && activeChild.active)
2174 Window control = activeChild;
2175 control.Deactivate();